From 3accb4c451497a346ded8d66fb4ff4730fd61bc0 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Fri, 17 Mar 2023 13:34:10 -0700 Subject: [PATCH 1/5] fix signature in MsgCertificateChain --- c/include/libsbp/cpp/message_traits.h | 112 +- c/include/libsbp/legacy/cpp/message_traits.h | 18 +- c/include/libsbp/legacy/signing.h | 79 +- c/include/libsbp/sbp_msg_type.h | 4 +- c/include/libsbp/signing_macros.h | 179 +- c/include/libsbp/v4/sbp_msg.h | 51 +- c/include/libsbp/v4/signing.h | 5 +- c/include/libsbp/v4/signing/ECDSASignature.h | 163 + .../libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h | 14 +- .../v4/signing/MSG_CERTIFICATE_CHAIN_DEP.h | 207 ++ .../libsbp/v4/signing/MSG_ECDSA_SIGNATURE.h | 13 +- ...TURE_DEP.h => MSG_ECDSA_SIGNATURE_DEP_A.h} | 106 +- .../v4/signing/MSG_ECDSA_SIGNATURE_DEP_B.h | 236 ++ .../v4/signing/MSG_ED25519_SIGNATURE_DEP.h | 199 -- c/src/include/libsbp/internal/v4/signing.h | 68 +- c/src/v4/signing.c | 474 ++- ...to_check_sbp_signing_MsgCertificateChain.c | 708 ++-- ...check_sbp_signing_MsgCertificateChainDep.c | 1117 +++++++ ...auto_check_sbp_signing_MsgEcdsaSignature.c | 606 ++-- ...o_check_sbp_signing_MsgEcdsaSignatureDep.c | 1956 ----------- ..._check_sbp_signing_MsgEcdsaSignatureDepA.c | 1989 ++++++++++++ ..._check_sbp_signing_MsgEcdsaSignatureDepB.c | 740 +++++ c/test/check_main.c | 4 +- c/test/check_main_legacy.c | 8 +- c/test/check_suites.h | 4 +- c/test/check_suites_legacy.h | 4 +- ...o_check_sbp_signing_MsgCertificateChain.cc | 574 ++-- ...heck_sbp_signing_MsgCertificateChainDep.cc | 792 +++++ ...uto_check_sbp_signing_MsgEcdsaSignature.cc | 592 ++-- ...heck_sbp_signing_MsgEcdsaSignatureDepA.cc} | 18 +- ...check_sbp_signing_MsgEcdsaSignatureDepB.cc | 516 +++ ...to_check_sbp_signing_MsgCertificateChain.c | 862 ++--- ...check_sbp_signing_MsgCertificateChainDep.c | 1284 ++++++++ ...auto_check_sbp_signing_MsgEcdsaSignature.c | 884 ++--- ...check_sbp_signing_MsgEcdsaSignatureDepA.c} | 20 +- ..._check_sbp_signing_MsgEcdsaSignatureDepB.c | 858 +++++ ...o_check_sbp_signing_MsgCertificateChain.cc | 928 +++--- ...heck_sbp_signing_MsgCertificateChainDep.cc | 1191 +++++++ ...uto_check_sbp_signing_MsgEcdsaSignature.cc | 950 +++--- ...heck_sbp_signing_MsgEcdsaSignatureDepA.cc} | 22 +- ...check_sbp_signing_MsgEcdsaSignatureDepB.cc | 762 +++++ haskell/src/SwiftNav/SBP/Msg.hs | 24 +- haskell/src/SwiftNav/SBP/Signing.hs | 219 +- .../com/swiftnav/sbp/client/MessageTable.java | 12 +- .../swiftnav/sbp/signing/ECDSASignature.java | 58 + .../sbp/signing/MsgCertificateChain.java | 16 +- .../sbp/signing/MsgCertificateChainDep.java | 98 + .../sbp/signing/MsgEcdsaSignature.java | 25 +- ...ureDep.java => MsgEcdsaSignatureDepA.java} | 16 +- .../sbp/signing/MsgEcdsaSignatureDepB.java | 126 + ...bp_signing_MsgCertificateChainDepTest.java | 1489 +++++++++ ...k_sbp_signing_MsgCertificateChainTest.java | 693 ++-- ...sbp_signing_MsgEcdsaSignatureDepATest.java | 2848 +++++++++++++++++ ...sbp_signing_MsgEcdsaSignatureDepBTest.java | 885 +++++ ...eck_sbp_signing_MsgEcdsaSignatureTest.java | 310 +- javascript/sbp.bundle.js | 2 +- javascript/sbp/signing.js | 200 +- jsonschema/ECDSASignature.json | 26 + jsonschema/MsgCertificateChain.json | 2 +- jsonschema/MsgEcdsaSignature.json | 4 +- proto/signing.proto | 16 +- python/sbp/signing.py | 368 ++- python/tests/sbp/test_table.py | 2 +- rust/sbp/src/messages/mod.rs | 129 +- rust/sbp/src/messages/signing.rs | 390 ++- ...check_sbp_signing_msg_certificate_chain.rs | 1319 ++++---- ...k_sbp_signing_msg_certificate_chain_dep.rs | 2142 +++++++++++++ ...o_check_sbp_signing_msg_ecdsa_signature.rs | 1348 ++++---- ..._sbp_signing_msg_ecdsa_signature_dep_a.rs} | 24 +- ...k_sbp_signing_msg_ecdsa_signature_dep_b.rs | 1418 ++++++++ rust/sbp/tests/integration/main.rs | 4 +- .../sbp/signing/test_MsgCertificateChain.yaml | 166 +- .../signing/test_MsgCertificateChainDep.yaml | 163 + .../sbp/signing/test_MsgEcdsaSignature.yaml | 173 +- ...p.yaml => test_MsgEcdsaSignatureDepA.yaml} | 4 +- .../signing/test_MsgEcdsaSignatureDepB.yaml | 113 + spec/yaml/swiftnav/sbp/signing.yaml | 105 +- 77 files changed, 26850 insertions(+), 7404 deletions(-) create mode 100644 c/include/libsbp/v4/signing/ECDSASignature.h create mode 100644 c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN_DEP.h rename c/include/libsbp/v4/signing/{MSG_ECDSA_SIGNATURE_DEP.h => MSG_ECDSA_SIGNATURE_DEP_A.h} (69%) create mode 100644 c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_B.h delete mode 100644 c/include/libsbp/v4/signing/MSG_ED25519_SIGNATURE_DEP.h create mode 100644 c/test/auto_check_sbp_signing_MsgCertificateChainDep.c delete mode 100644 c/test/auto_check_sbp_signing_MsgEcdsaSignatureDep.c create mode 100644 c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c create mode 100644 c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c create mode 100644 c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc rename c/test/cpp/{auto_check_sbp_signing_MsgEcdsaSignatureDep.cc => auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc} (99%) create mode 100644 c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc create mode 100644 c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c rename c/test/legacy/{auto_check_sbp_signing_MsgEcdsaSignatureDep.c => auto_check_sbp_signing_MsgEcdsaSignatureDepA.c} (99%) create mode 100644 c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c create mode 100644 c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc rename c/test/legacy/cpp/{auto_check_sbp_signing_MsgEcdsaSignatureDep.cc => auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc} (99%) create mode 100644 c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc create mode 100644 java/src/com/swiftnav/sbp/signing/ECDSASignature.java create mode 100644 java/src/com/swiftnav/sbp/signing/MsgCertificateChainDep.java rename java/src/com/swiftnav/sbp/signing/{MsgEcdsaSignatureDep.java => MsgEcdsaSignatureDepA.java} (87%) create mode 100644 java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepB.java create mode 100644 java/test/auto_check_sbp_signing_MsgCertificateChainDepTest.java create mode 100644 java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepATest.java create mode 100644 java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepBTest.java create mode 100644 jsonschema/ECDSASignature.json create mode 100644 rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain_dep.rs rename rust/sbp/tests/integration/{auto_check_sbp_signing_msg_ecdsa_signature_dep.rs => auto_check_sbp_signing_msg_ecdsa_signature_dep_a.rs} (99%) create mode 100644 rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_b.rs create mode 100644 spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml rename spec/tests/yaml/swiftnav/sbp/signing/{test_MsgEcdsaSignatureDep.yaml => test_MsgEcdsaSignatureDepA.yaml} (99%) create mode 100644 spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml diff --git a/c/include/libsbp/cpp/message_traits.h b/c/include/libsbp/cpp/message_traits.h index 0121f2d5cf..31efc8a61c 100644 --- a/c/include/libsbp/cpp/message_traits.h +++ b/c/include/libsbp/cpp/message_traits.h @@ -1023,6 +1023,43 @@ struct MessageTraits { } }; +template <> +struct MessageTraits { + static constexpr sbp_msg_type_t id = SbpMsgCertificateChainDep; + static constexpr const char *name = "MSG_CERTIFICATE_CHAIN_DEP"; + static const sbp_msg_certificate_chain_dep_t &get(const sbp_msg_t &msg) { + return msg.certificate_chain_dep; + } + static sbp_msg_certificate_chain_dep_t &get(sbp_msg_t &msg) { + return msg.certificate_chain_dep; + } + static void to_sbp_msg(const sbp_msg_certificate_chain_dep_t &msg, + sbp_msg_t *sbp_msg) { + sbp_msg->certificate_chain_dep = msg; + } + static sbp_msg_t to_sbp_msg(const sbp_msg_certificate_chain_dep_t &msg) { + sbp_msg_t sbp_msg; + sbp_msg.certificate_chain_dep = msg; + return sbp_msg; + } + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_certificate_chain_dep_t &msg, + sbp_write_fn_t write) { + return sbp_msg_certificate_chain_dep_send(state, sender_id, &msg, write); + } + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t &msg) { + return sbp_msg_certificate_chain_dep_encode(buf, len, n_written, &msg); + } + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg) { + return sbp_msg_certificate_chain_dep_decode(buf, len, n_read, msg); + } + static size_t encoded_len(const sbp_msg_certificate_chain_dep_t &msg) { + return sbp_msg_certificate_chain_dep_encoded_len(&msg); + } +}; + template <> struct MessageTraits { static constexpr sbp_msg_type_t id = SbpMsgCertificateChain; @@ -1476,39 +1513,76 @@ struct MessageTraits { }; template <> -struct MessageTraits { - static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignatureDep; - static constexpr const char *name = "MSG_ECDSA_SIGNATURE_DEP"; - static const sbp_msg_ecdsa_signature_dep_t &get(const sbp_msg_t &msg) { - return msg.ecdsa_signature_dep; +struct MessageTraits { + static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignatureDepA; + static constexpr const char *name = "MSG_ECDSA_SIGNATURE_DEP_A"; + static const sbp_msg_ecdsa_signature_dep_a_t &get(const sbp_msg_t &msg) { + return msg.ecdsa_signature_dep_a; + } + static sbp_msg_ecdsa_signature_dep_a_t &get(sbp_msg_t &msg) { + return msg.ecdsa_signature_dep_a; + } + static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t &msg, + sbp_msg_t *sbp_msg) { + sbp_msg->ecdsa_signature_dep_a = msg; + } + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_a_t &msg) { + sbp_msg_t sbp_msg; + sbp_msg.ecdsa_signature_dep_a = msg; + return sbp_msg; + } + static s8 send(sbp_state_t *state, u16 sender_id, + const sbp_msg_ecdsa_signature_dep_a_t &msg, + sbp_write_fn_t write) { + return sbp_msg_ecdsa_signature_dep_a_send(state, sender_id, &msg, write); + } + static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_a_t &msg) { + return sbp_msg_ecdsa_signature_dep_a_encode(buf, len, n_written, &msg); + } + static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_a_t *msg) { + return sbp_msg_ecdsa_signature_dep_a_decode(buf, len, n_read, msg); + } + static size_t encoded_len(const sbp_msg_ecdsa_signature_dep_a_t &msg) { + return sbp_msg_ecdsa_signature_dep_a_encoded_len(&msg); + } +}; + +template <> +struct MessageTraits { + static constexpr sbp_msg_type_t id = SbpMsgEcdsaSignatureDepB; + static constexpr const char *name = "MSG_ECDSA_SIGNATURE_DEP_B"; + static const sbp_msg_ecdsa_signature_dep_b_t &get(const sbp_msg_t &msg) { + return msg.ecdsa_signature_dep_b; } - static sbp_msg_ecdsa_signature_dep_t &get(sbp_msg_t &msg) { - return msg.ecdsa_signature_dep; + static sbp_msg_ecdsa_signature_dep_b_t &get(sbp_msg_t &msg) { + return msg.ecdsa_signature_dep_b; } - static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_t &msg, + static void to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t &msg, sbp_msg_t *sbp_msg) { - sbp_msg->ecdsa_signature_dep = msg; + sbp_msg->ecdsa_signature_dep_b = msg; } - static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_t &msg) { + static sbp_msg_t to_sbp_msg(const sbp_msg_ecdsa_signature_dep_b_t &msg) { sbp_msg_t sbp_msg; - sbp_msg.ecdsa_signature_dep = msg; + sbp_msg.ecdsa_signature_dep_b = msg; return sbp_msg; } static s8 send(sbp_state_t *state, u16 sender_id, - const sbp_msg_ecdsa_signature_dep_t &msg, + const sbp_msg_ecdsa_signature_dep_b_t &msg, sbp_write_fn_t write) { - return sbp_msg_ecdsa_signature_dep_send(state, sender_id, &msg, write); + return sbp_msg_ecdsa_signature_dep_b_send(state, sender_id, &msg, write); } static s8 encode(uint8_t *buf, uint8_t len, uint8_t *n_written, - const sbp_msg_ecdsa_signature_dep_t &msg) { - return sbp_msg_ecdsa_signature_dep_encode(buf, len, n_written, &msg); + const sbp_msg_ecdsa_signature_dep_b_t &msg) { + return sbp_msg_ecdsa_signature_dep_b_encode(buf, len, n_written, &msg); } static s8 decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, - sbp_msg_ecdsa_signature_dep_t *msg) { - return sbp_msg_ecdsa_signature_dep_decode(buf, len, n_read, msg); + sbp_msg_ecdsa_signature_dep_b_t *msg) { + return sbp_msg_ecdsa_signature_dep_b_decode(buf, len, n_read, msg); } - static size_t encoded_len(const sbp_msg_ecdsa_signature_dep_t &msg) { - return sbp_msg_ecdsa_signature_dep_encoded_len(&msg); + static size_t encoded_len(const sbp_msg_ecdsa_signature_dep_b_t &msg) { + return sbp_msg_ecdsa_signature_dep_b_encoded_len(&msg); } }; diff --git a/c/include/libsbp/legacy/cpp/message_traits.h b/c/include/libsbp/legacy/cpp/message_traits.h index fb08e3b946..3050c926bf 100644 --- a/c/include/libsbp/legacy/cpp/message_traits.h +++ b/c/include/libsbp/legacy/cpp/message_traits.h @@ -1186,23 +1186,35 @@ struct MessageTraits { template<> -struct MessageTraits { +struct MessageTraits { static constexpr u16 id = 3077; }; template<> -struct MessageTraits { +struct MessageTraits { static constexpr u16 id = 3078; }; template<> -struct MessageTraits { +struct MessageTraits { static constexpr u16 id = 3079; }; +template<> +struct MessageTraits { + static constexpr u16 id = 3080; +}; + + +template<> +struct MessageTraits { + static constexpr u16 id = 3081; +}; + + template<> struct MessageTraits { static constexpr u16 id = 4097; diff --git a/c/include/libsbp/legacy/signing.h b/c/include/libsbp/legacy/signing.h index 18ee8ac7b7..5b74beeedf 100644 --- a/c/include/libsbp/legacy/signing.h +++ b/c/include/libsbp/legacy/signing.h @@ -39,6 +39,14 @@ typedef struct SBP_ATTR_PACKED { u32 ns; /**< nanoseconds of second (range 0-999999999) [nanoseconds] */ } utc_time_t; +typedef struct SBP_ATTR_PACKED { + u8 len; /**< Number of bytes to use of the signature field. The DER + encoded signature has a maximum size of 72 bytes but can + vary between 70 and 72 bytes in length. */ + u8 data[72]; /**< DER encoded ECDSA signature for the messages using SHA-256 + as the digest algorithm. */ +} ecdsa_signature_t; + /** An ECDSA certificate split over multiple messages * * A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1). @@ -56,6 +64,36 @@ typedef struct SBP_ATTR_PACKED { u8 certificate_bytes[0]; /**< DER encoded x.509 ECDSA certificate bytes */ } msg_ecdsa_certificate_t; +typedef struct SBP_ATTR_PACKED { + u8 root_certificate[20]; /**< SHA-1 fingerprint of the root + certificate */ + u8 intermediate_certificate[20]; /**< SHA-1 fingerprint of the intermediate + certificate */ + u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections + certificate */ + utc_time_t expiration; /**< The certificate chain comprised + of three fingerprints: root + certificate, intermediate + certificate and corrections + certificate. */ + ecdsa_signature_t signature; /**< Signature (created by + the root certificate) + over the concatenation + of the SBP payload bytes + preceding this field. + That is, the + concatenation of + `root_certificate`, + `intermediate_certificate`, + `corrections_certificate` + and `expiration`. This + certificate chain (allow + list) can also be + validated by fetching it + from + `http(s)://certs.swiftnav.com/chain`. */ +} msg_certificate_chain_t; + typedef struct SBP_ATTR_PACKED { u8 root_certificate[20]; /**< SHA-1 fingerprint of the root certificate */ @@ -79,7 +117,42 @@ typedef struct SBP_ATTR_PACKED { (allow list) can also be validated by fetching it from `http(s)://certs.swiftnav.com/chain`. */ -} msg_certificate_chain_t; +} msg_certificate_chain_dep_t; + +/** An ECDSA signature + * + * An ECDSA-256 signature using SHA-256 as the message digest algorithm. + */ + +typedef struct SBP_ATTR_PACKED { + u8 flags; /**< Describes the format of the `signed\_messages` + field below. */ + u8 stream_counter; /**< Signature message counter. Zero indexed and + incremented with each signature message. The + counter will not increment if this message was + in response to an on demand request. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 on_demand_counter; /**< On demand message counter. Zero indexed and + incremented with each signature message sent + in response to an on demand message. The + counter will roll over after 256 messages. + Upon connection, the value of the counter may + not initially be zero. */ + u8 certificate_id[4]; /**< The last 4 bytes of the certificate's SHA-1 + fingerprint */ + ecdsa_signature_t signature; /**< Signature over the frames of + this message group. */ + u8 signed_messages[0]; /**< CRCs of the messages covered by this + signature. For Skylark, which delivers SBP + messages wrapped in Swift's proprietary RTCM + message, these are the 24-bit CRCs from the + RTCM message framing. For SBP only streams, + this will be 16-bit CRCs from the SBP framing. + See the `flags` field to determine the type of + CRCs covered. */ +} msg_ecdsa_signature_t; /** An ECDSA signature * @@ -118,7 +191,7 @@ typedef struct SBP_ATTR_PACKED { this will be 16-bit CRCs from the SBP framing. See the `flags` field to determine the type of CRCs covered. */ -} msg_ecdsa_signature_t; +} msg_ecdsa_signature_dep_b_t; /** An ECDSA signature * @@ -153,7 +226,7 @@ typedef struct SBP_ATTR_PACKED { this will be 16-bit CRCs from the SBP framing. See the `flags` field to determine the type of CRCs covered. */ -} msg_ecdsa_signature_dep_t; +} msg_ecdsa_signature_dep_a_t; typedef struct SBP_ATTR_PACKED { u8 n_msg; /**< Total number messages that make up the diff --git a/c/include/libsbp/sbp_msg_type.h b/c/include/libsbp/sbp_msg_type.h index 0e3e236f62..2b8575d522 100644 --- a/c/include/libsbp/sbp_msg_type.h +++ b/c/include/libsbp/sbp_msg_type.h @@ -80,6 +80,7 @@ typedef enum { SbpMsgBootloaderHandshakeResp = SBP_MSG_BOOTLOADER_HANDSHAKE_RESP, SbpMsgBootloaderJumpToApp = SBP_MSG_BOOTLOADER_JUMP_TO_APP, SbpMsgCellModemStatus = SBP_MSG_CELL_MODEM_STATUS, + SbpMsgCertificateChainDep = SBP_MSG_CERTIFICATE_CHAIN_DEP, SbpMsgCertificateChain = SBP_MSG_CERTIFICATE_CHAIN, SbpMsgCommandOutput = SBP_MSG_COMMAND_OUTPUT, SbpMsgCommandReq = SBP_MSG_COMMAND_REQ, @@ -93,7 +94,8 @@ typedef enum { SbpMsgDopsDepA = SBP_MSG_DOPS_DEP_A, SbpMsgDops = SBP_MSG_DOPS, SbpMsgEcdsaCertificate = SBP_MSG_ECDSA_CERTIFICATE, - SbpMsgEcdsaSignatureDep = SBP_MSG_ECDSA_SIGNATURE_DEP, + SbpMsgEcdsaSignatureDepA = SBP_MSG_ECDSA_SIGNATURE_DEP_A, + SbpMsgEcdsaSignatureDepB = SBP_MSG_ECDSA_SIGNATURE_DEP_B, SbpMsgEcdsaSignature = SBP_MSG_ECDSA_SIGNATURE, SbpMsgEd25519CertificateDep = SBP_MSG_ED25519_CERTIFICATE_DEP, SbpMsgEd25519SignatureDepA = SBP_MSG_ED25519_SIGNATURE_DEP_A, diff --git a/c/include/libsbp/signing_macros.h b/c/include/libsbp/signing_macros.h index 38c1a8a9f2..9362724c32 100644 --- a/c/include/libsbp/signing_macros.h +++ b/c/include/libsbp/signing_macros.h @@ -24,6 +24,19 @@ */ #define SBP_UTC_TIME_ENCODED_LEN 11u +/** + * The maximum number of items that can be stored in sbp_ecdsa_signature_t::data + * (V4 API) or ecdsa_signature_t::data (legacy API) before the maximum SBP + * message size is exceeded + */ +#define SBP_ECDSA_SIGNATURE_DATA_MAX 72u + +/** + * Encoded length of sbp_ecdsa_signature_t (V4 API) and + * ecdsa_signature_t (legacy API) + */ +#define SBP_ECDSA_SIGNATURE_ENCODED_LEN 73u + #define SBP_MSG_ECDSA_CERTIFICATE 0x0C04 /** * The maximum number of items that can be stored in @@ -73,7 +86,7 @@ */ #define SBP_MSG_ECDSA_CERTIFICATE_ENCODED_OVERHEAD 6u -#define SBP_MSG_CERTIFICATE_CHAIN 0x0C05 +#define SBP_MSG_CERTIFICATE_CHAIN 0x0C09 /** * The maximum number of items that can be stored in * sbp_msg_certificate_chain_t::root_certificate (V4 API) or @@ -98,21 +111,52 @@ */ #define SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX 20u +/** + * Encoded length of sbp_msg_certificate_chain_t (V4 API) and + * msg_certificate_chain_t (legacy API) + */ +#define SBP_MSG_CERTIFICATE_CHAIN_ENCODED_LEN 144u + +#define SBP_MSG_CERTIFICATE_CHAIN_DEP 0x0C05 +/** + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::root_certificate (V4 API) or + * msg_certificate_chain_dep_t::root_certificate (legacy API) before the maximum + * SBP message size is exceeded + */ +#define SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX 20u + +/** + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::intermediate_certificate (V4 API) or + * msg_certificate_chain_dep_t::intermediate_certificate (legacy API) before the + * maximum SBP message size is exceeded + */ +#define SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX 20u + +/** + * The maximum number of items that can be stored in + * sbp_msg_certificate_chain_dep_t::corrections_certificate (V4 API) or + * msg_certificate_chain_dep_t::corrections_certificate (legacy API) before the + * maximum SBP message size is exceeded + */ +#define SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX 20u + /** * The maximum number of items that can be stored in - * sbp_msg_certificate_chain_t::signature (V4 API) or - * msg_certificate_chain_t::signature (legacy API) before the maximum SBP + * sbp_msg_certificate_chain_dep_t::signature (V4 API) or + * msg_certificate_chain_dep_t::signature (legacy API) before the maximum SBP * message size is exceeded */ -#define SBP_MSG_CERTIFICATE_CHAIN_SIGNATURE_MAX 64u +#define SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX 64u /** - * Encoded length of sbp_msg_certificate_chain_t (V4 API) and - * msg_certificate_chain_t (legacy API) + * Encoded length of sbp_msg_certificate_chain_dep_t (V4 API) and + * msg_certificate_chain_dep_t (legacy API) */ -#define SBP_MSG_CERTIFICATE_CHAIN_ENCODED_LEN 135u +#define SBP_MSG_CERTIFICATE_CHAIN_DEP_ENCODED_LEN 135u -#define SBP_MSG_ECDSA_SIGNATURE 0x0C07 +#define SBP_MSG_ECDSA_SIGNATURE 0x0C08 #define SBP_ECDSA_SIGNATURE_CRC_TYPE_MASK (0x3u) #define SBP_ECDSA_SIGNATURE_CRC_TYPE_SHIFT (0u) #define SBP_ECDSA_SIGNATURE_CRC_TYPE_GET(flags) \ @@ -136,14 +180,6 @@ */ #define SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX 4u -/** - * The maximum number of items that can be stored in - * sbp_msg_ecdsa_signature_t::signature (V4 API) or - * msg_ecdsa_signature_t::signature (legacy API) before the maximum SBP message - * size is exceeded - */ -#define SBP_MSG_ECDSA_SIGNATURE_SIGNATURE_MAX 72u - /** * The maximum number of items that can be stored in * sbp_msg_ecdsa_signature_t::signed_messages (V4 API) or @@ -167,60 +203,117 @@ */ #define SBP_MSG_ECDSA_SIGNATURE_ENCODED_OVERHEAD 80u -#define SBP_MSG_ECDSA_SIGNATURE_DEP 0x0C06 -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_MASK (0x3u) -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_SHIFT (0u) -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_GET(flags) \ - ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_SHIFT) & \ - SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_MASK)) -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_SET(flags, val) \ - do { \ - (flags) = (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_MASK \ - << SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_SHIFT))) | \ - (((val) & (SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_MASK)) \ - << (SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_SHIFT))); \ +#define SBP_MSG_ECDSA_SIGNATURE_DEP_B 0x0C07 +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK (0x3u) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT (0u) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT) & \ + SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK \ + << SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_MASK)) \ + << (SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_SHIFT))); \ } while (0) -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) -#define SBP_ECDSA_SIGNATURE_DEP_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) +#define SBP_ECDSA_SIGNATURE_DEP_B_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) +/** + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_b_t::certificate_id (V4 API) or + * msg_ecdsa_signature_dep_b_t::certificate_id (legacy API) before the maximum + * SBP message size is exceeded + */ +#define SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX 4u + /** * The maximum number of items that can be stored in - * sbp_msg_ecdsa_signature_dep_t::certificate_id (V4 API) or - * msg_ecdsa_signature_dep_t::certificate_id (legacy API) before the maximum SBP + * sbp_msg_ecdsa_signature_dep_b_t::signature (V4 API) or + * msg_ecdsa_signature_dep_b_t::signature (legacy API) before the maximum SBP * message size is exceeded */ -#define SBP_MSG_ECDSA_SIGNATURE_DEP_CERTIFICATE_ID_MAX 4u +#define SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX 72u + +/** + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_b_t::signed_messages (V4 API) or + * msg_ecdsa_signature_dep_b_t::signed_messages (legacy API) before the maximum + * SBP message size is exceeded + */ +#define SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX 175u + +/** + * Encoded length of sbp_msg_ecdsa_signature_dep_b_t (V4 API) and + * msg_ecdsa_signature_dep_b_t (legacy API) + * + * This type is not fixed size and an instance of this message may be longer + * than the value indicated by this symbol. Users of the V4 API should call + * #sbp_msg_ecdsa_signature_dep_b_encoded_len to determine the actual size of an + * instance of this message. Users of the legacy API are required to track the + * encoded message length when interacting with the legacy type. + * + * See the documentation for libsbp for more details regarding the message + * structure and its variable length component(s) + */ +#define SBP_MSG_ECDSA_SIGNATURE_DEP_B_ENCODED_OVERHEAD 80u + +#define SBP_MSG_ECDSA_SIGNATURE_DEP_A 0x0C06 +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK (0x3u) +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT (0u) +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_GET(flags) \ + ((u8)((u8)((flags) >> SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT) & \ + SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SET(flags, val) \ + do { \ + (flags) = \ + (u8)((flags & (~(SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK \ + << SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT))) | \ + (((val) & (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_MASK)) \ + << (SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_SHIFT))); \ + } while (0) + +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_24_BIT_CRCS_FROM_RTCM_FRAMING (0) +#define SBP_ECDSA_SIGNATURE_DEP_A_CRC_TYPE_16_BIT_CRCS_FROM_SBP_FRAMING (1) +/** + * The maximum number of items that can be stored in + * sbp_msg_ecdsa_signature_dep_a_t::certificate_id (V4 API) or + * msg_ecdsa_signature_dep_a_t::certificate_id (legacy API) before the maximum + * SBP message size is exceeded + */ +#define SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX 4u /** * The maximum number of items that can be stored in - * sbp_msg_ecdsa_signature_dep_t::signature (V4 API) or - * msg_ecdsa_signature_dep_t::signature (legacy API) before the maximum SBP + * sbp_msg_ecdsa_signature_dep_a_t::signature (V4 API) or + * msg_ecdsa_signature_dep_a_t::signature (legacy API) before the maximum SBP * message size is exceeded */ -#define SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNATURE_MAX 64u +#define SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX 64u /** * The maximum number of items that can be stored in - * sbp_msg_ecdsa_signature_dep_t::signed_messages (V4 API) or - * msg_ecdsa_signature_dep_t::signed_messages (legacy API) before the maximum + * sbp_msg_ecdsa_signature_dep_a_t::signed_messages (V4 API) or + * msg_ecdsa_signature_dep_a_t::signed_messages (legacy API) before the maximum * SBP message size is exceeded */ -#define SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNED_MESSAGES_MAX 184u +#define SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX 184u /** - * Encoded length of sbp_msg_ecdsa_signature_dep_t (V4 API) and - * msg_ecdsa_signature_dep_t (legacy API) + * Encoded length of sbp_msg_ecdsa_signature_dep_a_t (V4 API) and + * msg_ecdsa_signature_dep_a_t (legacy API) * * This type is not fixed size and an instance of this message may be longer * than the value indicated by this symbol. Users of the V4 API should call - * #sbp_msg_ecdsa_signature_dep_encoded_len to determine the actual size of an + * #sbp_msg_ecdsa_signature_dep_a_encoded_len to determine the actual size of an * instance of this message. Users of the legacy API are required to track the * encoded message length when interacting with the legacy type. * * See the documentation for libsbp for more details regarding the message * structure and its variable length component(s) */ -#define SBP_MSG_ECDSA_SIGNATURE_DEP_ENCODED_OVERHEAD 71u +#define SBP_MSG_ECDSA_SIGNATURE_DEP_A_ENCODED_OVERHEAD 71u #define SBP_MSG_ED25519_CERTIFICATE_DEP 0x0C02 /** diff --git a/c/include/libsbp/v4/sbp_msg.h b/c/include/libsbp/v4/sbp_msg.h index df258e2d5d..496df55164 100644 --- a/c/include/libsbp/v4/sbp_msg.h +++ b/c/include/libsbp/v4/sbp_msg.h @@ -86,6 +86,7 @@ typedef union { sbp_msg_bootloader_handshake_resp_t bootloader_handshake_resp; sbp_msg_bootloader_jump_to_app_t bootloader_jump_to_app; sbp_msg_cell_modem_status_t cell_modem_status; + sbp_msg_certificate_chain_dep_t certificate_chain_dep; sbp_msg_certificate_chain_t certificate_chain; sbp_msg_command_output_t command_output; sbp_msg_command_req_t command_req; @@ -99,7 +100,8 @@ typedef union { sbp_msg_dops_dep_a_t dops_dep_a; sbp_msg_dops_t dops; sbp_msg_ecdsa_certificate_t ecdsa_certificate; - sbp_msg_ecdsa_signature_dep_t ecdsa_signature_dep; + sbp_msg_ecdsa_signature_dep_a_t ecdsa_signature_dep_a; + sbp_msg_ecdsa_signature_dep_b_t ecdsa_signature_dep_b; sbp_msg_ecdsa_signature_t ecdsa_signature; sbp_msg_ed25519_certificate_dep_t ed25519_certificate_dep; sbp_msg_ed25519_signature_dep_a_t ed25519_signature_dep_a; @@ -386,6 +388,9 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, case SbpMsgCellModemStatus: return sbp_msg_cell_modem_status_encode(buf, len, n_written, &msg->cell_modem_status); + case SbpMsgCertificateChainDep: + return sbp_msg_certificate_chain_dep_encode(buf, len, n_written, + &msg->certificate_chain_dep); case SbpMsgCertificateChain: return sbp_msg_certificate_chain_encode(buf, len, n_written, &msg->certificate_chain); @@ -420,9 +425,12 @@ static inline s8 sbp_message_encode(uint8_t *buf, uint8_t len, case SbpMsgEcdsaCertificate: return sbp_msg_ecdsa_certificate_encode(buf, len, n_written, &msg->ecdsa_certificate); - case SbpMsgEcdsaSignatureDep: - return sbp_msg_ecdsa_signature_dep_encode(buf, len, n_written, - &msg->ecdsa_signature_dep); + case SbpMsgEcdsaSignatureDepA: + return sbp_msg_ecdsa_signature_dep_a_encode(buf, len, n_written, + &msg->ecdsa_signature_dep_a); + case SbpMsgEcdsaSignatureDepB: + return sbp_msg_ecdsa_signature_dep_b_encode(buf, len, n_written, + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: return sbp_msg_ecdsa_signature_encode(buf, len, n_written, &msg->ecdsa_signature); @@ -1037,6 +1045,9 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, case SbpMsgCellModemStatus: return sbp_msg_cell_modem_status_decode(buf, len, n_read, &msg->cell_modem_status); + case SbpMsgCertificateChainDep: + return sbp_msg_certificate_chain_dep_decode(buf, len, n_read, + &msg->certificate_chain_dep); case SbpMsgCertificateChain: return sbp_msg_certificate_chain_decode(buf, len, n_read, &msg->certificate_chain); @@ -1069,9 +1080,12 @@ static inline s8 sbp_message_decode(const uint8_t *buf, uint8_t len, case SbpMsgEcdsaCertificate: return sbp_msg_ecdsa_certificate_decode(buf, len, n_read, &msg->ecdsa_certificate); - case SbpMsgEcdsaSignatureDep: - return sbp_msg_ecdsa_signature_dep_decode(buf, len, n_read, - &msg->ecdsa_signature_dep); + case SbpMsgEcdsaSignatureDepA: + return sbp_msg_ecdsa_signature_dep_a_decode(buf, len, n_read, + &msg->ecdsa_signature_dep_a); + case SbpMsgEcdsaSignatureDepB: + return sbp_msg_ecdsa_signature_dep_b_decode(buf, len, n_read, + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: return sbp_msg_ecdsa_signature_decode(buf, len, n_read, &msg->ecdsa_signature); @@ -1661,6 +1675,9 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, &msg->bootloader_jump_to_app); case SbpMsgCellModemStatus: return sbp_msg_cell_modem_status_encoded_len(&msg->cell_modem_status); + case SbpMsgCertificateChainDep: + return sbp_msg_certificate_chain_dep_encoded_len( + &msg->certificate_chain_dep); case SbpMsgCertificateChain: return sbp_msg_certificate_chain_encoded_len(&msg->certificate_chain); case SbpMsgCommandOutput: @@ -1688,8 +1705,12 @@ static inline size_t sbp_message_encoded_len(sbp_msg_type_t msg_type, return sbp_msg_dops_encoded_len(&msg->dops); case SbpMsgEcdsaCertificate: return sbp_msg_ecdsa_certificate_encoded_len(&msg->ecdsa_certificate); - case SbpMsgEcdsaSignatureDep: - return sbp_msg_ecdsa_signature_dep_encoded_len(&msg->ecdsa_signature_dep); + case SbpMsgEcdsaSignatureDepA: + return sbp_msg_ecdsa_signature_dep_a_encoded_len( + &msg->ecdsa_signature_dep_a); + case SbpMsgEcdsaSignatureDepB: + return sbp_msg_ecdsa_signature_dep_b_encoded_len( + &msg->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: return sbp_msg_ecdsa_signature_encoded_len(&msg->ecdsa_signature); case SbpMsgEd25519CertificateDep: @@ -2206,6 +2227,9 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, case SbpMsgCellModemStatus: return sbp_msg_cell_modem_status_cmp(&a->cell_modem_status, &b->cell_modem_status); + case SbpMsgCertificateChainDep: + return sbp_msg_certificate_chain_dep_cmp(&a->certificate_chain_dep, + &b->certificate_chain_dep); case SbpMsgCertificateChain: return sbp_msg_certificate_chain_cmp(&a->certificate_chain, &b->certificate_chain); @@ -2235,9 +2259,12 @@ static inline int sbp_message_cmp(sbp_msg_type_t msg_type, const sbp_msg_t *a, case SbpMsgEcdsaCertificate: return sbp_msg_ecdsa_certificate_cmp(&a->ecdsa_certificate, &b->ecdsa_certificate); - case SbpMsgEcdsaSignatureDep: - return sbp_msg_ecdsa_signature_dep_cmp(&a->ecdsa_signature_dep, - &b->ecdsa_signature_dep); + case SbpMsgEcdsaSignatureDepA: + return sbp_msg_ecdsa_signature_dep_a_cmp(&a->ecdsa_signature_dep_a, + &b->ecdsa_signature_dep_a); + case SbpMsgEcdsaSignatureDepB: + return sbp_msg_ecdsa_signature_dep_b_cmp(&a->ecdsa_signature_dep_b, + &b->ecdsa_signature_dep_b); case SbpMsgEcdsaSignature: return sbp_msg_ecdsa_signature_cmp(&a->ecdsa_signature, &b->ecdsa_signature); diff --git a/c/include/libsbp/v4/signing.h b/c/include/libsbp/v4/signing.h index d3d68dff56..51c10457d1 100644 --- a/c/include/libsbp/v4/signing.h +++ b/c/include/libsbp/v4/signing.h @@ -17,10 +17,13 @@ #ifndef LIBSBP_V4_SIGNING_MESSAGES_H #define LIBSBP_V4_SIGNING_MESSAGES_H +#include #include +#include #include #include -#include +#include +#include #include #include #include diff --git a/c/include/libsbp/v4/signing/ECDSASignature.h b/c/include/libsbp/v4/signing/ECDSASignature.h new file mode 100644 index 0000000000..7964d9200d --- /dev/null +++ b/c/include/libsbp/v4/signing/ECDSASignature.h @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +/***************************************************************************** + * Automatically generated from yaml/swiftnav/sbp/signing.yaml + * with generate.py. Please do not hand edit! + *****************************************************************************/ + +#ifndef LIBSBP_V4_SIGNING_ECDSASIGNATURE_H +#define LIBSBP_V4_SIGNING_ECDSASIGNATURE_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * + * SBP_ECDSASIGNATURE + * + *****************************************************************************/ +typedef struct { + /** + * Number of bytes to use of the signature field. The DER encoded signature + * has a maximum size of 72 bytes but can vary between 70 and 72 bytes in + * length. + */ + u8 len; + + /** + * DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. + */ + u8 data[SBP_ECDSA_SIGNATURE_DATA_MAX]; +} sbp_ecdsa_signature_t; + +/** + * Get encoded size of an instance of sbp_ecdsa_signature_t + * + * @param msg sbp_ecdsa_signature_t instance + * @return Length of on-wire representation + */ +static inline size_t sbp_ecdsa_signature_encoded_len( + const sbp_ecdsa_signature_t *msg) { + (void)msg; + return SBP_ECDSA_SIGNATURE_ENCODED_LEN; +} + +/** + * Encode an instance of sbp_ecdsa_signature_t to wire representation + * + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. + * + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. + * + * @param buf Destination buffer + * @param len Length of \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf + * @param msg Instance of sbp_ecdsa_signature_t to encode + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, + uint8_t *n_written, + const sbp_ecdsa_signature_t *msg); + +/** + * Decode an instance of sbp_ecdsa_signature_t from wire representation + * + * This function decodes the wire representation of a sbp_ecdsa_signature_t + * message to the given instance. The caller must specify the length of the + * buffer in the \p len parameter. If non-null the number of bytes read from the + * buffer will be returned in \p n_read. + * + * @param buf Wire representation of the sbp_ecdsa_signature_t instance + * @param len Length of \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf + * @param msg Destination + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_ecdsa_signature_t *msg); + +/** + * Compare two instances of sbp_ecdsa_signature_t + * + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library + * + * 0 will be returned if \p a and \p b are considered equal + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b + * + * @param a sbp_ecdsa_signature_t instance + * @param b sbp_ecdsa_signature_t instance + * @return 0, <0, >0 + */ +SBP_EXPORT int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, + const sbp_ecdsa_signature_t *b); + +#ifdef __cplusplus +} + +static inline bool operator==(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) == 0; +} + +static inline bool operator!=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) != 0; +} + +static inline bool operator<(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) < 0; +} + +static inline bool operator<=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) <= 0; +} + +static inline bool operator>(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) > 0; +} + +static inline bool operator>=(const sbp_ecdsa_signature_t &lhs, + const sbp_ecdsa_signature_t &rhs) { + return sbp_ecdsa_signature_cmp(&lhs, &rhs) >= 0; +} + +#endif // ifdef __cplusplus + +#endif /* LIBSBP_V4_SIGNING_ECDSASIGNATURE_H */ diff --git a/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h index b648801d6b..f302eba9de 100644 --- a/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h +++ b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -64,14 +65,13 @@ typedef struct { sbp_utc_time_t expiration; /** - * An ECDSA signature (created by the root certificate) over the concatenation - * of the SBP payload bytes preceding this field. That is, the concatenation - * of `root_certificate`, `intermediate_certificate`, - * `corrections_certificate` and `expiration`. This certificate chain (allow - * list) can also be validated by fetching it from - * `http(s)://certs.swiftnav.com/chain`. + * Signature (created by the root certificate) over the concatenation of the + * SBP payload bytes preceding this field. That is, the concatenation of + * `root_certificate`, `intermediate_certificate`, `corrections_certificate` + * and `expiration`. This certificate chain (allow list) can also be + * validated by fetching it from `http(s)://certs.swiftnav.com/chain`. */ - u8 signature[SBP_MSG_CERTIFICATE_CHAIN_SIGNATURE_MAX]; + sbp_ecdsa_signature_t signature; } sbp_msg_certificate_chain_t; /** diff --git a/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN_DEP.h b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN_DEP.h new file mode 100644 index 0000000000..3b129d793f --- /dev/null +++ b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN_DEP.h @@ -0,0 +1,207 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +/***************************************************************************** + * Automatically generated from yaml/swiftnav/sbp/signing.yaml + * with generate.py. Please do not hand edit! + *****************************************************************************/ + +#ifndef LIBSBP_V4_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H +#define LIBSBP_V4_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * + * SBP_MSG_CERTIFICATE_CHAIN_DEP + * + *****************************************************************************/ +typedef struct { + /** + * SHA-1 fingerprint of the root certificate + */ + u8 root_certificate[SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX]; + + /** + * SHA-1 fingerprint of the intermediate certificate + */ + u8 intermediate_certificate + [SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX]; + + /** + * SHA-1 fingerprint of the corrections certificate + */ + u8 corrections_certificate + [SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX]; + + /** + * The certificate chain comprised of three fingerprints: root certificate, + * intermediate certificate and corrections certificate. + */ + sbp_utc_time_t expiration; + + /** + * An ECDSA signature (created by the root certificate) over the concatenation + * of the SBP payload bytes preceding this field. That is, the concatenation + * of `root_certificate`, `intermediate_certificate`, + * `corrections_certificate` and `expiration`. This certificate chain (allow + * list) can also be validated by fetching it from + * `http(s)://certs.swiftnav.com/chain`. + */ + u8 signature[SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX]; +} sbp_msg_certificate_chain_dep_t; + +/** + * Get encoded size of an instance of sbp_msg_certificate_chain_dep_t + * + * @param msg sbp_msg_certificate_chain_dep_t instance + * @return Length of on-wire representation + */ +static inline size_t sbp_msg_certificate_chain_dep_encoded_len( + const sbp_msg_certificate_chain_dep_t *msg) { + (void)msg; + return SBP_MSG_CERTIFICATE_CHAIN_DEP_ENCODED_LEN; +} + +/** + * Encode an instance of sbp_msg_certificate_chain_dep_t to wire representation + * + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. + * + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. + * + * @param buf Destination buffer + * @param len Length of \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf + * @param msg Instance of sbp_msg_certificate_chain_dep_t to encode + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t *msg); + +/** + * Decode an instance of sbp_msg_certificate_chain_dep_t from wire + * representation + * + * This function decodes the wire representation of a + * sbp_msg_certificate_chain_dep_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. + * + * @param buf Wire representation of the sbp_msg_certificate_chain_dep_t + * instance + * @param len Length of \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf + * @param msg Destination + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg); +/** + * Send an instance of sbp_msg_certificate_chain_dep_t with the given write + * function + * + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_certificate_chain_dep_t + * + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. + * + * @param s SBP state + * @param sender_id SBP sender id + * @param msg Message to send + * @param write Write function + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_certificate_chain_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, + sbp_write_fn_t write); + +/** + * Compare two instances of sbp_msg_certificate_chain_dep_t + * + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library + * + * 0 will be returned if \p a and \p b are considered equal + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b + * + * @param a sbp_msg_certificate_chain_dep_t instance + * @param b sbp_msg_certificate_chain_dep_t instance + * @return 0, <0, >0 + */ +SBP_EXPORT int sbp_msg_certificate_chain_dep_cmp( + const sbp_msg_certificate_chain_dep_t *a, + const sbp_msg_certificate_chain_dep_t *b); + +#ifdef __cplusplus +} + +static inline bool operator==(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) == 0; +} + +static inline bool operator!=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) != 0; +} + +static inline bool operator<(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) < 0; +} + +static inline bool operator<=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) <= 0; +} + +static inline bool operator>(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) > 0; +} + +static inline bool operator>=(const sbp_msg_certificate_chain_dep_t &lhs, + const sbp_msg_certificate_chain_dep_t &rhs) { + return sbp_msg_certificate_chain_dep_cmp(&lhs, &rhs) >= 0; +} + +#endif // ifdef __cplusplus + +#endif /* LIBSBP_V4_SIGNING_MSG_CERTIFICATE_CHAIN_DEP_H */ diff --git a/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE.h b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE.h index bd2afc0e24..430465624c 100644 --- a/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE.h +++ b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE.h @@ -27,6 +27,7 @@ #include #include +#include #include #ifdef __cplusplus @@ -70,17 +71,9 @@ typedef struct { u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_CERTIFICATE_ID_MAX]; /** - * Number of bytes to use of the signature field. The DER encoded signature - * has a maximum size of 72 bytes but can vary between 70 and 72 bytes in - * length. + * Signature over the frames of this message group. */ - u8 n_signature_bytes; - - /** - * DER encoded ECDSA signature for the messages using SHA-256 as the digest - * algorithm. - */ - u8 signature[SBP_MSG_ECDSA_SIGNATURE_SIGNATURE_MAX]; + sbp_ecdsa_signature_t signature; /** * CRCs of the messages covered by this signature. For Skylark, which diff --git a/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP.h b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_A.h similarity index 69% rename from c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP.h rename to c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_A.h index 5d35e33202..ac0e1c46fe 100644 --- a/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP.h +++ b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_A.h @@ -15,8 +15,8 @@ * with generate.py. Please do not hand edit! *****************************************************************************/ -#ifndef LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_H -#define LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_H +#ifndef LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H +#define LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H #include #include @@ -35,7 +35,7 @@ extern "C" { /****************************************************************************** * - * SBP_MSG_ECDSA_SIGNATURE_DEP + * SBP_MSG_ECDSA_SIGNATURE_DEP_A * *****************************************************************************/ /** An ECDSA signature @@ -67,12 +67,12 @@ typedef struct { /** * The last 4 bytes of the certificate's SHA-1 fingerprint */ - u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_DEP_CERTIFICATE_ID_MAX]; + u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX]; /** * ECDSA signature for the messages using SHA-256 as the digest algorithm. */ - u8 signature[SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNATURE_MAX]; + u8 signature[SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX]; /** * CRCs of the messages covered by this signature. For Skylark, which @@ -81,7 +81,7 @@ typedef struct { * this will be 16-bit CRCs from the SBP framing. See the `flags` field to * determine the type of CRCs covered. */ - u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNED_MESSAGES_MAX]; + u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNED_MESSAGES_MAX]; /** * Number of elements in signed_messages * @@ -93,22 +93,22 @@ typedef struct { * this field is undefined */ u8 n_signed_messages; -} sbp_msg_ecdsa_signature_dep_t; +} sbp_msg_ecdsa_signature_dep_a_t; /** - * Get encoded size of an instance of sbp_msg_ecdsa_signature_dep_t + * Get encoded size of an instance of sbp_msg_ecdsa_signature_dep_a_t * - * @param msg sbp_msg_ecdsa_signature_dep_t instance + * @param msg sbp_msg_ecdsa_signature_dep_a_t instance * @return Length of on-wire representation */ -static inline size_t sbp_msg_ecdsa_signature_dep_encoded_len( - const sbp_msg_ecdsa_signature_dep_t *msg) { - return SBP_MSG_ECDSA_SIGNATURE_DEP_ENCODED_OVERHEAD + +static inline size_t sbp_msg_ecdsa_signature_dep_a_encoded_len( + const sbp_msg_ecdsa_signature_dep_a_t *msg) { + return SBP_MSG_ECDSA_SIGNATURE_DEP_A_ENCODED_OVERHEAD + (msg->n_signed_messages * SBP_ENCODED_LEN_U8); } /** - * Encode an instance of sbp_msg_ecdsa_signature_dep_t to wire representation + * Encode an instance of sbp_msg_ecdsa_signature_dep_a_t to wire representation * * This function encodes the given instance in to the user provided buffer. The * buffer provided to this function must be large enough to store the encoded @@ -123,37 +123,39 @@ static inline size_t sbp_msg_ecdsa_signature_dep_encoded_len( * @param len Length of \p buf * @param n_written If not null, on success will be set to the number of bytes * written to \p buf - * @param msg Instance of sbp_msg_ecdsa_signature_dep_t to encode + * @param msg Instance of sbp_msg_ecdsa_signature_dep_a_t to encode * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_encode( +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_encode( uint8_t *buf, uint8_t len, uint8_t *n_written, - const sbp_msg_ecdsa_signature_dep_t *msg); + const sbp_msg_ecdsa_signature_dep_a_t *msg); /** - * Decode an instance of sbp_msg_ecdsa_signature_dep_t from wire representation + * Decode an instance of sbp_msg_ecdsa_signature_dep_a_t from wire + * representation * * This function decodes the wire representation of a - * sbp_msg_ecdsa_signature_dep_t message to the given instance. The caller must - * specify the length of the buffer in the \p len parameter. If non-null the - * number of bytes read from the buffer will be returned in \p n_read. + * sbp_msg_ecdsa_signature_dep_a_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. * - * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_t instance + * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_a_t + * instance * @param len Length of \p buf * @param n_read If not null, on success will be set to the number of bytes read * from \p buf * @param msg Destination * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_decode( +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_decode( const uint8_t *buf, uint8_t len, uint8_t *n_read, - sbp_msg_ecdsa_signature_dep_t *msg); + sbp_msg_ecdsa_signature_dep_a_t *msg); /** - * Send an instance of sbp_msg_ecdsa_signature_dep_t with the given write + * Send an instance of sbp_msg_ecdsa_signature_dep_a_t with the given write * function * * An equivalent of #sbp_message_send which operates specifically on - * sbp_msg_ecdsa_signature_dep_t + * sbp_msg_ecdsa_signature_dep_a_t * * The given message will be encoded to wire representation and passed in to the * given write function callback. The write callback will be called several @@ -165,12 +167,12 @@ SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_decode( * @param write Write function * @return SBP_OK on success, or other libsbp error code */ -SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_send( - sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_t *msg, +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, sbp_write_fn_t write); /** - * Compare two instances of sbp_msg_ecdsa_signature_dep_t + * Compare two instances of sbp_msg_ecdsa_signature_dep_a_t * * The two instances will be compared and a value returned consistent with the * return codes of comparison functions from the C standard library @@ -180,47 +182,47 @@ SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_send( * b A value greater than 0 will be returned if \p b is considered to be greater * than \p b * - * @param a sbp_msg_ecdsa_signature_dep_t instance - * @param b sbp_msg_ecdsa_signature_dep_t instance + * @param a sbp_msg_ecdsa_signature_dep_a_t instance + * @param b sbp_msg_ecdsa_signature_dep_a_t instance * @return 0, <0, >0 */ -SBP_EXPORT int sbp_msg_ecdsa_signature_dep_cmp( - const sbp_msg_ecdsa_signature_dep_t *a, - const sbp_msg_ecdsa_signature_dep_t *b); +SBP_EXPORT int sbp_msg_ecdsa_signature_dep_a_cmp( + const sbp_msg_ecdsa_signature_dep_a_t *a, + const sbp_msg_ecdsa_signature_dep_a_t *b); #ifdef __cplusplus } -static inline bool operator==(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) == 0; +static inline bool operator==(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) == 0; } -static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) != 0; +static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) != 0; } -static inline bool operator<(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) < 0; +static inline bool operator<(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) < 0; } -static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) <= 0; +static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) <= 0; } -static inline bool operator>(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) > 0; +static inline bool operator>(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) > 0; } -static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_t &lhs, - const sbp_msg_ecdsa_signature_dep_t &rhs) { - return sbp_msg_ecdsa_signature_dep_cmp(&lhs, &rhs) >= 0; +static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_a_t &lhs, + const sbp_msg_ecdsa_signature_dep_a_t &rhs) { + return sbp_msg_ecdsa_signature_dep_a_cmp(&lhs, &rhs) >= 0; } #endif // ifdef __cplusplus -#endif /* LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_H */ +#endif /* LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_A_H */ diff --git a/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_B.h b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_B.h new file mode 100644 index 0000000000..521e148e44 --- /dev/null +++ b/c/include/libsbp/v4/signing/MSG_ECDSA_SIGNATURE_DEP_B.h @@ -0,0 +1,236 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +/***************************************************************************** + * Automatically generated from yaml/swiftnav/sbp/signing.yaml + * with generate.py. Please do not hand edit! + *****************************************************************************/ + +#ifndef LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H +#define LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************** + * + * SBP_MSG_ECDSA_SIGNATURE_DEP_B + * + *****************************************************************************/ +/** An ECDSA signature + * + * An ECDSA-256 signature using SHA-256 as the message digest algorithm. + */ +typedef struct { + /** + * Describes the format of the `signed\_messages` field below. + */ + u8 flags; + + /** + * Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to + * an on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. + */ + u8 stream_counter; + + /** + * On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll + * over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. + */ + u8 on_demand_counter; + + /** + * The last 4 bytes of the certificate's SHA-1 fingerprint + */ + u8 certificate_id[SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX]; + + /** + * Number of bytes to use of the signature field. The DER encoded signature + * has a maximum size of 72 bytes but can vary between 70 and 72 bytes in + * length. + */ + u8 n_signature_bytes; + + /** + * DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. + */ + u8 signature[SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX]; + + /** + * CRCs of the messages covered by this signature. For Skylark, which + * delivers SBP messages wrapped in Swift's proprietary RTCM message, these + * are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + * this will be 16-bit CRCs from the SBP framing. See the `flags` field to + * determine the type of CRCs covered. + */ + u8 signed_messages[SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNED_MESSAGES_MAX]; + /** + * Number of elements in signed_messages + * + * When sending a message fill in this field with the number elements set in + * signed_messages before calling an appropriate libsbp send function + * + * When receiving a message query this field for the number of elements in + * signed_messages. The value of any elements beyond the index specified in + * this field is undefined + */ + u8 n_signed_messages; +} sbp_msg_ecdsa_signature_dep_b_t; + +/** + * Get encoded size of an instance of sbp_msg_ecdsa_signature_dep_b_t + * + * @param msg sbp_msg_ecdsa_signature_dep_b_t instance + * @return Length of on-wire representation + */ +static inline size_t sbp_msg_ecdsa_signature_dep_b_encoded_len( + const sbp_msg_ecdsa_signature_dep_b_t *msg) { + return SBP_MSG_ECDSA_SIGNATURE_DEP_B_ENCODED_OVERHEAD + + (msg->n_signed_messages * SBP_ENCODED_LEN_U8); +} + +/** + * Encode an instance of sbp_msg_ecdsa_signature_dep_b_t to wire representation + * + * This function encodes the given instance in to the user provided buffer. The + * buffer provided to this function must be large enough to store the encoded + * message otherwise it will return SBP_ENCODE_ERROR without writing anything to + * the buffer. + * + * Specify the length of the destination buffer in the \p len parameter. If + * non-null the number of bytes written to the buffer will be returned in \p + * n_written. + * + * @param buf Destination buffer + * @param len Length of \p buf + * @param n_written If not null, on success will be set to the number of bytes + * written to \p buf + * @param msg Instance of sbp_msg_ecdsa_signature_dep_b_t to encode + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_b_t *msg); + +/** + * Decode an instance of sbp_msg_ecdsa_signature_dep_b_t from wire + * representation + * + * This function decodes the wire representation of a + * sbp_msg_ecdsa_signature_dep_b_t message to the given instance. The caller + * must specify the length of the buffer in the \p len parameter. If non-null + * the number of bytes read from the buffer will be returned in \p n_read. + * + * @param buf Wire representation of the sbp_msg_ecdsa_signature_dep_b_t + * instance + * @param len Length of \p buf + * @param n_read If not null, on success will be set to the number of bytes read + * from \p buf + * @param msg Destination + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_decode( + const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_b_t *msg); +/** + * Send an instance of sbp_msg_ecdsa_signature_dep_b_t with the given write + * function + * + * An equivalent of #sbp_message_send which operates specifically on + * sbp_msg_ecdsa_signature_dep_b_t + * + * The given message will be encoded to wire representation and passed in to the + * given write function callback. The write callback will be called several + * times for each invocation of this function. + * + * @param s SBP state + * @param sender_id SBP sender id + * @param msg Message to send + * @param write Write function + * @return SBP_OK on success, or other libsbp error code + */ +SBP_EXPORT s8 sbp_msg_ecdsa_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, + sbp_write_fn_t write); + +/** + * Compare two instances of sbp_msg_ecdsa_signature_dep_b_t + * + * The two instances will be compared and a value returned consistent with the + * return codes of comparison functions from the C standard library + * + * 0 will be returned if \p a and \p b are considered equal + * A value less than 0 will be returned if \p a is considered to be less than \p + * b A value greater than 0 will be returned if \p b is considered to be greater + * than \p b + * + * @param a sbp_msg_ecdsa_signature_dep_b_t instance + * @param b sbp_msg_ecdsa_signature_dep_b_t instance + * @return 0, <0, >0 + */ +SBP_EXPORT int sbp_msg_ecdsa_signature_dep_b_cmp( + const sbp_msg_ecdsa_signature_dep_b_t *a, + const sbp_msg_ecdsa_signature_dep_b_t *b); + +#ifdef __cplusplus +} + +static inline bool operator==(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) == 0; +} + +static inline bool operator!=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) != 0; +} + +static inline bool operator<(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) < 0; +} + +static inline bool operator<=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) <= 0; +} + +static inline bool operator>(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) > 0; +} + +static inline bool operator>=(const sbp_msg_ecdsa_signature_dep_b_t &lhs, + const sbp_msg_ecdsa_signature_dep_b_t &rhs) { + return sbp_msg_ecdsa_signature_dep_b_cmp(&lhs, &rhs) >= 0; +} + +#endif // ifdef __cplusplus + +#endif /* LIBSBP_V4_SIGNING_MSG_ECDSA_SIGNATURE_DEP_B_H */ diff --git a/c/include/libsbp/v4/signing/MSG_ED25519_SIGNATURE_DEP.h b/c/include/libsbp/v4/signing/MSG_ED25519_SIGNATURE_DEP.h deleted file mode 100644 index 7b6ba44ceb..0000000000 --- a/c/include/libsbp/v4/signing/MSG_ED25519_SIGNATURE_DEP.h +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (C) 2015-2021 Swift Navigation Inc. - * Contact: https://support.swiftnav.com - * - * This source is subject to the license found in the file 'LICENSE' which must - * be be distributed together with this source. All other rights reserved. - * - * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - */ - -/***************************************************************************** - * Automatically generated from yaml/swiftnav/sbp/signing.yaml - * with generate.py. Please do not hand edit! - *****************************************************************************/ - -#ifndef LIBSBP_V4_SIGNING_MSG_ED25519_SIGNATURE_DEP_H -#define LIBSBP_V4_SIGNING_MSG_ED25519_SIGNATURE_DEP_H - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************** - * - * SBP_MSG_ED25519_SIGNATURE_DEP - * - *****************************************************************************/ -typedef struct { - /** - * ED25519 signature for messages. - */ - u8 signature[SBP_MSG_ED25519_SIGNATURE_DEP_SIGNATURE_MAX]; - - /** - * SHA-1 fingerprint of the associated certificate. - */ - u8 fingerprint[SBP_MSG_ED25519_SIGNATURE_DEP_FINGERPRINT_MAX]; - - /** - * CRCs of signed messages. - */ - u32 signed_messages[SBP_MSG_ED25519_SIGNATURE_DEP_SIGNED_MESSAGES_MAX]; - /** - * Number of elements in signed_messages - * - * When sending a message fill in this field with the number elements set in - * signed_messages before calling an appropriate libsbp send function - * - * When receiving a message query this field for the number of elements in - * signed_messages. The value of any elements beyond the index specified in - * this field is undefined - */ - u8 n_signed_messages; -} sbp_msg_ed25519_signature_dep_t; - -/** - * Get encoded size of an instance of sbp_msg_ed25519_signature_dep_t - * - * @param msg sbp_msg_ed25519_signature_dep_t instance - * @return Length of on-wire representation - */ -static inline size_t sbp_msg_ed25519_signature_dep_encoded_len( - const sbp_msg_ed25519_signature_dep_t *msg) { - return SBP_MSG_ED25519_SIGNATURE_DEP_ENCODED_OVERHEAD + - (msg->n_signed_messages * SBP_ENCODED_LEN_U32); -} - -/** - * Encode an instance of sbp_msg_ed25519_signature_dep_t to wire representation - * - * This function encodes the given instance in to the user provided buffer. The - * buffer provided to this function must be large enough to store the encoded - * message otherwise it will return SBP_ENCODE_ERROR without writing anything to - * the buffer. - * - * Specify the length of the destination buffer in the \p len parameter. If - * non-null the number of bytes written to the buffer will be returned in \p - * n_written. - * - * @param buf Destination buffer - * @param len Length of \p buf - * @param n_written If not null, on success will be set to the number of bytes - * written to \p buf - * @param msg Instance of sbp_msg_ed25519_signature_dep_t to encode - * @return SBP_OK on success, or other libsbp error code - */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_encode( - uint8_t *buf, uint8_t len, uint8_t *n_written, - const sbp_msg_ed25519_signature_dep_t *msg); - -/** - * Decode an instance of sbp_msg_ed25519_signature_dep_t from wire - * representation - * - * This function decodes the wire representation of a - * sbp_msg_ed25519_signature_dep_t message to the given instance. The caller - * must specify the length of the buffer in the \p len parameter. If non-null - * the number of bytes read from the buffer will be returned in \p n_read. - * - * @param buf Wire representation of the sbp_msg_ed25519_signature_dep_t - * instance - * @param len Length of \p buf - * @param n_read If not null, on success will be set to the number of bytes read - * from \p buf - * @param msg Destination - * @return SBP_OK on success, or other libsbp error code - */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_decode( - const uint8_t *buf, uint8_t len, uint8_t *n_read, - sbp_msg_ed25519_signature_dep_t *msg); -/** - * Send an instance of sbp_msg_ed25519_signature_dep_t with the given write - * function - * - * An equivalent of #sbp_message_send which operates specifically on - * sbp_msg_ed25519_signature_dep_t - * - * The given message will be encoded to wire representation and passed in to the - * given write function callback. The write callback will be called several - * times for each invocation of this function. - * - * @param s SBP state - * @param sender_id SBP sender id - * @param msg Message to send - * @param write Write function - * @return SBP_OK on success, or other libsbp error code - */ -SBP_EXPORT s8 sbp_msg_ed25519_signature_dep_send( - sbp_state_t *s, u16 sender_id, const sbp_msg_ed25519_signature_dep_t *msg, - sbp_write_fn_t write); - -/** - * Compare two instances of sbp_msg_ed25519_signature_dep_t - * - * The two instances will be compared and a value returned consistent with the - * return codes of comparison functions from the C standard library - * - * 0 will be returned if \p a and \p b are considered equal - * A value less than 0 will be returned if \p a is considered to be less than \p - * b A value greater than 0 will be returned if \p b is considered to be greater - * than \p b - * - * @param a sbp_msg_ed25519_signature_dep_t instance - * @param b sbp_msg_ed25519_signature_dep_t instance - * @return 0, <0, >0 - */ -SBP_EXPORT int sbp_msg_ed25519_signature_dep_cmp( - const sbp_msg_ed25519_signature_dep_t *a, - const sbp_msg_ed25519_signature_dep_t *b); - -#ifdef __cplusplus -} - -static inline bool operator==(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) == 0; -} - -static inline bool operator!=(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) != 0; -} - -static inline bool operator<(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) < 0; -} - -static inline bool operator<=(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) <= 0; -} - -static inline bool operator>(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) > 0; -} - -static inline bool operator>=(const sbp_msg_ed25519_signature_dep_t &lhs, - const sbp_msg_ed25519_signature_dep_t &rhs) { - return sbp_msg_ed25519_signature_dep_cmp(&lhs, &rhs) >= 0; -} - -#endif // ifdef __cplusplus - -#endif /* LIBSBP_V4_SIGNING_MSG_ED25519_SIGNATURE_DEP_H */ diff --git a/c/src/include/libsbp/internal/v4/signing.h b/c/src/include/libsbp/internal/v4/signing.h index fe202c89a3..99712b0486 100644 --- a/c/src/include/libsbp/internal/v4/signing.h +++ b/c/src/include/libsbp/internal/v4/signing.h @@ -46,6 +46,26 @@ bool sbp_utc_time_encode_internal(sbp_encode_ctx_t *ctx, */ bool sbp_utc_time_decode_internal(sbp_decode_ctx_t *ctx, sbp_utc_time_t *msg); +/** + * Internal function to encode an SBP type to a buffer + * + * @param ctx Encode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_ecdsa_signature_t *msg); + +/** + * Internal function to decode an SBP type from a buffer + * + * @param ctx Decode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_ecdsa_signature_t *msg); + /** * Internal function to encode an SBP type to a buffer * @@ -86,6 +106,26 @@ bool sbp_msg_certificate_chain_encode_internal( bool sbp_msg_certificate_chain_decode_internal( sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_t *msg); +/** + * Internal function to encode an SBP type to a buffer + * + * @param ctx Encode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_msg_certificate_chain_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg); + +/** + * Internal function to decode an SBP type from a buffer + * + * @param ctx Decode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_msg_certificate_chain_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg); + /** * Internal function to encode an SBP type to a buffer * @@ -113,8 +153,28 @@ bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_encode_internal( - sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_t *msg); +bool sbp_msg_ecdsa_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg); + +/** + * Internal function to decode an SBP type from a buffer + * + * @param ctx Decode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_msg_ecdsa_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg); + +/** + * Internal function to encode an SBP type to a buffer + * + * @param ctx Encode context + * @param msg SBP type instance + * @return true on success, false otherwise + */ +bool sbp_msg_ecdsa_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg); /** * Internal function to decode an SBP type from a buffer @@ -123,8 +183,8 @@ bool sbp_msg_ecdsa_signature_dep_encode_internal( * @param msg SBP type instance * @return true on success, false otherwise */ -bool sbp_msg_ecdsa_signature_dep_decode_internal( - sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_t *msg); +bool sbp_msg_ecdsa_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg); /** * Internal function to encode an SBP type to a buffer diff --git a/c/src/v4/signing.c b/c/src/v4/signing.c index f7090b091f..d449e2c24b 100644 --- a/c/src/v4/signing.c +++ b/c/src/v4/signing.c @@ -137,6 +137,80 @@ int sbp_utc_time_cmp(const sbp_utc_time_t *a, const sbp_utc_time_t *b) { return ret; } +bool sbp_ecdsa_signature_encode_internal(sbp_encode_ctx_t *ctx, + const sbp_ecdsa_signature_t *msg) { + if (!sbp_u8_encode(ctx, &msg->len)) { + return false; + } + for (size_t i = 0; i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->data[i])) { + return false; + } + } + return true; +} + +s8 sbp_ecdsa_signature_encode(uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_ecdsa_signature_t *msg) { + sbp_encode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_ecdsa_signature_encode_internal(&ctx, msg)) { + return SBP_ENCODE_ERROR; + } + if (n_written != NULL) { + *n_written = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +bool sbp_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, + sbp_ecdsa_signature_t *msg) { + if (!sbp_u8_decode(ctx, &msg->len)) { + return false; + } + for (uint8_t i = 0; i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->data[i])) { + return false; + } + } + return true; +} + +s8 sbp_ecdsa_signature_decode(const uint8_t *buf, uint8_t len, uint8_t *n_read, + sbp_ecdsa_signature_t *msg) { + sbp_decode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_ecdsa_signature_decode_internal(&ctx, msg)) { + return SBP_DECODE_ERROR; + } + if (n_read != NULL) { + *n_read = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +int sbp_ecdsa_signature_cmp(const sbp_ecdsa_signature_t *a, + const sbp_ecdsa_signature_t *b) { + int ret = 0; + + ret = sbp_u8_cmp(&a->len, &b->len); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; ret == 0 && i < SBP_ECDSA_SIGNATURE_DATA_MAX; i++) { + ret = sbp_u8_cmp(&a->data[i], &b->data[i]); + } + if (ret != 0) { + return ret; + } + return ret; +} + bool sbp_msg_ecdsa_certificate_encode_internal( sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_certificate_t *msg) { if (!sbp_u8_encode(ctx, &msg->n_msg)) { @@ -281,10 +355,8 @@ bool sbp_msg_certificate_chain_encode_internal( if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { return false; } - for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_SIGNATURE_MAX; i++) { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { - return false; - } + if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { + return false; } return true; } @@ -327,10 +399,8 @@ bool sbp_msg_certificate_chain_decode_internal( if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { - return false; - } + if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { + return false; } return true; } @@ -402,8 +472,164 @@ int sbp_msg_certificate_chain_cmp(const sbp_msg_certificate_chain_t *a, return ret; } - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_SIGNATURE_MAX; + ret = sbp_ecdsa_signature_cmp(&a->signature, &b->signature); + if (ret != 0) { + return ret; + } + return ret; +} + +bool sbp_msg_certificate_chain_dep_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_certificate_chain_dep_t *msg) { + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_encode(ctx, &msg->root_certificate[i])) { + return false; + } + } + for (size_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->intermediate_certificate[i])) { + return false; + } + } + for (size_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->corrections_certificate[i])) { + return false; + } + } + if (!sbp_utc_time_encode_internal(ctx, &msg->expiration)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } + } + return true; +} + +s8 sbp_msg_certificate_chain_dep_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_certificate_chain_dep_t *msg) { + sbp_encode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_msg_certificate_chain_dep_encode_internal(&ctx, msg)) { + return SBP_ENCODE_ERROR; + } + if (n_written != NULL) { + *n_written = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +bool sbp_msg_certificate_chain_dep_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_certificate_chain_dep_t *msg) { + for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->root_certificate[i])) { + return false; + } + } + for (uint8_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->intermediate_certificate[i])) { + return false; + } + } + for (uint8_t i = 0; + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->corrections_certificate[i])) { + return false; + } + } + if (!sbp_utc_time_decode_internal(ctx, &msg->expiration)) { + return false; + } + for (uint8_t i = 0; i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; + } + } + return true; +} + +s8 sbp_msg_certificate_chain_dep_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_certificate_chain_dep_t *msg) { + sbp_decode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_msg_certificate_chain_dep_decode_internal(&ctx, msg)) { + return SBP_DECODE_ERROR; + } + if (n_read != NULL) { + *n_read = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +s8 sbp_msg_certificate_chain_dep_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_certificate_chain_dep_t *msg, + sbp_write_fn_t write) { + uint8_t payload[SBP_MAX_PAYLOAD_LEN]; + uint8_t payload_len; + s8 ret = sbp_msg_certificate_chain_dep_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_payload_send(s, SBP_MSG_CERTIFICATE_CHAIN_DEP, sender_id, + payload_len, payload, write); +} + +int sbp_msg_certificate_chain_dep_cmp( + const sbp_msg_certificate_chain_dep_t *a, + const sbp_msg_certificate_chain_dep_t *b) { + int ret = 0; + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_ROOT_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->root_certificate[i], &b->root_certificate[i]); + } + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_INTERMEDIATE_CERTIFICATE_MAX; i++) { + ret = sbp_u8_cmp(&a->intermediate_certificate[i], + &b->intermediate_certificate[i]); + } + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && + i < SBP_MSG_CERTIFICATE_CHAIN_DEP_CORRECTIONS_CERTIFICATE_MAX; + i++) { + ret = sbp_u8_cmp(&a->corrections_certificate[i], + &b->corrections_certificate[i]); + } + if (ret != 0) { + return ret; + } + + ret = sbp_utc_time_cmp(&a->expiration, &b->expiration); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_CERTIFICATE_CHAIN_DEP_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } if (ret != 0) { @@ -428,14 +654,9 @@ bool sbp_msg_ecdsa_signature_encode_internal( return false; } } - if (!sbp_u8_encode(ctx, &msg->n_signature_bytes)) { + if (!sbp_ecdsa_signature_encode_internal(ctx, &msg->signature)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_SIGNATURE_MAX; i++) { - if (!sbp_u8_encode(ctx, &msg->signature[i])) { - return false; - } - } for (size_t i = 0; i < msg->n_signed_messages; i++) { if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { return false; @@ -475,14 +696,9 @@ bool sbp_msg_ecdsa_signature_decode_internal(sbp_decode_ctx_t *ctx, return false; } } - if (!sbp_u8_decode(ctx, &msg->n_signature_bytes)) { + if (!sbp_ecdsa_signature_decode_internal(ctx, &msg->signature)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_SIGNATURE_MAX; i++) { - if (!sbp_u8_decode(ctx, &msg->signature[i])) { - return false; - } - } msg->n_signed_messages = (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); for (uint8_t i = 0; i < msg->n_signed_messages; i++) { @@ -550,13 +766,170 @@ int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, return ret; } - ret = sbp_u8_cmp(&a->n_signature_bytes, &b->n_signature_bytes); + ret = sbp_ecdsa_signature_cmp(&a->signature, &b->signature); if (ret != 0) { return ret; } - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_SIGNATURE_MAX; + ret = sbp_u8_cmp(&a->n_signed_messages, &b->n_signed_messages); + for (uint8_t i = 0; ret == 0 && i < a->n_signed_messages; i++) { + ret = sbp_u8_cmp(&a->signed_messages[i], &b->signed_messages[i]); + } + if (ret != 0) { + return ret; + } + return ret; +} + +bool sbp_msg_ecdsa_signature_dep_b_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_b_t *msg) { + if (!sbp_u8_encode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { + return false; + } + } + if (!sbp_u8_encode(ctx, &msg->n_signature_bytes)) { + return false; + } + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_encode(ctx, &msg->signature[i])) { + return false; + } + } + for (size_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_encode(ctx, &msg->signed_messages[i])) { + return false; + } + } + return true; +} + +s8 sbp_msg_ecdsa_signature_dep_b_encode( + uint8_t *buf, uint8_t len, uint8_t *n_written, + const sbp_msg_ecdsa_signature_dep_b_t *msg) { + sbp_encode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_msg_ecdsa_signature_dep_b_encode_internal(&ctx, msg)) { + return SBP_ENCODE_ERROR; + } + if (n_written != NULL) { + *n_written = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +bool sbp_msg_ecdsa_signature_dep_b_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_b_t *msg) { + if (!sbp_u8_decode(ctx, &msg->flags)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->stream_counter)) { + return false; + } + if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { + return false; + } + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; + i++) { + if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { + return false; + } + } + if (!sbp_u8_decode(ctx, &msg->n_signature_bytes)) { + return false; + } + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { + if (!sbp_u8_decode(ctx, &msg->signature[i])) { + return false; + } + } + msg->n_signed_messages = + (uint8_t)((ctx->buf_len - ctx->offset) / SBP_ENCODED_LEN_U8); + for (uint8_t i = 0; i < msg->n_signed_messages; i++) { + if (!sbp_u8_decode(ctx, &msg->signed_messages[i])) { + return false; + } + } + return true; +} + +s8 sbp_msg_ecdsa_signature_dep_b_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_b_t *msg) { + sbp_decode_ctx_t ctx; + ctx.buf = buf; + ctx.buf_len = len; + ctx.offset = 0; + if (!sbp_msg_ecdsa_signature_dep_b_decode_internal(&ctx, msg)) { + return SBP_DECODE_ERROR; + } + if (n_read != NULL) { + *n_read = (uint8_t)ctx.offset; + } + return SBP_OK; +} + +s8 sbp_msg_ecdsa_signature_dep_b_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_b_t *msg, + sbp_write_fn_t write) { + uint8_t payload[SBP_MAX_PAYLOAD_LEN]; + uint8_t payload_len; + s8 ret = sbp_msg_ecdsa_signature_dep_b_encode(payload, sizeof(payload), + &payload_len, msg); + if (ret != SBP_OK) { + return ret; + } + return sbp_payload_send(s, SBP_MSG_ECDSA_SIGNATURE_DEP_B, sender_id, + payload_len, payload, write); +} + +int sbp_msg_ecdsa_signature_dep_b_cmp( + const sbp_msg_ecdsa_signature_dep_b_t *a, + const sbp_msg_ecdsa_signature_dep_b_t *b) { + int ret = 0; + + ret = sbp_u8_cmp(&a->flags, &b->flags); + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->stream_counter, &b->stream_counter); + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->on_demand_counter, &b->on_demand_counter); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_CERTIFICATE_ID_MAX; i++) { + ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); + } + if (ret != 0) { + return ret; + } + + ret = sbp_u8_cmp(&a->n_signature_bytes, &b->n_signature_bytes); + if (ret != 0) { + return ret; + } + + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_B_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } if (ret != 0) { @@ -573,8 +946,8 @@ int sbp_msg_ecdsa_signature_cmp(const sbp_msg_ecdsa_signature_t *a, return ret; } -bool sbp_msg_ecdsa_signature_dep_encode_internal( - sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_t *msg) { +bool sbp_msg_ecdsa_signature_dep_a_encode_internal( + sbp_encode_ctx_t *ctx, const sbp_msg_ecdsa_signature_dep_a_t *msg) { if (!sbp_u8_encode(ctx, &msg->flags)) { return false; } @@ -584,12 +957,13 @@ bool sbp_msg_ecdsa_signature_dep_encode_internal( if (!sbp_u8_encode(ctx, &msg->on_demand_counter)) { return false; } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_CERTIFICATE_ID_MAX; i++) { + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; + i++) { if (!sbp_u8_encode(ctx, &msg->certificate_id[i])) { return false; } } - for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNATURE_MAX; i++) { + for (size_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { if (!sbp_u8_encode(ctx, &msg->signature[i])) { return false; } @@ -602,14 +976,14 @@ bool sbp_msg_ecdsa_signature_dep_encode_internal( return true; } -s8 sbp_msg_ecdsa_signature_dep_encode( +s8 sbp_msg_ecdsa_signature_dep_a_encode( uint8_t *buf, uint8_t len, uint8_t *n_written, - const sbp_msg_ecdsa_signature_dep_t *msg) { + const sbp_msg_ecdsa_signature_dep_a_t *msg) { sbp_encode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; ctx.offset = 0; - if (!sbp_msg_ecdsa_signature_dep_encode_internal(&ctx, msg)) { + if (!sbp_msg_ecdsa_signature_dep_a_encode_internal(&ctx, msg)) { return SBP_ENCODE_ERROR; } if (n_written != NULL) { @@ -618,8 +992,8 @@ s8 sbp_msg_ecdsa_signature_dep_encode( return SBP_OK; } -bool sbp_msg_ecdsa_signature_dep_decode_internal( - sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_t *msg) { +bool sbp_msg_ecdsa_signature_dep_a_decode_internal( + sbp_decode_ctx_t *ctx, sbp_msg_ecdsa_signature_dep_a_t *msg) { if (!sbp_u8_decode(ctx, &msg->flags)) { return false; } @@ -629,12 +1003,13 @@ bool sbp_msg_ecdsa_signature_dep_decode_internal( if (!sbp_u8_decode(ctx, &msg->on_demand_counter)) { return false; } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_CERTIFICATE_ID_MAX; i++) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; + i++) { if (!sbp_u8_decode(ctx, &msg->certificate_id[i])) { return false; } } - for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNATURE_MAX; i++) { + for (uint8_t i = 0; i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { if (!sbp_u8_decode(ctx, &msg->signature[i])) { return false; } @@ -649,14 +1024,14 @@ bool sbp_msg_ecdsa_signature_dep_decode_internal( return true; } -s8 sbp_msg_ecdsa_signature_dep_decode(const uint8_t *buf, uint8_t len, - uint8_t *n_read, - sbp_msg_ecdsa_signature_dep_t *msg) { +s8 sbp_msg_ecdsa_signature_dep_a_decode(const uint8_t *buf, uint8_t len, + uint8_t *n_read, + sbp_msg_ecdsa_signature_dep_a_t *msg) { sbp_decode_ctx_t ctx; ctx.buf = buf; ctx.buf_len = len; ctx.offset = 0; - if (!sbp_msg_ecdsa_signature_dep_decode_internal(&ctx, msg)) { + if (!sbp_msg_ecdsa_signature_dep_a_decode_internal(&ctx, msg)) { return SBP_DECODE_ERROR; } if (n_read != NULL) { @@ -665,22 +1040,23 @@ s8 sbp_msg_ecdsa_signature_dep_decode(const uint8_t *buf, uint8_t len, return SBP_OK; } -s8 sbp_msg_ecdsa_signature_dep_send(sbp_state_t *s, u16 sender_id, - const sbp_msg_ecdsa_signature_dep_t *msg, - sbp_write_fn_t write) { +s8 sbp_msg_ecdsa_signature_dep_a_send( + sbp_state_t *s, u16 sender_id, const sbp_msg_ecdsa_signature_dep_a_t *msg, + sbp_write_fn_t write) { uint8_t payload[SBP_MAX_PAYLOAD_LEN]; uint8_t payload_len; - s8 ret = sbp_msg_ecdsa_signature_dep_encode(payload, sizeof(payload), - &payload_len, msg); + s8 ret = sbp_msg_ecdsa_signature_dep_a_encode(payload, sizeof(payload), + &payload_len, msg); if (ret != SBP_OK) { return ret; } - return sbp_payload_send(s, SBP_MSG_ECDSA_SIGNATURE_DEP, sender_id, + return sbp_payload_send(s, SBP_MSG_ECDSA_SIGNATURE_DEP_A, sender_id, payload_len, payload, write); } -int sbp_msg_ecdsa_signature_dep_cmp(const sbp_msg_ecdsa_signature_dep_t *a, - const sbp_msg_ecdsa_signature_dep_t *b) { +int sbp_msg_ecdsa_signature_dep_a_cmp( + const sbp_msg_ecdsa_signature_dep_a_t *a, + const sbp_msg_ecdsa_signature_dep_a_t *b) { int ret = 0; ret = sbp_u8_cmp(&a->flags, &b->flags); @@ -699,15 +1075,15 @@ int sbp_msg_ecdsa_signature_dep_cmp(const sbp_msg_ecdsa_signature_dep_t *a, } for (uint8_t i = 0; - ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_CERTIFICATE_ID_MAX; i++) { + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_CERTIFICATE_ID_MAX; i++) { ret = sbp_u8_cmp(&a->certificate_id[i], &b->certificate_id[i]); } if (ret != 0) { return ret; } - for (uint8_t i = 0; ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_SIGNATURE_MAX; - i++) { + for (uint8_t i = 0; + ret == 0 && i < SBP_MSG_ECDSA_SIGNATURE_DEP_A_SIGNATURE_MAX; i++) { ret = sbp_u8_cmp(&a->signature[i], &b->signature[i]); } if (ret != 0) { diff --git a/c/test/auto_check_sbp_signing_MsgCertificateChain.c b/c/test/auto_check_sbp_signing_MsgCertificateChain.c index f27adb97a1..3e2606d473 100644 --- a/c/test/auto_check_sbp_signing_MsgCertificateChain.c +++ b/c/test/auto_check_sbp_signing_MsgCertificateChain.c @@ -90,19 +90,19 @@ START_TEST(test_auto_check_sbp_signing_MsgCertificateChain) { logging_reset(); - sbp_callback_register(&sbp_state, 0xC05, &msg_callback, + sbp_callback_register(&sbp_state, 0xC09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); u8 encoded_frame[] = { - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, }; dummy_reset(); @@ -244,133 +244,151 @@ START_TEST(test_auto_check_sbp_signing_MsgCertificateChain) { test_msg.certificate_chain.root_certificate[19] = 19; - test_msg.certificate_chain.signature[0] = 0; + test_msg.certificate_chain.signature.data[0] = 0; - test_msg.certificate_chain.signature[1] = 1; + test_msg.certificate_chain.signature.data[1] = 1; - test_msg.certificate_chain.signature[2] = 2; + test_msg.certificate_chain.signature.data[2] = 2; - test_msg.certificate_chain.signature[3] = 3; + test_msg.certificate_chain.signature.data[3] = 3; - test_msg.certificate_chain.signature[4] = 4; + test_msg.certificate_chain.signature.data[4] = 4; - test_msg.certificate_chain.signature[5] = 5; + test_msg.certificate_chain.signature.data[5] = 5; - test_msg.certificate_chain.signature[6] = 6; + test_msg.certificate_chain.signature.data[6] = 6; - test_msg.certificate_chain.signature[7] = 7; + test_msg.certificate_chain.signature.data[7] = 7; - test_msg.certificate_chain.signature[8] = 0; + test_msg.certificate_chain.signature.data[8] = 8; - test_msg.certificate_chain.signature[9] = 1; + test_msg.certificate_chain.signature.data[9] = 9; - test_msg.certificate_chain.signature[10] = 2; + test_msg.certificate_chain.signature.data[10] = 10; - test_msg.certificate_chain.signature[11] = 3; + test_msg.certificate_chain.signature.data[11] = 11; - test_msg.certificate_chain.signature[12] = 4; + test_msg.certificate_chain.signature.data[12] = 12; - test_msg.certificate_chain.signature[13] = 5; + test_msg.certificate_chain.signature.data[13] = 13; - test_msg.certificate_chain.signature[14] = 6; + test_msg.certificate_chain.signature.data[14] = 14; - test_msg.certificate_chain.signature[15] = 7; + test_msg.certificate_chain.signature.data[15] = 15; - test_msg.certificate_chain.signature[16] = 0; + test_msg.certificate_chain.signature.data[16] = 16; - test_msg.certificate_chain.signature[17] = 1; + test_msg.certificate_chain.signature.data[17] = 17; - test_msg.certificate_chain.signature[18] = 2; + test_msg.certificate_chain.signature.data[18] = 18; - test_msg.certificate_chain.signature[19] = 3; + test_msg.certificate_chain.signature.data[19] = 19; - test_msg.certificate_chain.signature[20] = 4; + test_msg.certificate_chain.signature.data[20] = 20; - test_msg.certificate_chain.signature[21] = 5; + test_msg.certificate_chain.signature.data[21] = 21; - test_msg.certificate_chain.signature[22] = 6; + test_msg.certificate_chain.signature.data[22] = 22; - test_msg.certificate_chain.signature[23] = 7; + test_msg.certificate_chain.signature.data[23] = 23; - test_msg.certificate_chain.signature[24] = 0; + test_msg.certificate_chain.signature.data[24] = 24; - test_msg.certificate_chain.signature[25] = 1; + test_msg.certificate_chain.signature.data[25] = 25; - test_msg.certificate_chain.signature[26] = 2; + test_msg.certificate_chain.signature.data[26] = 26; - test_msg.certificate_chain.signature[27] = 3; + test_msg.certificate_chain.signature.data[27] = 27; - test_msg.certificate_chain.signature[28] = 4; + test_msg.certificate_chain.signature.data[28] = 28; - test_msg.certificate_chain.signature[29] = 5; + test_msg.certificate_chain.signature.data[29] = 29; - test_msg.certificate_chain.signature[30] = 6; + test_msg.certificate_chain.signature.data[30] = 30; - test_msg.certificate_chain.signature[31] = 7; + test_msg.certificate_chain.signature.data[31] = 31; - test_msg.certificate_chain.signature[32] = 0; + test_msg.certificate_chain.signature.data[32] = 32; - test_msg.certificate_chain.signature[33] = 1; + test_msg.certificate_chain.signature.data[33] = 33; - test_msg.certificate_chain.signature[34] = 2; + test_msg.certificate_chain.signature.data[34] = 34; - test_msg.certificate_chain.signature[35] = 3; + test_msg.certificate_chain.signature.data[35] = 35; - test_msg.certificate_chain.signature[36] = 4; + test_msg.certificate_chain.signature.data[36] = 36; - test_msg.certificate_chain.signature[37] = 5; + test_msg.certificate_chain.signature.data[37] = 37; - test_msg.certificate_chain.signature[38] = 6; + test_msg.certificate_chain.signature.data[38] = 38; - test_msg.certificate_chain.signature[39] = 7; + test_msg.certificate_chain.signature.data[39] = 39; - test_msg.certificate_chain.signature[40] = 0; + test_msg.certificate_chain.signature.data[40] = 40; - test_msg.certificate_chain.signature[41] = 1; + test_msg.certificate_chain.signature.data[41] = 41; - test_msg.certificate_chain.signature[42] = 2; + test_msg.certificate_chain.signature.data[42] = 42; - test_msg.certificate_chain.signature[43] = 3; + test_msg.certificate_chain.signature.data[43] = 43; - test_msg.certificate_chain.signature[44] = 4; + test_msg.certificate_chain.signature.data[44] = 44; - test_msg.certificate_chain.signature[45] = 5; + test_msg.certificate_chain.signature.data[45] = 45; - test_msg.certificate_chain.signature[46] = 6; + test_msg.certificate_chain.signature.data[46] = 46; - test_msg.certificate_chain.signature[47] = 7; + test_msg.certificate_chain.signature.data[47] = 47; - test_msg.certificate_chain.signature[48] = 0; + test_msg.certificate_chain.signature.data[48] = 48; - test_msg.certificate_chain.signature[49] = 1; + test_msg.certificate_chain.signature.data[49] = 49; - test_msg.certificate_chain.signature[50] = 2; + test_msg.certificate_chain.signature.data[50] = 50; - test_msg.certificate_chain.signature[51] = 3; + test_msg.certificate_chain.signature.data[51] = 51; - test_msg.certificate_chain.signature[52] = 4; + test_msg.certificate_chain.signature.data[52] = 52; - test_msg.certificate_chain.signature[53] = 5; + test_msg.certificate_chain.signature.data[53] = 53; - test_msg.certificate_chain.signature[54] = 6; + test_msg.certificate_chain.signature.data[54] = 54; - test_msg.certificate_chain.signature[55] = 7; + test_msg.certificate_chain.signature.data[55] = 55; - test_msg.certificate_chain.signature[56] = 0; + test_msg.certificate_chain.signature.data[56] = 56; - test_msg.certificate_chain.signature[57] = 1; + test_msg.certificate_chain.signature.data[57] = 57; - test_msg.certificate_chain.signature[58] = 2; + test_msg.certificate_chain.signature.data[58] = 58; - test_msg.certificate_chain.signature[59] = 3; + test_msg.certificate_chain.signature.data[59] = 59; - test_msg.certificate_chain.signature[60] = 4; + test_msg.certificate_chain.signature.data[60] = 60; - test_msg.certificate_chain.signature[61] = 5; + test_msg.certificate_chain.signature.data[61] = 61; - test_msg.certificate_chain.signature[62] = 6; + test_msg.certificate_chain.signature.data[62] = 62; - test_msg.certificate_chain.signature[63] = 7; + test_msg.certificate_chain.signature.data[63] = 63; + + test_msg.certificate_chain.signature.data[64] = 64; + + test_msg.certificate_chain.signature.data[65] = 65; + + test_msg.certificate_chain.signature.data[66] = 66; + + test_msg.certificate_chain.signature.data[67] = 67; + + test_msg.certificate_chain.signature.data[68] = 68; + + test_msg.certificate_chain.signature.data[69] = 69; + + test_msg.certificate_chain.signature.data[70] = 70; + + test_msg.certificate_chain.signature.data[71] = 71; + + test_msg.certificate_chain.signature.len = 72; sbp_message_send(&sbp_state, SbpMsgCertificateChain, 66, &test_msg, &dummy_write); @@ -782,325 +800,371 @@ START_TEST(test_auto_check_sbp_signing_MsgCertificateChain) { last_msg.msg.certificate_chain.root_certificate[19]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[0] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[0], " + last_msg.msg.certificate_chain.signature.data[0] == 0, + "incorrect value for last_msg.msg.certificate_chain.signature.data[0], " "expected 0, is %d", - last_msg.msg.certificate_chain.signature[0]); + last_msg.msg.certificate_chain.signature.data[0]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[1] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[1], " + last_msg.msg.certificate_chain.signature.data[1] == 1, + "incorrect value for last_msg.msg.certificate_chain.signature.data[1], " "expected 1, is %d", - last_msg.msg.certificate_chain.signature[1]); + last_msg.msg.certificate_chain.signature.data[1]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[2] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[2], " + last_msg.msg.certificate_chain.signature.data[2] == 2, + "incorrect value for last_msg.msg.certificate_chain.signature.data[2], " "expected 2, is %d", - last_msg.msg.certificate_chain.signature[2]); + last_msg.msg.certificate_chain.signature.data[2]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[3] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[3], " + last_msg.msg.certificate_chain.signature.data[3] == 3, + "incorrect value for last_msg.msg.certificate_chain.signature.data[3], " "expected 3, is %d", - last_msg.msg.certificate_chain.signature[3]); + last_msg.msg.certificate_chain.signature.data[3]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[4] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[4], " + last_msg.msg.certificate_chain.signature.data[4] == 4, + "incorrect value for last_msg.msg.certificate_chain.signature.data[4], " "expected 4, is %d", - last_msg.msg.certificate_chain.signature[4]); + last_msg.msg.certificate_chain.signature.data[4]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[5] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[5], " + last_msg.msg.certificate_chain.signature.data[5] == 5, + "incorrect value for last_msg.msg.certificate_chain.signature.data[5], " "expected 5, is %d", - last_msg.msg.certificate_chain.signature[5]); + last_msg.msg.certificate_chain.signature.data[5]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[6] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[6], " + last_msg.msg.certificate_chain.signature.data[6] == 6, + "incorrect value for last_msg.msg.certificate_chain.signature.data[6], " "expected 6, is %d", - last_msg.msg.certificate_chain.signature[6]); + last_msg.msg.certificate_chain.signature.data[6]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[7] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[7], " + last_msg.msg.certificate_chain.signature.data[7] == 7, + "incorrect value for last_msg.msg.certificate_chain.signature.data[7], " "expected 7, is %d", - last_msg.msg.certificate_chain.signature[7]); + last_msg.msg.certificate_chain.signature.data[7]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[8] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[8], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[8]); + last_msg.msg.certificate_chain.signature.data[8] == 8, + "incorrect value for last_msg.msg.certificate_chain.signature.data[8], " + "expected 8, is %d", + last_msg.msg.certificate_chain.signature.data[8]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[9] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[9], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[9]); + last_msg.msg.certificate_chain.signature.data[9] == 9, + "incorrect value for last_msg.msg.certificate_chain.signature.data[9], " + "expected 9, is %d", + last_msg.msg.certificate_chain.signature.data[9]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[10] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[10], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[10]); + last_msg.msg.certificate_chain.signature.data[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[10], expected 10, is %d", + last_msg.msg.certificate_chain.signature.data[10]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[11] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[11], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[11]); + last_msg.msg.certificate_chain.signature.data[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[11], expected 11, is %d", + last_msg.msg.certificate_chain.signature.data[11]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[12] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[12], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[12]); + last_msg.msg.certificate_chain.signature.data[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[12], expected 12, is %d", + last_msg.msg.certificate_chain.signature.data[12]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[13] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[13], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[13]); + last_msg.msg.certificate_chain.signature.data[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[13], expected 13, is %d", + last_msg.msg.certificate_chain.signature.data[13]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[14] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[14], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[14]); + last_msg.msg.certificate_chain.signature.data[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[14], expected 14, is %d", + last_msg.msg.certificate_chain.signature.data[14]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[15] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[15], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[15]); + last_msg.msg.certificate_chain.signature.data[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[15], expected 15, is %d", + last_msg.msg.certificate_chain.signature.data[15]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[16] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[16], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[16]); + last_msg.msg.certificate_chain.signature.data[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[16], expected 16, is %d", + last_msg.msg.certificate_chain.signature.data[16]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[17] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[17], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[17]); + last_msg.msg.certificate_chain.signature.data[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[17], expected 17, is %d", + last_msg.msg.certificate_chain.signature.data[17]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[18] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[18], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[18]); + last_msg.msg.certificate_chain.signature.data[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[18], expected 18, is %d", + last_msg.msg.certificate_chain.signature.data[18]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[19] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[19], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[19]); + last_msg.msg.certificate_chain.signature.data[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[19], expected 19, is %d", + last_msg.msg.certificate_chain.signature.data[19]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[20] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[20], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[20]); + last_msg.msg.certificate_chain.signature.data[20] == 20, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[20], expected 20, is %d", + last_msg.msg.certificate_chain.signature.data[20]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[21] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[21], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[21]); + last_msg.msg.certificate_chain.signature.data[21] == 21, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[21], expected 21, is %d", + last_msg.msg.certificate_chain.signature.data[21]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[22] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[22], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[22]); + last_msg.msg.certificate_chain.signature.data[22] == 22, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[22], expected 22, is %d", + last_msg.msg.certificate_chain.signature.data[22]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[23] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[23], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[23]); + last_msg.msg.certificate_chain.signature.data[23] == 23, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[23], expected 23, is %d", + last_msg.msg.certificate_chain.signature.data[23]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[24] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[24], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[24]); + last_msg.msg.certificate_chain.signature.data[24] == 24, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[24], expected 24, is %d", + last_msg.msg.certificate_chain.signature.data[24]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[25] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[25], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[25]); + last_msg.msg.certificate_chain.signature.data[25] == 25, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[25], expected 25, is %d", + last_msg.msg.certificate_chain.signature.data[25]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[26] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[26], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[26]); + last_msg.msg.certificate_chain.signature.data[26] == 26, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[26], expected 26, is %d", + last_msg.msg.certificate_chain.signature.data[26]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[27] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[27], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[27]); + last_msg.msg.certificate_chain.signature.data[27] == 27, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[27], expected 27, is %d", + last_msg.msg.certificate_chain.signature.data[27]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[28] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[28], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[28]); + last_msg.msg.certificate_chain.signature.data[28] == 28, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[28], expected 28, is %d", + last_msg.msg.certificate_chain.signature.data[28]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[29] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[29], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[29]); + last_msg.msg.certificate_chain.signature.data[29] == 29, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[29], expected 29, is %d", + last_msg.msg.certificate_chain.signature.data[29]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[30] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[30], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[30]); + last_msg.msg.certificate_chain.signature.data[30] == 30, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[30], expected 30, is %d", + last_msg.msg.certificate_chain.signature.data[30]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[31] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[31], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[31]); + last_msg.msg.certificate_chain.signature.data[31] == 31, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[31], expected 31, is %d", + last_msg.msg.certificate_chain.signature.data[31]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[32] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[32], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[32]); + last_msg.msg.certificate_chain.signature.data[32] == 32, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[32], expected 32, is %d", + last_msg.msg.certificate_chain.signature.data[32]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[33] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[33], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[33]); + last_msg.msg.certificate_chain.signature.data[33] == 33, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[33], expected 33, is %d", + last_msg.msg.certificate_chain.signature.data[33]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[34] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[34], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[34]); + last_msg.msg.certificate_chain.signature.data[34] == 34, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[34], expected 34, is %d", + last_msg.msg.certificate_chain.signature.data[34]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[35] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[35], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[35]); + last_msg.msg.certificate_chain.signature.data[35] == 35, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[35], expected 35, is %d", + last_msg.msg.certificate_chain.signature.data[35]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[36] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[36], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[36]); + last_msg.msg.certificate_chain.signature.data[36] == 36, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[36], expected 36, is %d", + last_msg.msg.certificate_chain.signature.data[36]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[37] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[37], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[37]); + last_msg.msg.certificate_chain.signature.data[37] == 37, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[37], expected 37, is %d", + last_msg.msg.certificate_chain.signature.data[37]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[38] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[38], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[38]); + last_msg.msg.certificate_chain.signature.data[38] == 38, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[38], expected 38, is %d", + last_msg.msg.certificate_chain.signature.data[38]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[39] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[39], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[39]); + last_msg.msg.certificate_chain.signature.data[39] == 39, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[39], expected 39, is %d", + last_msg.msg.certificate_chain.signature.data[39]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[40] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[40], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[40]); + last_msg.msg.certificate_chain.signature.data[40] == 40, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[40], expected 40, is %d", + last_msg.msg.certificate_chain.signature.data[40]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[41] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[41], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[41]); + last_msg.msg.certificate_chain.signature.data[41] == 41, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[41], expected 41, is %d", + last_msg.msg.certificate_chain.signature.data[41]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[42] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[42], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[42]); + last_msg.msg.certificate_chain.signature.data[42] == 42, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[42], expected 42, is %d", + last_msg.msg.certificate_chain.signature.data[42]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[43] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[43], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[43]); + last_msg.msg.certificate_chain.signature.data[43] == 43, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[43], expected 43, is %d", + last_msg.msg.certificate_chain.signature.data[43]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[44] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[44], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[44]); + last_msg.msg.certificate_chain.signature.data[44] == 44, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[44], expected 44, is %d", + last_msg.msg.certificate_chain.signature.data[44]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[45] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[45], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[45]); + last_msg.msg.certificate_chain.signature.data[45] == 45, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[45], expected 45, is %d", + last_msg.msg.certificate_chain.signature.data[45]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[46] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[46], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[46]); + last_msg.msg.certificate_chain.signature.data[46] == 46, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[46], expected 46, is %d", + last_msg.msg.certificate_chain.signature.data[46]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[47] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[47], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[47]); + last_msg.msg.certificate_chain.signature.data[47] == 47, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[47], expected 47, is %d", + last_msg.msg.certificate_chain.signature.data[47]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[48] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[48], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[48]); + last_msg.msg.certificate_chain.signature.data[48] == 48, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[48], expected 48, is %d", + last_msg.msg.certificate_chain.signature.data[48]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[49] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[49], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[49]); + last_msg.msg.certificate_chain.signature.data[49] == 49, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[49], expected 49, is %d", + last_msg.msg.certificate_chain.signature.data[49]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[50] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[50], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[50]); + last_msg.msg.certificate_chain.signature.data[50] == 50, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[50], expected 50, is %d", + last_msg.msg.certificate_chain.signature.data[50]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[51] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[51], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[51]); + last_msg.msg.certificate_chain.signature.data[51] == 51, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[51], expected 51, is %d", + last_msg.msg.certificate_chain.signature.data[51]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[52] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[52], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[52]); + last_msg.msg.certificate_chain.signature.data[52] == 52, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[52], expected 52, is %d", + last_msg.msg.certificate_chain.signature.data[52]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[53] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[53], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[53]); + last_msg.msg.certificate_chain.signature.data[53] == 53, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[53], expected 53, is %d", + last_msg.msg.certificate_chain.signature.data[53]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[54] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[54], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[54]); + last_msg.msg.certificate_chain.signature.data[54] == 54, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[54], expected 54, is %d", + last_msg.msg.certificate_chain.signature.data[54]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[55] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[55], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[55]); + last_msg.msg.certificate_chain.signature.data[55] == 55, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[55], expected 55, is %d", + last_msg.msg.certificate_chain.signature.data[55]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[56] == 0, - "incorrect value for last_msg.msg.certificate_chain.signature[56], " - "expected 0, is %d", - last_msg.msg.certificate_chain.signature[56]); + last_msg.msg.certificate_chain.signature.data[56] == 56, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[56], expected 56, is %d", + last_msg.msg.certificate_chain.signature.data[56]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[57] == 1, - "incorrect value for last_msg.msg.certificate_chain.signature[57], " - "expected 1, is %d", - last_msg.msg.certificate_chain.signature[57]); + last_msg.msg.certificate_chain.signature.data[57] == 57, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[57], expected 57, is %d", + last_msg.msg.certificate_chain.signature.data[57]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[58] == 2, - "incorrect value for last_msg.msg.certificate_chain.signature[58], " - "expected 2, is %d", - last_msg.msg.certificate_chain.signature[58]); + last_msg.msg.certificate_chain.signature.data[58] == 58, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[58], expected 58, is %d", + last_msg.msg.certificate_chain.signature.data[58]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[59] == 3, - "incorrect value for last_msg.msg.certificate_chain.signature[59], " - "expected 3, is %d", - last_msg.msg.certificate_chain.signature[59]); + last_msg.msg.certificate_chain.signature.data[59] == 59, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[59], expected 59, is %d", + last_msg.msg.certificate_chain.signature.data[59]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[60] == 4, - "incorrect value for last_msg.msg.certificate_chain.signature[60], " - "expected 4, is %d", - last_msg.msg.certificate_chain.signature[60]); + last_msg.msg.certificate_chain.signature.data[60] == 60, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[60], expected 60, is %d", + last_msg.msg.certificate_chain.signature.data[60]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[61] == 5, - "incorrect value for last_msg.msg.certificate_chain.signature[61], " - "expected 5, is %d", - last_msg.msg.certificate_chain.signature[61]); + last_msg.msg.certificate_chain.signature.data[61] == 61, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[61], expected 61, is %d", + last_msg.msg.certificate_chain.signature.data[61]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[62] == 6, - "incorrect value for last_msg.msg.certificate_chain.signature[62], " - "expected 6, is %d", - last_msg.msg.certificate_chain.signature[62]); + last_msg.msg.certificate_chain.signature.data[62] == 62, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[62], expected 62, is %d", + last_msg.msg.certificate_chain.signature.data[62]); ck_assert_msg( - last_msg.msg.certificate_chain.signature[63] == 7, - "incorrect value for last_msg.msg.certificate_chain.signature[63], " - "expected 7, is %d", - last_msg.msg.certificate_chain.signature[63]); + last_msg.msg.certificate_chain.signature.data[63] == 63, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[63], expected 63, is %d", + last_msg.msg.certificate_chain.signature.data[63]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[64] == 64, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[64], expected 64, is %d", + last_msg.msg.certificate_chain.signature.data[64]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[65] == 65, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[65], expected 65, is %d", + last_msg.msg.certificate_chain.signature.data[65]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[66] == 66, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[66], expected 66, is %d", + last_msg.msg.certificate_chain.signature.data[66]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[67] == 67, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[67], expected 67, is %d", + last_msg.msg.certificate_chain.signature.data[67]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[68] == 68, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[68], expected 68, is %d", + last_msg.msg.certificate_chain.signature.data[68]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[69] == 69, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[69], expected 69, is %d", + last_msg.msg.certificate_chain.signature.data[69]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[70] == 70, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[70], expected 70, is %d", + last_msg.msg.certificate_chain.signature.data[70]); + ck_assert_msg( + last_msg.msg.certificate_chain.signature.data[71] == 71, + "incorrect value for " + "last_msg.msg.certificate_chain.signature.data[71], expected 71, is %d", + last_msg.msg.certificate_chain.signature.data[71]); + + ck_assert_msg( + last_msg.msg.certificate_chain.signature.len == 72, + "incorrect value for last_msg.msg.certificate_chain.signature.len, " + "expected 72, is %d", + last_msg.msg.certificate_chain.signature.len); } } END_TEST diff --git a/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c b/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c new file mode 100644 index 0000000000..77e8d903db --- /dev/null +++ b/c/test/auto_check_sbp_signing_MsgCertificateChainDep.c @@ -0,0 +1,1117 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include // for debugging +#include // for malloc + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + sbp_msg_type_t msg_type; + sbp_msg_t msg; + void *context; +} last_msg; + +static u32 dummy_wr = 0; +static u32 dummy_rd = 0; +static u8 dummy_buff[1024]; +static void *last_io_context; + +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; + +static void dummy_reset() { + dummy_rd = dummy_wr = 0; + memset(dummy_buff, 0, sizeof(dummy_buff)); +} + +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; +} + +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; +} + +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } + +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { + last_msg.n_callbacks_logged++; + last_msg.sender_id = sender_id; + last_msg.msg_type = msg_type; + last_msg.msg = *msg; + last_msg.context = context; +} + +START_TEST(test_auto_check_sbp_signing_MsgCertificateChainDep) { + static sbp_msg_callbacks_node_t n; + + // State of the SBP message parser. + // Must be statically allocated. + sbp_state_t sbp_state; + + // + // Run tests: + // + // Test successful parsing of a message + { + // SBP parser state must be initialized before sbp_process is called. + // We re-initialize before every test so that callbacks for the same message + // types can be + // allocated multiple times across different tests. + sbp_state_init(&sbp_state); + + sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); + + logging_reset(); + + sbp_callback_register(&sbp_state, 0xC05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + dummy_reset(); + + sbp_msg_t test_msg; + memset(&test_msg, 0, sizeof(test_msg)); + + test_msg.certificate_chain_dep.corrections_certificate[0] = 20; + + test_msg.certificate_chain_dep.corrections_certificate[1] = 21; + + test_msg.certificate_chain_dep.corrections_certificate[2] = 22; + + test_msg.certificate_chain_dep.corrections_certificate[3] = 23; + + test_msg.certificate_chain_dep.corrections_certificate[4] = 24; + + test_msg.certificate_chain_dep.corrections_certificate[5] = 25; + + test_msg.certificate_chain_dep.corrections_certificate[6] = 26; + + test_msg.certificate_chain_dep.corrections_certificate[7] = 27; + + test_msg.certificate_chain_dep.corrections_certificate[8] = 28; + + test_msg.certificate_chain_dep.corrections_certificate[9] = 29; + + test_msg.certificate_chain_dep.corrections_certificate[10] = 10; + + test_msg.certificate_chain_dep.corrections_certificate[11] = 11; + + test_msg.certificate_chain_dep.corrections_certificate[12] = 12; + + test_msg.certificate_chain_dep.corrections_certificate[13] = 13; + + test_msg.certificate_chain_dep.corrections_certificate[14] = 14; + + test_msg.certificate_chain_dep.corrections_certificate[15] = 15; + + test_msg.certificate_chain_dep.corrections_certificate[16] = 16; + + test_msg.certificate_chain_dep.corrections_certificate[17] = 17; + + test_msg.certificate_chain_dep.corrections_certificate[18] = 18; + + test_msg.certificate_chain_dep.corrections_certificate[19] = 19; + + test_msg.certificate_chain_dep.expiration.day = 30; + + test_msg.certificate_chain_dep.expiration.hours = 12; + + test_msg.certificate_chain_dep.expiration.minutes = 34; + + test_msg.certificate_chain_dep.expiration.month = 3; + + test_msg.certificate_chain_dep.expiration.ns = 123456789; + + test_msg.certificate_chain_dep.expiration.seconds = 59; + + test_msg.certificate_chain_dep.expiration.year = 2024; + + test_msg.certificate_chain_dep.intermediate_certificate[0] = 10; + + test_msg.certificate_chain_dep.intermediate_certificate[1] = 11; + + test_msg.certificate_chain_dep.intermediate_certificate[2] = 12; + + test_msg.certificate_chain_dep.intermediate_certificate[3] = 13; + + test_msg.certificate_chain_dep.intermediate_certificate[4] = 14; + + test_msg.certificate_chain_dep.intermediate_certificate[5] = 15; + + test_msg.certificate_chain_dep.intermediate_certificate[6] = 16; + + test_msg.certificate_chain_dep.intermediate_certificate[7] = 17; + + test_msg.certificate_chain_dep.intermediate_certificate[8] = 18; + + test_msg.certificate_chain_dep.intermediate_certificate[9] = 19; + + test_msg.certificate_chain_dep.intermediate_certificate[10] = 0; + + test_msg.certificate_chain_dep.intermediate_certificate[11] = 1; + + test_msg.certificate_chain_dep.intermediate_certificate[12] = 2; + + test_msg.certificate_chain_dep.intermediate_certificate[13] = 3; + + test_msg.certificate_chain_dep.intermediate_certificate[14] = 4; + + test_msg.certificate_chain_dep.intermediate_certificate[15] = 5; + + test_msg.certificate_chain_dep.intermediate_certificate[16] = 6; + + test_msg.certificate_chain_dep.intermediate_certificate[17] = 7; + + test_msg.certificate_chain_dep.intermediate_certificate[18] = 8; + + test_msg.certificate_chain_dep.intermediate_certificate[19] = 9; + + test_msg.certificate_chain_dep.root_certificate[0] = 0; + + test_msg.certificate_chain_dep.root_certificate[1] = 1; + + test_msg.certificate_chain_dep.root_certificate[2] = 2; + + test_msg.certificate_chain_dep.root_certificate[3] = 3; + + test_msg.certificate_chain_dep.root_certificate[4] = 4; + + test_msg.certificate_chain_dep.root_certificate[5] = 5; + + test_msg.certificate_chain_dep.root_certificate[6] = 6; + + test_msg.certificate_chain_dep.root_certificate[7] = 7; + + test_msg.certificate_chain_dep.root_certificate[8] = 8; + + test_msg.certificate_chain_dep.root_certificate[9] = 9; + + test_msg.certificate_chain_dep.root_certificate[10] = 10; + + test_msg.certificate_chain_dep.root_certificate[11] = 11; + + test_msg.certificate_chain_dep.root_certificate[12] = 12; + + test_msg.certificate_chain_dep.root_certificate[13] = 13; + + test_msg.certificate_chain_dep.root_certificate[14] = 14; + + test_msg.certificate_chain_dep.root_certificate[15] = 15; + + test_msg.certificate_chain_dep.root_certificate[16] = 16; + + test_msg.certificate_chain_dep.root_certificate[17] = 17; + + test_msg.certificate_chain_dep.root_certificate[18] = 18; + + test_msg.certificate_chain_dep.root_certificate[19] = 19; + + test_msg.certificate_chain_dep.signature[0] = 0; + + test_msg.certificate_chain_dep.signature[1] = 1; + + test_msg.certificate_chain_dep.signature[2] = 2; + + test_msg.certificate_chain_dep.signature[3] = 3; + + test_msg.certificate_chain_dep.signature[4] = 4; + + test_msg.certificate_chain_dep.signature[5] = 5; + + test_msg.certificate_chain_dep.signature[6] = 6; + + test_msg.certificate_chain_dep.signature[7] = 7; + + test_msg.certificate_chain_dep.signature[8] = 0; + + test_msg.certificate_chain_dep.signature[9] = 1; + + test_msg.certificate_chain_dep.signature[10] = 2; + + test_msg.certificate_chain_dep.signature[11] = 3; + + test_msg.certificate_chain_dep.signature[12] = 4; + + test_msg.certificate_chain_dep.signature[13] = 5; + + test_msg.certificate_chain_dep.signature[14] = 6; + + test_msg.certificate_chain_dep.signature[15] = 7; + + test_msg.certificate_chain_dep.signature[16] = 0; + + test_msg.certificate_chain_dep.signature[17] = 1; + + test_msg.certificate_chain_dep.signature[18] = 2; + + test_msg.certificate_chain_dep.signature[19] = 3; + + test_msg.certificate_chain_dep.signature[20] = 4; + + test_msg.certificate_chain_dep.signature[21] = 5; + + test_msg.certificate_chain_dep.signature[22] = 6; + + test_msg.certificate_chain_dep.signature[23] = 7; + + test_msg.certificate_chain_dep.signature[24] = 0; + + test_msg.certificate_chain_dep.signature[25] = 1; + + test_msg.certificate_chain_dep.signature[26] = 2; + + test_msg.certificate_chain_dep.signature[27] = 3; + + test_msg.certificate_chain_dep.signature[28] = 4; + + test_msg.certificate_chain_dep.signature[29] = 5; + + test_msg.certificate_chain_dep.signature[30] = 6; + + test_msg.certificate_chain_dep.signature[31] = 7; + + test_msg.certificate_chain_dep.signature[32] = 0; + + test_msg.certificate_chain_dep.signature[33] = 1; + + test_msg.certificate_chain_dep.signature[34] = 2; + + test_msg.certificate_chain_dep.signature[35] = 3; + + test_msg.certificate_chain_dep.signature[36] = 4; + + test_msg.certificate_chain_dep.signature[37] = 5; + + test_msg.certificate_chain_dep.signature[38] = 6; + + test_msg.certificate_chain_dep.signature[39] = 7; + + test_msg.certificate_chain_dep.signature[40] = 0; + + test_msg.certificate_chain_dep.signature[41] = 1; + + test_msg.certificate_chain_dep.signature[42] = 2; + + test_msg.certificate_chain_dep.signature[43] = 3; + + test_msg.certificate_chain_dep.signature[44] = 4; + + test_msg.certificate_chain_dep.signature[45] = 5; + + test_msg.certificate_chain_dep.signature[46] = 6; + + test_msg.certificate_chain_dep.signature[47] = 7; + + test_msg.certificate_chain_dep.signature[48] = 0; + + test_msg.certificate_chain_dep.signature[49] = 1; + + test_msg.certificate_chain_dep.signature[50] = 2; + + test_msg.certificate_chain_dep.signature[51] = 3; + + test_msg.certificate_chain_dep.signature[52] = 4; + + test_msg.certificate_chain_dep.signature[53] = 5; + + test_msg.certificate_chain_dep.signature[54] = 6; + + test_msg.certificate_chain_dep.signature[55] = 7; + + test_msg.certificate_chain_dep.signature[56] = 0; + + test_msg.certificate_chain_dep.signature[57] = 1; + + test_msg.certificate_chain_dep.signature[58] = 2; + + test_msg.certificate_chain_dep.signature[59] = 3; + + test_msg.certificate_chain_dep.signature[60] = 4; + + test_msg.certificate_chain_dep.signature[61] = 5; + + test_msg.certificate_chain_dep.signature[62] = 6; + + test_msg.certificate_chain_dep.signature[63] = 7; + + sbp_message_send(&sbp_state, SbpMsgCertificateChainDep, 66, &test_msg, + &dummy_write); + + ck_assert_msg(dummy_wr == sizeof(encoded_frame), + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); + ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, + "frame was not encoded properly"); + + while (dummy_rd < dummy_wr) { + ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, + "sbp_process threw an error!"); + } + + ck_assert_msg(last_msg.n_callbacks_logged == 1, + "msg_callback: one callback should have been logged"); + ck_assert_msg(last_msg.sender_id == 66, + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgCertificateChainDep, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[0] == 20, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[0], " + "expected 20, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[1] == 21, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[1], " + "expected 21, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[2] == 22, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[2], " + "expected 22, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[3] == 23, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[3], " + "expected 23, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[4] == 24, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[4], " + "expected 24, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[5] == 25, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[5], " + "expected 25, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[6] == 26, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[6], " + "expected 26, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[7] == 27, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[7], " + "expected 27, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[8] == 28, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[8], " + "expected 28, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[9] == 29, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[9], " + "expected 29, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[10], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[11], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[12], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[13], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[14], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[15], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[16], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[17], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[18], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.corrections_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.corrections_certificate[19], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.corrections_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.expiration.day == 30, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.day, expected 30, is %d", + last_msg.msg.certificate_chain_dep.expiration.day); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.hours == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.hours, " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.expiration.hours); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.minutes == 34, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.minutes, " + "expected 34, is %d", + last_msg.msg.certificate_chain_dep.expiration.minutes); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.month == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.month, " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.expiration.month); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.expiration.ns == 123456789, + "incorrect value for last_msg.msg.certificate_chain_dep.expiration.ns, " + "expected 123456789, is %d", + last_msg.msg.certificate_chain_dep.expiration.ns); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.seconds == 59, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.seconds, " + "expected 59, is %d", + last_msg.msg.certificate_chain_dep.expiration.seconds); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.expiration.year == 2024, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.expiration.year, " + "expected 2024, is %d", + last_msg.msg.certificate_chain_dep.expiration.year); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[0] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[0], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[1] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[1], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[2] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[2], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[3] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[3], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[4] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[4], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[5] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[5], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[6] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[6], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[7] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[7], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[8] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[8], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[9] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[9], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[10] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[10], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[11] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[11], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[12] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[12], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[13] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[13], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[14] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[14], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[15] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[15], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[16] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[16], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[17] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[17], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[18] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[18], " + "expected 8, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.intermediate_certificate[19] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.intermediate_certificate[19], " + "expected 9, is %d", + last_msg.msg.certificate_chain_dep.intermediate_certificate[19]); + + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[0] == 0, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[0], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[0]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[1] == 1, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[1], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[1]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[2] == 2, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[2], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[2]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[3] == 3, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[3], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[3]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[4] == 4, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[4], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[4]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[5] == 5, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[5], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[5]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[6] == 6, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[6], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[6]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[7] == 7, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[7], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[7]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[8] == 8, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[8], " + "expected 8, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[8]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[9] == 9, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[9], " + "expected 9, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[9]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[10] == 10, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[10], " + "expected 10, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[10]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[11] == 11, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[11], " + "expected 11, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[11]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[12] == 12, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[12], " + "expected 12, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[12]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[13] == 13, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[13], " + "expected 13, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[13]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[14] == 14, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[14], " + "expected 14, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[14]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[15] == 15, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[15], " + "expected 15, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[15]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[16] == 16, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[16], " + "expected 16, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[16]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[17] == 17, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[17], " + "expected 17, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[17]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[18] == 18, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[18], " + "expected 18, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[18]); + ck_assert_msg(last_msg.msg.certificate_chain_dep.root_certificate[19] == 19, + "incorrect value for " + "last_msg.msg.certificate_chain_dep.root_certificate[19], " + "expected 19, is %d", + last_msg.msg.certificate_chain_dep.root_certificate[19]); + + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[0] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[0], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[0]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[1] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[1], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[1]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[2] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[2], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[2]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[3] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[3], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[3]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[4] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[4], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[4]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[5] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[5], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[5]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[6] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[6], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[6]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[7] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[7], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[7]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[8] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[8], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[8]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[9] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[9], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[9]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[10] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[10], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[10]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[11] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[11], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[11]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[12] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[12], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[12]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[13] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[13], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[13]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[14] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[14], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[14]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[15] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[15], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[15]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[16] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[16], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[16]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[17] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[17], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[17]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[18] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[18], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[18]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[19] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[19], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[19]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[20] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[20], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[20]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[21] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[21], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[21]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[22] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[22], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[22]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[23] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[23], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[23]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[24] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[24], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[24]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[25] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[25], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[25]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[26] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[26], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[26]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[27] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[27], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[27]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[28] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[28], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[28]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[29] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[29], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[29]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[30] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[30], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[30]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[31] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[31], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[31]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[32] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[32], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[32]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[33] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[33], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[33]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[34] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[34], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[34]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[35] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[35], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[35]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[36] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[36], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[36]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[37] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[37], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[37]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[38] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[38], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[38]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[39] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[39], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[39]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[40] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[40], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[40]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[41] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[41], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[41]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[42] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[42], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[42]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[43] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[43], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[43]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[44] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[44], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[44]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[45] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[45], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[45]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[46] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[46], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[46]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[47] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[47], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[47]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[48] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[48], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[48]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[49] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[49], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[49]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[50] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[50], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[50]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[51] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[51], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[51]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[52] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[52], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[52]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[53] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[53], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[53]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[54] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[54], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[54]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[55] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[55], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[55]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[56] == 0, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[56], " + "expected 0, is %d", + last_msg.msg.certificate_chain_dep.signature[56]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[57] == 1, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[57], " + "expected 1, is %d", + last_msg.msg.certificate_chain_dep.signature[57]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[58] == 2, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[58], " + "expected 2, is %d", + last_msg.msg.certificate_chain_dep.signature[58]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[59] == 3, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[59], " + "expected 3, is %d", + last_msg.msg.certificate_chain_dep.signature[59]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[60] == 4, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[60], " + "expected 4, is %d", + last_msg.msg.certificate_chain_dep.signature[60]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[61] == 5, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[61], " + "expected 5, is %d", + last_msg.msg.certificate_chain_dep.signature[61]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[62] == 6, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[62], " + "expected 6, is %d", + last_msg.msg.certificate_chain_dep.signature[62]); + ck_assert_msg( + last_msg.msg.certificate_chain_dep.signature[63] == 7, + "incorrect value for last_msg.msg.certificate_chain_dep.signature[63], " + "expected 7, is %d", + last_msg.msg.certificate_chain_dep.signature[63]); + } +} +END_TEST + +Suite *auto_check_sbp_signing_MsgCertificateChainDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "auto_check_sbp_signing_MsgCertificateChainDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgCertificateChainDep"); + tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgCertificateChainDep); + suite_add_tcase(s, tc_acq); + return s; +} \ No newline at end of file diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c index c97bcc6258..813bc85c54 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c @@ -90,16 +90,16 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { logging_reset(); - sbp_callback_register(&sbp_state, 0xC07, &msg_callback, + sbp_callback_register(&sbp_state, 0xC08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); u8 encoded_frame[] = { - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, }; dummy_reset(); @@ -117,155 +117,153 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { test_msg.ecdsa_signature.flags = 0; - test_msg.ecdsa_signature.n_signature_bytes = 72; - - test_msg.ecdsa_signature.n_signed_messages = 3; - test_msg.ecdsa_signature.on_demand_counter = 2; - test_msg.ecdsa_signature.signature[0] = 0; + test_msg.ecdsa_signature.signature.data[0] = 0; + + test_msg.ecdsa_signature.signature.data[1] = 1; - test_msg.ecdsa_signature.signature[1] = 1; + test_msg.ecdsa_signature.signature.data[2] = 2; - test_msg.ecdsa_signature.signature[2] = 2; + test_msg.ecdsa_signature.signature.data[3] = 3; - test_msg.ecdsa_signature.signature[3] = 3; + test_msg.ecdsa_signature.signature.data[4] = 4; - test_msg.ecdsa_signature.signature[4] = 4; + test_msg.ecdsa_signature.signature.data[5] = 5; - test_msg.ecdsa_signature.signature[5] = 5; + test_msg.ecdsa_signature.signature.data[6] = 6; - test_msg.ecdsa_signature.signature[6] = 6; + test_msg.ecdsa_signature.signature.data[7] = 7; - test_msg.ecdsa_signature.signature[7] = 7; + test_msg.ecdsa_signature.signature.data[8] = 8; - test_msg.ecdsa_signature.signature[8] = 8; + test_msg.ecdsa_signature.signature.data[9] = 9; - test_msg.ecdsa_signature.signature[9] = 9; + test_msg.ecdsa_signature.signature.data[10] = 10; - test_msg.ecdsa_signature.signature[10] = 10; + test_msg.ecdsa_signature.signature.data[11] = 11; - test_msg.ecdsa_signature.signature[11] = 11; + test_msg.ecdsa_signature.signature.data[12] = 12; - test_msg.ecdsa_signature.signature[12] = 12; + test_msg.ecdsa_signature.signature.data[13] = 13; - test_msg.ecdsa_signature.signature[13] = 13; + test_msg.ecdsa_signature.signature.data[14] = 14; - test_msg.ecdsa_signature.signature[14] = 14; + test_msg.ecdsa_signature.signature.data[15] = 15; - test_msg.ecdsa_signature.signature[15] = 15; + test_msg.ecdsa_signature.signature.data[16] = 16; - test_msg.ecdsa_signature.signature[16] = 16; + test_msg.ecdsa_signature.signature.data[17] = 17; - test_msg.ecdsa_signature.signature[17] = 17; + test_msg.ecdsa_signature.signature.data[18] = 18; - test_msg.ecdsa_signature.signature[18] = 18; + test_msg.ecdsa_signature.signature.data[19] = 19; - test_msg.ecdsa_signature.signature[19] = 19; + test_msg.ecdsa_signature.signature.data[20] = 20; - test_msg.ecdsa_signature.signature[20] = 20; + test_msg.ecdsa_signature.signature.data[21] = 21; - test_msg.ecdsa_signature.signature[21] = 21; + test_msg.ecdsa_signature.signature.data[22] = 22; - test_msg.ecdsa_signature.signature[22] = 22; + test_msg.ecdsa_signature.signature.data[23] = 23; - test_msg.ecdsa_signature.signature[23] = 23; + test_msg.ecdsa_signature.signature.data[24] = 24; - test_msg.ecdsa_signature.signature[24] = 24; + test_msg.ecdsa_signature.signature.data[25] = 25; - test_msg.ecdsa_signature.signature[25] = 25; + test_msg.ecdsa_signature.signature.data[26] = 26; - test_msg.ecdsa_signature.signature[26] = 26; + test_msg.ecdsa_signature.signature.data[27] = 27; - test_msg.ecdsa_signature.signature[27] = 27; + test_msg.ecdsa_signature.signature.data[28] = 28; - test_msg.ecdsa_signature.signature[28] = 28; + test_msg.ecdsa_signature.signature.data[29] = 29; - test_msg.ecdsa_signature.signature[29] = 29; + test_msg.ecdsa_signature.signature.data[30] = 30; - test_msg.ecdsa_signature.signature[30] = 30; + test_msg.ecdsa_signature.signature.data[31] = 31; - test_msg.ecdsa_signature.signature[31] = 31; + test_msg.ecdsa_signature.signature.data[32] = 32; - test_msg.ecdsa_signature.signature[32] = 32; + test_msg.ecdsa_signature.signature.data[33] = 33; - test_msg.ecdsa_signature.signature[33] = 33; + test_msg.ecdsa_signature.signature.data[34] = 34; - test_msg.ecdsa_signature.signature[34] = 34; + test_msg.ecdsa_signature.signature.data[35] = 35; - test_msg.ecdsa_signature.signature[35] = 35; + test_msg.ecdsa_signature.signature.data[36] = 36; - test_msg.ecdsa_signature.signature[36] = 36; + test_msg.ecdsa_signature.signature.data[37] = 37; - test_msg.ecdsa_signature.signature[37] = 37; + test_msg.ecdsa_signature.signature.data[38] = 38; - test_msg.ecdsa_signature.signature[38] = 38; + test_msg.ecdsa_signature.signature.data[39] = 39; - test_msg.ecdsa_signature.signature[39] = 39; + test_msg.ecdsa_signature.signature.data[40] = 40; - test_msg.ecdsa_signature.signature[40] = 40; + test_msg.ecdsa_signature.signature.data[41] = 41; - test_msg.ecdsa_signature.signature[41] = 41; + test_msg.ecdsa_signature.signature.data[42] = 42; - test_msg.ecdsa_signature.signature[42] = 42; + test_msg.ecdsa_signature.signature.data[43] = 43; - test_msg.ecdsa_signature.signature[43] = 43; + test_msg.ecdsa_signature.signature.data[44] = 44; - test_msg.ecdsa_signature.signature[44] = 44; + test_msg.ecdsa_signature.signature.data[45] = 45; - test_msg.ecdsa_signature.signature[45] = 45; + test_msg.ecdsa_signature.signature.data[46] = 46; - test_msg.ecdsa_signature.signature[46] = 46; + test_msg.ecdsa_signature.signature.data[47] = 47; - test_msg.ecdsa_signature.signature[47] = 47; + test_msg.ecdsa_signature.signature.data[48] = 48; - test_msg.ecdsa_signature.signature[48] = 48; + test_msg.ecdsa_signature.signature.data[49] = 49; - test_msg.ecdsa_signature.signature[49] = 49; + test_msg.ecdsa_signature.signature.data[50] = 50; - test_msg.ecdsa_signature.signature[50] = 50; + test_msg.ecdsa_signature.signature.data[51] = 51; - test_msg.ecdsa_signature.signature[51] = 51; + test_msg.ecdsa_signature.signature.data[52] = 52; - test_msg.ecdsa_signature.signature[52] = 52; + test_msg.ecdsa_signature.signature.data[53] = 53; - test_msg.ecdsa_signature.signature[53] = 53; + test_msg.ecdsa_signature.signature.data[54] = 54; - test_msg.ecdsa_signature.signature[54] = 54; + test_msg.ecdsa_signature.signature.data[55] = 55; - test_msg.ecdsa_signature.signature[55] = 55; + test_msg.ecdsa_signature.signature.data[56] = 56; - test_msg.ecdsa_signature.signature[56] = 56; + test_msg.ecdsa_signature.signature.data[57] = 57; - test_msg.ecdsa_signature.signature[57] = 57; + test_msg.ecdsa_signature.signature.data[58] = 58; - test_msg.ecdsa_signature.signature[58] = 58; + test_msg.ecdsa_signature.signature.data[59] = 59; - test_msg.ecdsa_signature.signature[59] = 59; + test_msg.ecdsa_signature.signature.data[60] = 60; - test_msg.ecdsa_signature.signature[60] = 60; + test_msg.ecdsa_signature.signature.data[61] = 61; - test_msg.ecdsa_signature.signature[61] = 61; + test_msg.ecdsa_signature.signature.data[62] = 62; - test_msg.ecdsa_signature.signature[62] = 62; + test_msg.ecdsa_signature.signature.data[63] = 63; - test_msg.ecdsa_signature.signature[63] = 63; + test_msg.ecdsa_signature.signature.data[64] = 64; - test_msg.ecdsa_signature.signature[64] = 64; + test_msg.ecdsa_signature.signature.data[65] = 65; - test_msg.ecdsa_signature.signature[65] = 65; + test_msg.ecdsa_signature.signature.data[66] = 66; - test_msg.ecdsa_signature.signature[66] = 66; + test_msg.ecdsa_signature.signature.data[67] = 67; - test_msg.ecdsa_signature.signature[67] = 67; + test_msg.ecdsa_signature.signature.data[68] = 68; - test_msg.ecdsa_signature.signature[68] = 68; + test_msg.ecdsa_signature.signature.data[69] = 69; - test_msg.ecdsa_signature.signature[69] = 69; + test_msg.ecdsa_signature.signature.data[70] = 70; - test_msg.ecdsa_signature.signature[70] = 70; + test_msg.ecdsa_signature.signature.data[71] = 71; - test_msg.ecdsa_signature.signature[71] = 71; + test_msg.ecdsa_signature.signature.len = 72; test_msg.ecdsa_signature.signed_messages[0] = 10; @@ -325,18 +323,6 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { "expected 0, is %d", last_msg.msg.ecdsa_signature.flags); - ck_assert_msg( - last_msg.msg.ecdsa_signature.n_signature_bytes == 72, - "incorrect value for last_msg.msg.ecdsa_signature.n_signature_bytes, " - "expected 72, is %d", - last_msg.msg.ecdsa_signature.n_signature_bytes); - - ck_assert_msg( - last_msg.msg.ecdsa_signature.n_signed_messages == 3, - "incorrect value for last_msg.msg.ecdsa_signature.n_signed_messages, " - "expected 3, is %d", - last_msg.msg.ecdsa_signature.n_signed_messages); - ck_assert_msg( last_msg.msg.ecdsa_signature.on_demand_counter == 2, "incorrect value for last_msg.msg.ecdsa_signature.on_demand_counter, " @@ -344,365 +330,371 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { last_msg.msg.ecdsa_signature.on_demand_counter); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[0] == 0, - "incorrect value for last_msg.msg.ecdsa_signature.signature[0], " + last_msg.msg.ecdsa_signature.signature.data[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[0], " "expected 0, is %d", - last_msg.msg.ecdsa_signature.signature[0]); + last_msg.msg.ecdsa_signature.signature.data[0]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[1] == 1, - "incorrect value for last_msg.msg.ecdsa_signature.signature[1], " + last_msg.msg.ecdsa_signature.signature.data[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[1], " "expected 1, is %d", - last_msg.msg.ecdsa_signature.signature[1]); + last_msg.msg.ecdsa_signature.signature.data[1]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[2] == 2, - "incorrect value for last_msg.msg.ecdsa_signature.signature[2], " + last_msg.msg.ecdsa_signature.signature.data[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[2], " "expected 2, is %d", - last_msg.msg.ecdsa_signature.signature[2]); + last_msg.msg.ecdsa_signature.signature.data[2]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[3] == 3, - "incorrect value for last_msg.msg.ecdsa_signature.signature[3], " + last_msg.msg.ecdsa_signature.signature.data[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[3], " "expected 3, is %d", - last_msg.msg.ecdsa_signature.signature[3]); + last_msg.msg.ecdsa_signature.signature.data[3]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[4] == 4, - "incorrect value for last_msg.msg.ecdsa_signature.signature[4], " + last_msg.msg.ecdsa_signature.signature.data[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[4], " "expected 4, is %d", - last_msg.msg.ecdsa_signature.signature[4]); + last_msg.msg.ecdsa_signature.signature.data[4]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[5] == 5, - "incorrect value for last_msg.msg.ecdsa_signature.signature[5], " + last_msg.msg.ecdsa_signature.signature.data[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[5], " "expected 5, is %d", - last_msg.msg.ecdsa_signature.signature[5]); + last_msg.msg.ecdsa_signature.signature.data[5]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[6] == 6, - "incorrect value for last_msg.msg.ecdsa_signature.signature[6], " + last_msg.msg.ecdsa_signature.signature.data[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[6], " "expected 6, is %d", - last_msg.msg.ecdsa_signature.signature[6]); + last_msg.msg.ecdsa_signature.signature.data[6]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[7] == 7, - "incorrect value for last_msg.msg.ecdsa_signature.signature[7], " + last_msg.msg.ecdsa_signature.signature.data[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[7], " "expected 7, is %d", - last_msg.msg.ecdsa_signature.signature[7]); + last_msg.msg.ecdsa_signature.signature.data[7]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[8] == 8, - "incorrect value for last_msg.msg.ecdsa_signature.signature[8], " + last_msg.msg.ecdsa_signature.signature.data[8] == 8, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[8], " "expected 8, is %d", - last_msg.msg.ecdsa_signature.signature[8]); + last_msg.msg.ecdsa_signature.signature.data[8]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[9] == 9, - "incorrect value for last_msg.msg.ecdsa_signature.signature[9], " + last_msg.msg.ecdsa_signature.signature.data[9] == 9, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[9], " "expected 9, is %d", - last_msg.msg.ecdsa_signature.signature[9]); + last_msg.msg.ecdsa_signature.signature.data[9]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[10] == 10, - "incorrect value for last_msg.msg.ecdsa_signature.signature[10], " + last_msg.msg.ecdsa_signature.signature.data[10] == 10, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[10], " "expected 10, is %d", - last_msg.msg.ecdsa_signature.signature[10]); + last_msg.msg.ecdsa_signature.signature.data[10]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[11] == 11, - "incorrect value for last_msg.msg.ecdsa_signature.signature[11], " + last_msg.msg.ecdsa_signature.signature.data[11] == 11, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[11], " "expected 11, is %d", - last_msg.msg.ecdsa_signature.signature[11]); + last_msg.msg.ecdsa_signature.signature.data[11]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[12] == 12, - "incorrect value for last_msg.msg.ecdsa_signature.signature[12], " + last_msg.msg.ecdsa_signature.signature.data[12] == 12, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[12], " "expected 12, is %d", - last_msg.msg.ecdsa_signature.signature[12]); + last_msg.msg.ecdsa_signature.signature.data[12]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[13] == 13, - "incorrect value for last_msg.msg.ecdsa_signature.signature[13], " + last_msg.msg.ecdsa_signature.signature.data[13] == 13, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[13], " "expected 13, is %d", - last_msg.msg.ecdsa_signature.signature[13]); + last_msg.msg.ecdsa_signature.signature.data[13]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[14] == 14, - "incorrect value for last_msg.msg.ecdsa_signature.signature[14], " + last_msg.msg.ecdsa_signature.signature.data[14] == 14, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[14], " "expected 14, is %d", - last_msg.msg.ecdsa_signature.signature[14]); + last_msg.msg.ecdsa_signature.signature.data[14]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[15] == 15, - "incorrect value for last_msg.msg.ecdsa_signature.signature[15], " + last_msg.msg.ecdsa_signature.signature.data[15] == 15, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[15], " "expected 15, is %d", - last_msg.msg.ecdsa_signature.signature[15]); + last_msg.msg.ecdsa_signature.signature.data[15]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[16] == 16, - "incorrect value for last_msg.msg.ecdsa_signature.signature[16], " + last_msg.msg.ecdsa_signature.signature.data[16] == 16, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[16], " "expected 16, is %d", - last_msg.msg.ecdsa_signature.signature[16]); + last_msg.msg.ecdsa_signature.signature.data[16]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[17] == 17, - "incorrect value for last_msg.msg.ecdsa_signature.signature[17], " + last_msg.msg.ecdsa_signature.signature.data[17] == 17, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[17], " "expected 17, is %d", - last_msg.msg.ecdsa_signature.signature[17]); + last_msg.msg.ecdsa_signature.signature.data[17]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[18] == 18, - "incorrect value for last_msg.msg.ecdsa_signature.signature[18], " + last_msg.msg.ecdsa_signature.signature.data[18] == 18, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[18], " "expected 18, is %d", - last_msg.msg.ecdsa_signature.signature[18]); + last_msg.msg.ecdsa_signature.signature.data[18]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[19] == 19, - "incorrect value for last_msg.msg.ecdsa_signature.signature[19], " + last_msg.msg.ecdsa_signature.signature.data[19] == 19, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[19], " "expected 19, is %d", - last_msg.msg.ecdsa_signature.signature[19]); + last_msg.msg.ecdsa_signature.signature.data[19]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[20] == 20, - "incorrect value for last_msg.msg.ecdsa_signature.signature[20], " + last_msg.msg.ecdsa_signature.signature.data[20] == 20, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[20], " "expected 20, is %d", - last_msg.msg.ecdsa_signature.signature[20]); + last_msg.msg.ecdsa_signature.signature.data[20]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[21] == 21, - "incorrect value for last_msg.msg.ecdsa_signature.signature[21], " + last_msg.msg.ecdsa_signature.signature.data[21] == 21, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[21], " "expected 21, is %d", - last_msg.msg.ecdsa_signature.signature[21]); + last_msg.msg.ecdsa_signature.signature.data[21]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[22] == 22, - "incorrect value for last_msg.msg.ecdsa_signature.signature[22], " + last_msg.msg.ecdsa_signature.signature.data[22] == 22, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[22], " "expected 22, is %d", - last_msg.msg.ecdsa_signature.signature[22]); + last_msg.msg.ecdsa_signature.signature.data[22]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[23] == 23, - "incorrect value for last_msg.msg.ecdsa_signature.signature[23], " + last_msg.msg.ecdsa_signature.signature.data[23] == 23, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[23], " "expected 23, is %d", - last_msg.msg.ecdsa_signature.signature[23]); + last_msg.msg.ecdsa_signature.signature.data[23]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[24] == 24, - "incorrect value for last_msg.msg.ecdsa_signature.signature[24], " + last_msg.msg.ecdsa_signature.signature.data[24] == 24, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[24], " "expected 24, is %d", - last_msg.msg.ecdsa_signature.signature[24]); + last_msg.msg.ecdsa_signature.signature.data[24]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[25] == 25, - "incorrect value for last_msg.msg.ecdsa_signature.signature[25], " + last_msg.msg.ecdsa_signature.signature.data[25] == 25, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[25], " "expected 25, is %d", - last_msg.msg.ecdsa_signature.signature[25]); + last_msg.msg.ecdsa_signature.signature.data[25]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[26] == 26, - "incorrect value for last_msg.msg.ecdsa_signature.signature[26], " + last_msg.msg.ecdsa_signature.signature.data[26] == 26, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[26], " "expected 26, is %d", - last_msg.msg.ecdsa_signature.signature[26]); + last_msg.msg.ecdsa_signature.signature.data[26]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[27] == 27, - "incorrect value for last_msg.msg.ecdsa_signature.signature[27], " + last_msg.msg.ecdsa_signature.signature.data[27] == 27, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[27], " "expected 27, is %d", - last_msg.msg.ecdsa_signature.signature[27]); + last_msg.msg.ecdsa_signature.signature.data[27]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[28] == 28, - "incorrect value for last_msg.msg.ecdsa_signature.signature[28], " + last_msg.msg.ecdsa_signature.signature.data[28] == 28, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[28], " "expected 28, is %d", - last_msg.msg.ecdsa_signature.signature[28]); + last_msg.msg.ecdsa_signature.signature.data[28]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[29] == 29, - "incorrect value for last_msg.msg.ecdsa_signature.signature[29], " + last_msg.msg.ecdsa_signature.signature.data[29] == 29, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[29], " "expected 29, is %d", - last_msg.msg.ecdsa_signature.signature[29]); + last_msg.msg.ecdsa_signature.signature.data[29]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[30] == 30, - "incorrect value for last_msg.msg.ecdsa_signature.signature[30], " + last_msg.msg.ecdsa_signature.signature.data[30] == 30, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[30], " "expected 30, is %d", - last_msg.msg.ecdsa_signature.signature[30]); + last_msg.msg.ecdsa_signature.signature.data[30]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[31] == 31, - "incorrect value for last_msg.msg.ecdsa_signature.signature[31], " + last_msg.msg.ecdsa_signature.signature.data[31] == 31, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[31], " "expected 31, is %d", - last_msg.msg.ecdsa_signature.signature[31]); + last_msg.msg.ecdsa_signature.signature.data[31]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[32] == 32, - "incorrect value for last_msg.msg.ecdsa_signature.signature[32], " + last_msg.msg.ecdsa_signature.signature.data[32] == 32, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[32], " "expected 32, is %d", - last_msg.msg.ecdsa_signature.signature[32]); + last_msg.msg.ecdsa_signature.signature.data[32]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[33] == 33, - "incorrect value for last_msg.msg.ecdsa_signature.signature[33], " + last_msg.msg.ecdsa_signature.signature.data[33] == 33, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[33], " "expected 33, is %d", - last_msg.msg.ecdsa_signature.signature[33]); + last_msg.msg.ecdsa_signature.signature.data[33]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[34] == 34, - "incorrect value for last_msg.msg.ecdsa_signature.signature[34], " + last_msg.msg.ecdsa_signature.signature.data[34] == 34, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[34], " "expected 34, is %d", - last_msg.msg.ecdsa_signature.signature[34]); + last_msg.msg.ecdsa_signature.signature.data[34]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[35] == 35, - "incorrect value for last_msg.msg.ecdsa_signature.signature[35], " + last_msg.msg.ecdsa_signature.signature.data[35] == 35, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[35], " "expected 35, is %d", - last_msg.msg.ecdsa_signature.signature[35]); + last_msg.msg.ecdsa_signature.signature.data[35]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[36] == 36, - "incorrect value for last_msg.msg.ecdsa_signature.signature[36], " + last_msg.msg.ecdsa_signature.signature.data[36] == 36, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[36], " "expected 36, is %d", - last_msg.msg.ecdsa_signature.signature[36]); + last_msg.msg.ecdsa_signature.signature.data[36]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[37] == 37, - "incorrect value for last_msg.msg.ecdsa_signature.signature[37], " + last_msg.msg.ecdsa_signature.signature.data[37] == 37, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[37], " "expected 37, is %d", - last_msg.msg.ecdsa_signature.signature[37]); + last_msg.msg.ecdsa_signature.signature.data[37]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[38] == 38, - "incorrect value for last_msg.msg.ecdsa_signature.signature[38], " + last_msg.msg.ecdsa_signature.signature.data[38] == 38, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[38], " "expected 38, is %d", - last_msg.msg.ecdsa_signature.signature[38]); + last_msg.msg.ecdsa_signature.signature.data[38]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[39] == 39, - "incorrect value for last_msg.msg.ecdsa_signature.signature[39], " + last_msg.msg.ecdsa_signature.signature.data[39] == 39, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[39], " "expected 39, is %d", - last_msg.msg.ecdsa_signature.signature[39]); + last_msg.msg.ecdsa_signature.signature.data[39]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[40] == 40, - "incorrect value for last_msg.msg.ecdsa_signature.signature[40], " + last_msg.msg.ecdsa_signature.signature.data[40] == 40, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[40], " "expected 40, is %d", - last_msg.msg.ecdsa_signature.signature[40]); + last_msg.msg.ecdsa_signature.signature.data[40]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[41] == 41, - "incorrect value for last_msg.msg.ecdsa_signature.signature[41], " + last_msg.msg.ecdsa_signature.signature.data[41] == 41, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[41], " "expected 41, is %d", - last_msg.msg.ecdsa_signature.signature[41]); + last_msg.msg.ecdsa_signature.signature.data[41]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[42] == 42, - "incorrect value for last_msg.msg.ecdsa_signature.signature[42], " + last_msg.msg.ecdsa_signature.signature.data[42] == 42, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[42], " "expected 42, is %d", - last_msg.msg.ecdsa_signature.signature[42]); + last_msg.msg.ecdsa_signature.signature.data[42]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[43] == 43, - "incorrect value for last_msg.msg.ecdsa_signature.signature[43], " + last_msg.msg.ecdsa_signature.signature.data[43] == 43, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[43], " "expected 43, is %d", - last_msg.msg.ecdsa_signature.signature[43]); + last_msg.msg.ecdsa_signature.signature.data[43]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[44] == 44, - "incorrect value for last_msg.msg.ecdsa_signature.signature[44], " + last_msg.msg.ecdsa_signature.signature.data[44] == 44, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[44], " "expected 44, is %d", - last_msg.msg.ecdsa_signature.signature[44]); + last_msg.msg.ecdsa_signature.signature.data[44]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[45] == 45, - "incorrect value for last_msg.msg.ecdsa_signature.signature[45], " + last_msg.msg.ecdsa_signature.signature.data[45] == 45, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[45], " "expected 45, is %d", - last_msg.msg.ecdsa_signature.signature[45]); + last_msg.msg.ecdsa_signature.signature.data[45]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[46] == 46, - "incorrect value for last_msg.msg.ecdsa_signature.signature[46], " + last_msg.msg.ecdsa_signature.signature.data[46] == 46, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[46], " "expected 46, is %d", - last_msg.msg.ecdsa_signature.signature[46]); + last_msg.msg.ecdsa_signature.signature.data[46]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[47] == 47, - "incorrect value for last_msg.msg.ecdsa_signature.signature[47], " + last_msg.msg.ecdsa_signature.signature.data[47] == 47, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[47], " "expected 47, is %d", - last_msg.msg.ecdsa_signature.signature[47]); + last_msg.msg.ecdsa_signature.signature.data[47]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[48] == 48, - "incorrect value for last_msg.msg.ecdsa_signature.signature[48], " + last_msg.msg.ecdsa_signature.signature.data[48] == 48, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[48], " "expected 48, is %d", - last_msg.msg.ecdsa_signature.signature[48]); + last_msg.msg.ecdsa_signature.signature.data[48]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[49] == 49, - "incorrect value for last_msg.msg.ecdsa_signature.signature[49], " + last_msg.msg.ecdsa_signature.signature.data[49] == 49, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[49], " "expected 49, is %d", - last_msg.msg.ecdsa_signature.signature[49]); + last_msg.msg.ecdsa_signature.signature.data[49]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[50] == 50, - "incorrect value for last_msg.msg.ecdsa_signature.signature[50], " + last_msg.msg.ecdsa_signature.signature.data[50] == 50, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[50], " "expected 50, is %d", - last_msg.msg.ecdsa_signature.signature[50]); + last_msg.msg.ecdsa_signature.signature.data[50]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[51] == 51, - "incorrect value for last_msg.msg.ecdsa_signature.signature[51], " + last_msg.msg.ecdsa_signature.signature.data[51] == 51, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[51], " "expected 51, is %d", - last_msg.msg.ecdsa_signature.signature[51]); + last_msg.msg.ecdsa_signature.signature.data[51]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[52] == 52, - "incorrect value for last_msg.msg.ecdsa_signature.signature[52], " + last_msg.msg.ecdsa_signature.signature.data[52] == 52, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[52], " "expected 52, is %d", - last_msg.msg.ecdsa_signature.signature[52]); + last_msg.msg.ecdsa_signature.signature.data[52]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[53] == 53, - "incorrect value for last_msg.msg.ecdsa_signature.signature[53], " + last_msg.msg.ecdsa_signature.signature.data[53] == 53, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[53], " "expected 53, is %d", - last_msg.msg.ecdsa_signature.signature[53]); + last_msg.msg.ecdsa_signature.signature.data[53]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[54] == 54, - "incorrect value for last_msg.msg.ecdsa_signature.signature[54], " + last_msg.msg.ecdsa_signature.signature.data[54] == 54, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[54], " "expected 54, is %d", - last_msg.msg.ecdsa_signature.signature[54]); + last_msg.msg.ecdsa_signature.signature.data[54]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[55] == 55, - "incorrect value for last_msg.msg.ecdsa_signature.signature[55], " + last_msg.msg.ecdsa_signature.signature.data[55] == 55, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[55], " "expected 55, is %d", - last_msg.msg.ecdsa_signature.signature[55]); + last_msg.msg.ecdsa_signature.signature.data[55]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[56] == 56, - "incorrect value for last_msg.msg.ecdsa_signature.signature[56], " + last_msg.msg.ecdsa_signature.signature.data[56] == 56, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[56], " "expected 56, is %d", - last_msg.msg.ecdsa_signature.signature[56]); + last_msg.msg.ecdsa_signature.signature.data[56]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[57] == 57, - "incorrect value for last_msg.msg.ecdsa_signature.signature[57], " + last_msg.msg.ecdsa_signature.signature.data[57] == 57, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[57], " "expected 57, is %d", - last_msg.msg.ecdsa_signature.signature[57]); + last_msg.msg.ecdsa_signature.signature.data[57]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[58] == 58, - "incorrect value for last_msg.msg.ecdsa_signature.signature[58], " + last_msg.msg.ecdsa_signature.signature.data[58] == 58, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[58], " "expected 58, is %d", - last_msg.msg.ecdsa_signature.signature[58]); + last_msg.msg.ecdsa_signature.signature.data[58]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[59] == 59, - "incorrect value for last_msg.msg.ecdsa_signature.signature[59], " + last_msg.msg.ecdsa_signature.signature.data[59] == 59, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[59], " "expected 59, is %d", - last_msg.msg.ecdsa_signature.signature[59]); + last_msg.msg.ecdsa_signature.signature.data[59]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[60] == 60, - "incorrect value for last_msg.msg.ecdsa_signature.signature[60], " + last_msg.msg.ecdsa_signature.signature.data[60] == 60, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[60], " "expected 60, is %d", - last_msg.msg.ecdsa_signature.signature[60]); + last_msg.msg.ecdsa_signature.signature.data[60]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[61] == 61, - "incorrect value for last_msg.msg.ecdsa_signature.signature[61], " + last_msg.msg.ecdsa_signature.signature.data[61] == 61, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[61], " "expected 61, is %d", - last_msg.msg.ecdsa_signature.signature[61]); + last_msg.msg.ecdsa_signature.signature.data[61]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[62] == 62, - "incorrect value for last_msg.msg.ecdsa_signature.signature[62], " + last_msg.msg.ecdsa_signature.signature.data[62] == 62, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[62], " "expected 62, is %d", - last_msg.msg.ecdsa_signature.signature[62]); + last_msg.msg.ecdsa_signature.signature.data[62]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[63] == 63, - "incorrect value for last_msg.msg.ecdsa_signature.signature[63], " + last_msg.msg.ecdsa_signature.signature.data[63] == 63, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[63], " "expected 63, is %d", - last_msg.msg.ecdsa_signature.signature[63]); + last_msg.msg.ecdsa_signature.signature.data[63]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[64] == 64, - "incorrect value for last_msg.msg.ecdsa_signature.signature[64], " + last_msg.msg.ecdsa_signature.signature.data[64] == 64, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[64], " "expected 64, is %d", - last_msg.msg.ecdsa_signature.signature[64]); + last_msg.msg.ecdsa_signature.signature.data[64]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[65] == 65, - "incorrect value for last_msg.msg.ecdsa_signature.signature[65], " + last_msg.msg.ecdsa_signature.signature.data[65] == 65, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[65], " "expected 65, is %d", - last_msg.msg.ecdsa_signature.signature[65]); + last_msg.msg.ecdsa_signature.signature.data[65]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[66] == 66, - "incorrect value for last_msg.msg.ecdsa_signature.signature[66], " + last_msg.msg.ecdsa_signature.signature.data[66] == 66, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[66], " "expected 66, is %d", - last_msg.msg.ecdsa_signature.signature[66]); + last_msg.msg.ecdsa_signature.signature.data[66]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[67] == 67, - "incorrect value for last_msg.msg.ecdsa_signature.signature[67], " + last_msg.msg.ecdsa_signature.signature.data[67] == 67, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[67], " "expected 67, is %d", - last_msg.msg.ecdsa_signature.signature[67]); + last_msg.msg.ecdsa_signature.signature.data[67]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[68] == 68, - "incorrect value for last_msg.msg.ecdsa_signature.signature[68], " + last_msg.msg.ecdsa_signature.signature.data[68] == 68, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[68], " "expected 68, is %d", - last_msg.msg.ecdsa_signature.signature[68]); + last_msg.msg.ecdsa_signature.signature.data[68]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[69] == 69, - "incorrect value for last_msg.msg.ecdsa_signature.signature[69], " + last_msg.msg.ecdsa_signature.signature.data[69] == 69, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[69], " "expected 69, is %d", - last_msg.msg.ecdsa_signature.signature[69]); + last_msg.msg.ecdsa_signature.signature.data[69]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[70] == 70, - "incorrect value for last_msg.msg.ecdsa_signature.signature[70], " + last_msg.msg.ecdsa_signature.signature.data[70] == 70, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[70], " "expected 70, is %d", - last_msg.msg.ecdsa_signature.signature[70]); + last_msg.msg.ecdsa_signature.signature.data[70]); ck_assert_msg( - last_msg.msg.ecdsa_signature.signature[71] == 71, - "incorrect value for last_msg.msg.ecdsa_signature.signature[71], " + last_msg.msg.ecdsa_signature.signature.data[71] == 71, + "incorrect value for last_msg.msg.ecdsa_signature.signature.data[71], " "expected 71, is %d", - last_msg.msg.ecdsa_signature.signature[71]); + last_msg.msg.ecdsa_signature.signature.data[71]); + + ck_assert_msg( + last_msg.msg.ecdsa_signature.signature.len == 72, + "incorrect value for last_msg.msg.ecdsa_signature.signature.len, " + "expected 72, is %d", + last_msg.msg.ecdsa_signature.signature.len); ck_assert_msg( last_msg.msg.ecdsa_signature.signed_messages[0] == 10, diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDep.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDep.c deleted file mode 100644 index 8a0c022a0e..0000000000 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDep.c +++ /dev/null @@ -1,1956 +0,0 @@ -/* - * Copyright (C) 2015-2021 Swift Navigation Inc. - * Contact: https://support.swiftnav.com - * - * This source is subject to the license found in the file 'LICENSE' which must - * be be distributed together with this source. All other rights reserved. - * - * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - */ - -// This file was auto-generated from -// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by -// generate.py. Do not modify by hand! - -#include -#include -#include -#include // for debugging -#include // for malloc - -static struct { - u32 n_callbacks_logged; - u16 sender_id; - sbp_msg_type_t msg_type; - sbp_msg_t msg; - void *context; -} last_msg; - -static u32 dummy_wr = 0; -static u32 dummy_rd = 0; -static u8 dummy_buff[1024]; -static void *last_io_context; - -static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; -static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; - -static void dummy_reset() { - dummy_rd = dummy_wr = 0; - memset(dummy_buff, 0, sizeof(dummy_buff)); -} - -static s32 dummy_write(u8 *buff, u32 n, void *context) { - last_io_context = context; - u32 real_n = n; //(dummy_n > n) ? n : dummy_n; - memcpy(dummy_buff + dummy_wr, buff, real_n); - dummy_wr += real_n; - return (s32)real_n; -} - -static s32 dummy_read(u8 *buff, u32 n, void *context) { - last_io_context = context; - u32 real_n = n; //(dummy_n > n) ? n : dummy_n; - memcpy(buff, dummy_buff + dummy_rd, real_n); - dummy_rd += real_n; - return (s32)real_n; -} - -static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } - -static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, - const sbp_msg_t *msg, void *context) { - last_msg.n_callbacks_logged++; - last_msg.sender_id = sender_id; - last_msg.msg_type = msg_type; - last_msg.msg = *msg; - last_msg.context = context; -} - -START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignatureDep) { - static sbp_msg_callbacks_node_t n; - - // State of the SBP message parser. - // Must be statically allocated. - sbp_state_t sbp_state; - - // - // Run tests: - // - // Test successful parsing of a message - { - // SBP parser state must be initialized before sbp_process is called. - // We re-initialize before every test so that callbacks for the same message - // types can be - // allocated multiple times across different tests. - sbp_state_init(&sbp_state); - - sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); - - logging_reset(); - - sbp_callback_register(&sbp_state, 0xC06, &msg_callback, - &DUMMY_MEMORY_FOR_CALLBACKS, &n); - - u8 encoded_frame[] = { - 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, - 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, - 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, - 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, - 1, 2, 3, 4, 5, 6, 7, 10, 21, 23, 63, 140, 37, 130, - 106, 28, 40, 165, 179, 73, 178, 60, 126, 114, 78, 113, 27, 95, - 3, 62, 104, 145, 96, 19, 92, 123, 14, 90, 153, 183, 9, 72, - 81, 118, 112, 124, 16, 182, 76, 146, 115, 58, 144, 17, 105, 66, - 31, 135, 54, 100, 84, 181, 103, 11, 88, 133, 155, 167, 173, 143, - 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, 147, 53, 87, 1, - 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, 30, 110, 156, - 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, 24, 162, - 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, 15, - 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, - 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, - 180, 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, - 57, 34, 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, - 148, 35, 61, 41, 67, 46, 127, 75, 174, 97, 172, - }; - - dummy_reset(); - - sbp_msg_t test_msg; - memset(&test_msg, 0, sizeof(test_msg)); - - test_msg.ecdsa_signature_dep.certificate_id[0] = 1; - - test_msg.ecdsa_signature_dep.certificate_id[1] = 2; - - test_msg.ecdsa_signature_dep.certificate_id[2] = 3; - - test_msg.ecdsa_signature_dep.certificate_id[3] = 4; - - test_msg.ecdsa_signature_dep.flags = 0; - - test_msg.ecdsa_signature_dep.n_signed_messages = 184; - - test_msg.ecdsa_signature_dep.on_demand_counter = 2; - - test_msg.ecdsa_signature_dep.signature[0] = 0; - - test_msg.ecdsa_signature_dep.signature[1] = 1; - - test_msg.ecdsa_signature_dep.signature[2] = 2; - - test_msg.ecdsa_signature_dep.signature[3] = 3; - - test_msg.ecdsa_signature_dep.signature[4] = 4; - - test_msg.ecdsa_signature_dep.signature[5] = 5; - - test_msg.ecdsa_signature_dep.signature[6] = 6; - - test_msg.ecdsa_signature_dep.signature[7] = 7; - - test_msg.ecdsa_signature_dep.signature[8] = 0; - - test_msg.ecdsa_signature_dep.signature[9] = 1; - - test_msg.ecdsa_signature_dep.signature[10] = 2; - - test_msg.ecdsa_signature_dep.signature[11] = 3; - - test_msg.ecdsa_signature_dep.signature[12] = 4; - - test_msg.ecdsa_signature_dep.signature[13] = 5; - - test_msg.ecdsa_signature_dep.signature[14] = 6; - - test_msg.ecdsa_signature_dep.signature[15] = 7; - - test_msg.ecdsa_signature_dep.signature[16] = 0; - - test_msg.ecdsa_signature_dep.signature[17] = 1; - - test_msg.ecdsa_signature_dep.signature[18] = 2; - - test_msg.ecdsa_signature_dep.signature[19] = 3; - - test_msg.ecdsa_signature_dep.signature[20] = 4; - - test_msg.ecdsa_signature_dep.signature[21] = 5; - - test_msg.ecdsa_signature_dep.signature[22] = 6; - - test_msg.ecdsa_signature_dep.signature[23] = 7; - - test_msg.ecdsa_signature_dep.signature[24] = 0; - - test_msg.ecdsa_signature_dep.signature[25] = 1; - - test_msg.ecdsa_signature_dep.signature[26] = 2; - - test_msg.ecdsa_signature_dep.signature[27] = 3; - - test_msg.ecdsa_signature_dep.signature[28] = 4; - - test_msg.ecdsa_signature_dep.signature[29] = 5; - - test_msg.ecdsa_signature_dep.signature[30] = 6; - - test_msg.ecdsa_signature_dep.signature[31] = 7; - - test_msg.ecdsa_signature_dep.signature[32] = 0; - - test_msg.ecdsa_signature_dep.signature[33] = 1; - - test_msg.ecdsa_signature_dep.signature[34] = 2; - - test_msg.ecdsa_signature_dep.signature[35] = 3; - - test_msg.ecdsa_signature_dep.signature[36] = 4; - - test_msg.ecdsa_signature_dep.signature[37] = 5; - - test_msg.ecdsa_signature_dep.signature[38] = 6; - - test_msg.ecdsa_signature_dep.signature[39] = 7; - - test_msg.ecdsa_signature_dep.signature[40] = 0; - - test_msg.ecdsa_signature_dep.signature[41] = 1; - - test_msg.ecdsa_signature_dep.signature[42] = 2; - - test_msg.ecdsa_signature_dep.signature[43] = 3; - - test_msg.ecdsa_signature_dep.signature[44] = 4; - - test_msg.ecdsa_signature_dep.signature[45] = 5; - - test_msg.ecdsa_signature_dep.signature[46] = 6; - - test_msg.ecdsa_signature_dep.signature[47] = 7; - - test_msg.ecdsa_signature_dep.signature[48] = 0; - - test_msg.ecdsa_signature_dep.signature[49] = 1; - - test_msg.ecdsa_signature_dep.signature[50] = 2; - - test_msg.ecdsa_signature_dep.signature[51] = 3; - - test_msg.ecdsa_signature_dep.signature[52] = 4; - - test_msg.ecdsa_signature_dep.signature[53] = 5; - - test_msg.ecdsa_signature_dep.signature[54] = 6; - - test_msg.ecdsa_signature_dep.signature[55] = 7; - - test_msg.ecdsa_signature_dep.signature[56] = 0; - - test_msg.ecdsa_signature_dep.signature[57] = 1; - - test_msg.ecdsa_signature_dep.signature[58] = 2; - - test_msg.ecdsa_signature_dep.signature[59] = 3; - - test_msg.ecdsa_signature_dep.signature[60] = 4; - - test_msg.ecdsa_signature_dep.signature[61] = 5; - - test_msg.ecdsa_signature_dep.signature[62] = 6; - - test_msg.ecdsa_signature_dep.signature[63] = 7; - - test_msg.ecdsa_signature_dep.signed_messages[0] = 10; - - test_msg.ecdsa_signature_dep.signed_messages[1] = 21; - - test_msg.ecdsa_signature_dep.signed_messages[2] = 23; - - test_msg.ecdsa_signature_dep.signed_messages[3] = 63; - - test_msg.ecdsa_signature_dep.signed_messages[4] = 140; - - test_msg.ecdsa_signature_dep.signed_messages[5] = 37; - - test_msg.ecdsa_signature_dep.signed_messages[6] = 130; - - test_msg.ecdsa_signature_dep.signed_messages[7] = 106; - - test_msg.ecdsa_signature_dep.signed_messages[8] = 28; - - test_msg.ecdsa_signature_dep.signed_messages[9] = 40; - - test_msg.ecdsa_signature_dep.signed_messages[10] = 165; - - test_msg.ecdsa_signature_dep.signed_messages[11] = 179; - - test_msg.ecdsa_signature_dep.signed_messages[12] = 73; - - test_msg.ecdsa_signature_dep.signed_messages[13] = 178; - - test_msg.ecdsa_signature_dep.signed_messages[14] = 60; - - test_msg.ecdsa_signature_dep.signed_messages[15] = 126; - - test_msg.ecdsa_signature_dep.signed_messages[16] = 114; - - test_msg.ecdsa_signature_dep.signed_messages[17] = 78; - - test_msg.ecdsa_signature_dep.signed_messages[18] = 113; - - test_msg.ecdsa_signature_dep.signed_messages[19] = 27; - - test_msg.ecdsa_signature_dep.signed_messages[20] = 95; - - test_msg.ecdsa_signature_dep.signed_messages[21] = 3; - - test_msg.ecdsa_signature_dep.signed_messages[22] = 62; - - test_msg.ecdsa_signature_dep.signed_messages[23] = 104; - - test_msg.ecdsa_signature_dep.signed_messages[24] = 145; - - test_msg.ecdsa_signature_dep.signed_messages[25] = 96; - - test_msg.ecdsa_signature_dep.signed_messages[26] = 19; - - test_msg.ecdsa_signature_dep.signed_messages[27] = 92; - - test_msg.ecdsa_signature_dep.signed_messages[28] = 123; - - test_msg.ecdsa_signature_dep.signed_messages[29] = 14; - - test_msg.ecdsa_signature_dep.signed_messages[30] = 90; - - test_msg.ecdsa_signature_dep.signed_messages[31] = 153; - - test_msg.ecdsa_signature_dep.signed_messages[32] = 183; - - test_msg.ecdsa_signature_dep.signed_messages[33] = 9; - - test_msg.ecdsa_signature_dep.signed_messages[34] = 72; - - test_msg.ecdsa_signature_dep.signed_messages[35] = 81; - - test_msg.ecdsa_signature_dep.signed_messages[36] = 118; - - test_msg.ecdsa_signature_dep.signed_messages[37] = 112; - - test_msg.ecdsa_signature_dep.signed_messages[38] = 124; - - test_msg.ecdsa_signature_dep.signed_messages[39] = 16; - - test_msg.ecdsa_signature_dep.signed_messages[40] = 182; - - test_msg.ecdsa_signature_dep.signed_messages[41] = 76; - - test_msg.ecdsa_signature_dep.signed_messages[42] = 146; - - test_msg.ecdsa_signature_dep.signed_messages[43] = 115; - - test_msg.ecdsa_signature_dep.signed_messages[44] = 58; - - test_msg.ecdsa_signature_dep.signed_messages[45] = 144; - - test_msg.ecdsa_signature_dep.signed_messages[46] = 17; - - test_msg.ecdsa_signature_dep.signed_messages[47] = 105; - - test_msg.ecdsa_signature_dep.signed_messages[48] = 66; - - test_msg.ecdsa_signature_dep.signed_messages[49] = 31; - - test_msg.ecdsa_signature_dep.signed_messages[50] = 135; - - test_msg.ecdsa_signature_dep.signed_messages[51] = 54; - - test_msg.ecdsa_signature_dep.signed_messages[52] = 100; - - test_msg.ecdsa_signature_dep.signed_messages[53] = 84; - - test_msg.ecdsa_signature_dep.signed_messages[54] = 181; - - test_msg.ecdsa_signature_dep.signed_messages[55] = 103; - - test_msg.ecdsa_signature_dep.signed_messages[56] = 11; - - test_msg.ecdsa_signature_dep.signed_messages[57] = 88; - - test_msg.ecdsa_signature_dep.signed_messages[58] = 133; - - test_msg.ecdsa_signature_dep.signed_messages[59] = 155; - - test_msg.ecdsa_signature_dep.signed_messages[60] = 167; - - test_msg.ecdsa_signature_dep.signed_messages[61] = 173; - - test_msg.ecdsa_signature_dep.signed_messages[62] = 143; - - test_msg.ecdsa_signature_dep.signed_messages[63] = 86; - - test_msg.ecdsa_signature_dep.signed_messages[64] = 158; - - test_msg.ecdsa_signature_dep.signed_messages[65] = 20; - - test_msg.ecdsa_signature_dep.signed_messages[66] = 168; - - test_msg.ecdsa_signature_dep.signed_messages[67] = 132; - - test_msg.ecdsa_signature_dep.signed_messages[68] = 141; - - test_msg.ecdsa_signature_dep.signed_messages[69] = 102; - - test_msg.ecdsa_signature_dep.signed_messages[70] = 50; - - test_msg.ecdsa_signature_dep.signed_messages[71] = 48; - - test_msg.ecdsa_signature_dep.signed_messages[72] = 71; - - test_msg.ecdsa_signature_dep.signed_messages[73] = 147; - - test_msg.ecdsa_signature_dep.signed_messages[74] = 53; - - test_msg.ecdsa_signature_dep.signed_messages[75] = 87; - - test_msg.ecdsa_signature_dep.signed_messages[76] = 1; - - test_msg.ecdsa_signature_dep.signed_messages[77] = 108; - - test_msg.ecdsa_signature_dep.signed_messages[78] = 138; - - test_msg.ecdsa_signature_dep.signed_messages[79] = 36; - - test_msg.ecdsa_signature_dep.signed_messages[80] = 134; - - test_msg.ecdsa_signature_dep.signed_messages[81] = 139; - - test_msg.ecdsa_signature_dep.signed_messages[82] = 163; - - test_msg.ecdsa_signature_dep.signed_messages[83] = 82; - - test_msg.ecdsa_signature_dep.signed_messages[84] = 43; - - test_msg.ecdsa_signature_dep.signed_messages[85] = 52; - - test_msg.ecdsa_signature_dep.signed_messages[86] = 150; - - test_msg.ecdsa_signature_dep.signed_messages[87] = 12; - - test_msg.ecdsa_signature_dep.signed_messages[88] = 30; - - test_msg.ecdsa_signature_dep.signed_messages[89] = 110; - - test_msg.ecdsa_signature_dep.signed_messages[90] = 156; - - test_msg.ecdsa_signature_dep.signed_messages[91] = 107; - - test_msg.ecdsa_signature_dep.signed_messages[92] = 120; - - test_msg.ecdsa_signature_dep.signed_messages[93] = 91; - - test_msg.ecdsa_signature_dep.signed_messages[94] = 122; - - test_msg.ecdsa_signature_dep.signed_messages[95] = 69; - - test_msg.ecdsa_signature_dep.signed_messages[96] = 164; - - test_msg.ecdsa_signature_dep.signed_messages[97] = 170; - - test_msg.ecdsa_signature_dep.signed_messages[98] = 116; - - test_msg.ecdsa_signature_dep.signed_messages[99] = 25; - - test_msg.ecdsa_signature_dep.signed_messages[100] = 94; - - test_msg.ecdsa_signature_dep.signed_messages[101] = 5; - - test_msg.ecdsa_signature_dep.signed_messages[102] = 22; - - test_msg.ecdsa_signature_dep.signed_messages[103] = 24; - - test_msg.ecdsa_signature_dep.signed_messages[104] = 162; - - test_msg.ecdsa_signature_dep.signed_messages[105] = 175; - - test_msg.ecdsa_signature_dep.signed_messages[106] = 38; - - test_msg.ecdsa_signature_dep.signed_messages[107] = 157; - - test_msg.ecdsa_signature_dep.signed_messages[108] = 98; - - test_msg.ecdsa_signature_dep.signed_messages[109] = 44; - - test_msg.ecdsa_signature_dep.signed_messages[110] = 160; - - test_msg.ecdsa_signature_dep.signed_messages[111] = 47; - - test_msg.ecdsa_signature_dep.signed_messages[112] = 97; - - test_msg.ecdsa_signature_dep.signed_messages[113] = 142; - - test_msg.ecdsa_signature_dep.signed_messages[114] = 8; - - test_msg.ecdsa_signature_dep.signed_messages[115] = 74; - - test_msg.ecdsa_signature_dep.signed_messages[116] = 13; - - test_msg.ecdsa_signature_dep.signed_messages[117] = 177; - - test_msg.ecdsa_signature_dep.signed_messages[118] = 15; - - test_msg.ecdsa_signature_dep.signed_messages[119] = 128; - - test_msg.ecdsa_signature_dep.signed_messages[120] = 26; - - test_msg.ecdsa_signature_dep.signed_messages[121] = 131; - - test_msg.ecdsa_signature_dep.signed_messages[122] = 154; - - test_msg.ecdsa_signature_dep.signed_messages[123] = 65; - - test_msg.ecdsa_signature_dep.signed_messages[124] = 169; - - test_msg.ecdsa_signature_dep.signed_messages[125] = 55; - - test_msg.ecdsa_signature_dep.signed_messages[126] = 136; - - test_msg.ecdsa_signature_dep.signed_messages[127] = 125; - - test_msg.ecdsa_signature_dep.signed_messages[128] = 171; - - test_msg.ecdsa_signature_dep.signed_messages[129] = 161; - - test_msg.ecdsa_signature_dep.signed_messages[130] = 29; - - test_msg.ecdsa_signature_dep.signed_messages[131] = 129; - - test_msg.ecdsa_signature_dep.signed_messages[132] = 151; - - test_msg.ecdsa_signature_dep.signed_messages[133] = 68; - - test_msg.ecdsa_signature_dep.signed_messages[134] = 166; - - test_msg.ecdsa_signature_dep.signed_messages[135] = 51; - - test_msg.ecdsa_signature_dep.signed_messages[136] = 70; - - test_msg.ecdsa_signature_dep.signed_messages[137] = 45; - - test_msg.ecdsa_signature_dep.signed_messages[138] = 56; - - test_msg.ecdsa_signature_dep.signed_messages[139] = 79; - - test_msg.ecdsa_signature_dep.signed_messages[140] = 149; - - test_msg.ecdsa_signature_dep.signed_messages[141] = 99; - - test_msg.ecdsa_signature_dep.signed_messages[142] = 42; - - test_msg.ecdsa_signature_dep.signed_messages[143] = 101; - - test_msg.ecdsa_signature_dep.signed_messages[144] = 152; - - test_msg.ecdsa_signature_dep.signed_messages[145] = 39; - - test_msg.ecdsa_signature_dep.signed_messages[146] = 89; - - test_msg.ecdsa_signature_dep.signed_messages[147] = 180; - - test_msg.ecdsa_signature_dep.signed_messages[148] = 64; - - test_msg.ecdsa_signature_dep.signed_messages[149] = 49; - - test_msg.ecdsa_signature_dep.signed_messages[150] = 6; - - test_msg.ecdsa_signature_dep.signed_messages[151] = 80; - - test_msg.ecdsa_signature_dep.signed_messages[152] = 172; - - test_msg.ecdsa_signature_dep.signed_messages[153] = 32; - - test_msg.ecdsa_signature_dep.signed_messages[154] = 109; - - test_msg.ecdsa_signature_dep.signed_messages[155] = 2; - - test_msg.ecdsa_signature_dep.signed_messages[156] = 119; - - test_msg.ecdsa_signature_dep.signed_messages[157] = 93; - - test_msg.ecdsa_signature_dep.signed_messages[158] = 176; - - test_msg.ecdsa_signature_dep.signed_messages[159] = 0; - - test_msg.ecdsa_signature_dep.signed_messages[160] = 33; - - test_msg.ecdsa_signature_dep.signed_messages[161] = 57; - - test_msg.ecdsa_signature_dep.signed_messages[162] = 34; - - test_msg.ecdsa_signature_dep.signed_messages[163] = 18; - - test_msg.ecdsa_signature_dep.signed_messages[164] = 85; - - test_msg.ecdsa_signature_dep.signed_messages[165] = 121; - - test_msg.ecdsa_signature_dep.signed_messages[166] = 137; - - test_msg.ecdsa_signature_dep.signed_messages[167] = 83; - - test_msg.ecdsa_signature_dep.signed_messages[168] = 111; - - test_msg.ecdsa_signature_dep.signed_messages[169] = 59; - - test_msg.ecdsa_signature_dep.signed_messages[170] = 7; - - test_msg.ecdsa_signature_dep.signed_messages[171] = 77; - - test_msg.ecdsa_signature_dep.signed_messages[172] = 4; - - test_msg.ecdsa_signature_dep.signed_messages[173] = 117; - - test_msg.ecdsa_signature_dep.signed_messages[174] = 159; - - test_msg.ecdsa_signature_dep.signed_messages[175] = 148; - - test_msg.ecdsa_signature_dep.signed_messages[176] = 35; - - test_msg.ecdsa_signature_dep.signed_messages[177] = 61; - - test_msg.ecdsa_signature_dep.signed_messages[178] = 41; - - test_msg.ecdsa_signature_dep.signed_messages[179] = 67; - - test_msg.ecdsa_signature_dep.signed_messages[180] = 46; - - test_msg.ecdsa_signature_dep.signed_messages[181] = 127; - - test_msg.ecdsa_signature_dep.signed_messages[182] = 75; - - test_msg.ecdsa_signature_dep.signed_messages[183] = 174; - - test_msg.ecdsa_signature_dep.stream_counter = 1; - - sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDep, 66, &test_msg, - &dummy_write); - - ck_assert_msg(dummy_wr == sizeof(encoded_frame), - "not enough data was written to dummy_buff (expected: %zu, " - "actual: %zu)", - sizeof(encoded_frame), dummy_wr); - ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, - "frame was not encoded properly"); - - while (dummy_rd < dummy_wr) { - ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, - "sbp_process threw an error!"); - } - - ck_assert_msg(last_msg.n_callbacks_logged == 1, - "msg_callback: one callback should have been logged"); - ck_assert_msg(last_msg.sender_id == 66, - "msg_callback: sender_id decoded incorrectly"); - - ck_assert_msg( - sbp_message_cmp(SbpMsgEcdsaSignatureDep, &last_msg.msg, &test_msg) == 0, - "Sent and received messages did not compare equal"); - - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.certificate_id[0] == 1, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.certificate_id[0], expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.certificate_id[0]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.certificate_id[1] == 2, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.certificate_id[1], expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.certificate_id[1]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.certificate_id[2] == 3, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.certificate_id[2], expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.certificate_id[2]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.certificate_id[3] == 4, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.certificate_id[3], expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.certificate_id[3]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.flags == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.flags, " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.flags); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.n_signed_messages == 184, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.n_signed_messages, " - "expected 184, is %d", - last_msg.msg.ecdsa_signature_dep.n_signed_messages); - - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.on_demand_counter == 2, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.on_demand_counter, expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.on_demand_counter); - - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[0] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[0], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[0]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[1] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[1], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[1]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[2] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[2], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[2]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[3] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[3], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[3]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[4] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[4], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[4]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[5] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[5], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[5]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[6] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[6], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[6]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[7] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[7], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[7]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[8] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[8], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[8]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[9] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[9], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[9]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[10] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[10], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[10]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[11] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[11], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[11]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[12] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[12], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[12]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[13] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[13], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[13]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[14] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[14], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[14]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[15] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[15], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[15]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[16] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[16], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[16]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[17] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[17], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[17]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[18] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[18], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[18]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[19] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[19], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[19]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[20] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[20], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[20]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[21] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[21], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[21]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[22] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[22], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[22]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[23] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[23], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[23]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[24] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[24], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[24]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[25] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[25], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[25]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[26] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[26], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[26]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[27] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[27], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[27]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[28] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[28], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[28]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[29] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[29], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[29]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[30] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[30], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[30]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[31] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[31], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[31]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[32] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[32], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[32]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[33] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[33], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[33]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[34] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[34], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[34]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[35] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[35], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[35]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[36] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[36], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[36]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[37] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[37], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[37]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[38] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[38], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[38]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[39] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[39], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[39]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[40] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[40], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[40]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[41] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[41], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[41]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[42] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[42], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[42]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[43] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[43], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[43]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[44] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[44], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[44]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[45] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[45], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[45]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[46] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[46], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[46]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[47] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[47], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[47]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[48] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[48], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[48]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[49] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[49], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[49]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[50] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[50], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[50]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[51] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[51], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[51]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[52] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[52], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[52]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[53] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[53], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[53]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[54] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[54], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[54]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[55] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[55], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[55]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[56] == 0, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[56], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signature[56]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[57] == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[57], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signature[57]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[58] == 2, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[58], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signature[58]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[59] == 3, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[59], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signature[59]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[60] == 4, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[60], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signature[60]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[61] == 5, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[61], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signature[61]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[62] == 6, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[62], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signature[62]); - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.signature[63] == 7, - "incorrect value for last_msg.msg.ecdsa_signature_dep.signature[63], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signature[63]); - - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[0] == 10, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[0], " - "expected 10, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[0]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[1] == 21, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[1], " - "expected 21, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[1]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[2] == 23, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[2], " - "expected 23, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[2]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[3] == 63, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[3], " - "expected 63, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[3]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[4] == 140, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[4], " - "expected 140, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[4]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[5] == 37, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[5], " - "expected 37, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[5]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[6] == 130, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[6], " - "expected 130, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[6]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[7] == 106, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[7], " - "expected 106, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[7]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[8] == 28, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[8], " - "expected 28, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[8]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[9] == 40, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[9], " - "expected 40, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[9]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[10] == 165, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[10], " - "expected 165, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[10]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[11] == 179, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[11], " - "expected 179, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[11]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[12] == 73, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[12], " - "expected 73, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[12]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[13] == 178, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[13], " - "expected 178, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[13]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[14] == 60, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[14], " - "expected 60, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[14]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[15] == 126, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[15], " - "expected 126, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[15]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[16] == 114, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[16], " - "expected 114, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[16]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[17] == 78, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[17], " - "expected 78, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[17]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[18] == 113, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[18], " - "expected 113, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[18]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[19] == 27, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[19], " - "expected 27, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[19]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[20] == 95, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[20], " - "expected 95, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[20]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[21] == 3, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[21], " - "expected 3, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[21]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[22] == 62, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[22], " - "expected 62, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[22]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[23] == 104, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[23], " - "expected 104, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[23]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[24] == 145, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[24], " - "expected 145, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[24]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[25] == 96, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[25], " - "expected 96, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[25]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[26] == 19, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[26], " - "expected 19, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[26]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[27] == 92, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[27], " - "expected 92, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[27]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[28] == 123, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[28], " - "expected 123, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[28]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[29] == 14, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[29], " - "expected 14, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[29]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[30] == 90, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[30], " - "expected 90, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[30]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[31] == 153, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[31], " - "expected 153, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[31]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[32] == 183, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[32], " - "expected 183, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[32]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[33] == 9, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[33], " - "expected 9, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[33]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[34] == 72, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[34], " - "expected 72, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[34]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[35] == 81, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[35], " - "expected 81, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[35]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[36] == 118, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[36], " - "expected 118, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[36]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[37] == 112, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[37], " - "expected 112, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[37]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[38] == 124, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[38], " - "expected 124, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[38]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[39] == 16, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[39], " - "expected 16, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[39]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[40] == 182, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[40], " - "expected 182, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[40]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[41] == 76, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[41], " - "expected 76, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[41]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[42] == 146, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[42], " - "expected 146, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[42]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[43] == 115, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[43], " - "expected 115, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[43]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[44] == 58, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[44], " - "expected 58, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[44]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[45] == 144, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[45], " - "expected 144, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[45]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[46] == 17, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[46], " - "expected 17, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[46]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[47] == 105, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[47], " - "expected 105, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[47]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[48] == 66, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[48], " - "expected 66, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[48]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[49] == 31, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[49], " - "expected 31, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[49]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[50] == 135, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[50], " - "expected 135, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[50]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[51] == 54, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[51], " - "expected 54, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[51]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[52] == 100, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[52], " - "expected 100, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[52]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[53] == 84, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[53], " - "expected 84, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[53]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[54] == 181, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[54], " - "expected 181, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[54]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[55] == 103, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[55], " - "expected 103, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[55]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[56] == 11, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[56], " - "expected 11, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[56]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[57] == 88, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[57], " - "expected 88, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[57]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[58] == 133, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[58], " - "expected 133, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[58]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[59] == 155, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[59], " - "expected 155, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[59]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[60] == 167, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[60], " - "expected 167, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[60]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[61] == 173, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[61], " - "expected 173, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[61]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[62] == 143, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[62], " - "expected 143, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[62]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[63] == 86, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[63], " - "expected 86, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[63]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[64] == 158, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[64], " - "expected 158, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[64]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[65] == 20, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[65], " - "expected 20, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[65]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[66] == 168, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[66], " - "expected 168, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[66]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[67] == 132, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[67], " - "expected 132, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[67]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[68] == 141, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[68], " - "expected 141, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[68]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[69] == 102, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[69], " - "expected 102, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[69]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[70] == 50, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[70], " - "expected 50, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[70]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[71] == 48, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[71], " - "expected 48, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[71]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[72] == 71, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[72], " - "expected 71, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[72]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[73] == 147, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[73], " - "expected 147, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[73]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[74] == 53, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[74], " - "expected 53, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[74]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[75] == 87, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[75], " - "expected 87, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[75]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[76] == 1, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[76], " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[76]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[77] == 108, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[77], " - "expected 108, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[77]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[78] == 138, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[78], " - "expected 138, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[78]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[79] == 36, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[79], " - "expected 36, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[79]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[80] == 134, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[80], " - "expected 134, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[80]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[81] == 139, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[81], " - "expected 139, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[81]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[82] == 163, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[82], " - "expected 163, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[82]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[83] == 82, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[83], " - "expected 82, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[83]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[84] == 43, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[84], " - "expected 43, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[84]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[85] == 52, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[85], " - "expected 52, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[85]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[86] == 150, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[86], " - "expected 150, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[86]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[87] == 12, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[87], " - "expected 12, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[87]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[88] == 30, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[88], " - "expected 30, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[88]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[89] == 110, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[89], " - "expected 110, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[89]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[90] == 156, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[90], " - "expected 156, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[90]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[91] == 107, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[91], " - "expected 107, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[91]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[92] == 120, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[92], " - "expected 120, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[92]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[93] == 91, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[93], " - "expected 91, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[93]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[94] == 122, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[94], " - "expected 122, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[94]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[95] == 69, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[95], " - "expected 69, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[95]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[96] == 164, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[96], " - "expected 164, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[96]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[97] == 170, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[97], " - "expected 170, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[97]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[98] == 116, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[98], " - "expected 116, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[98]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[99] == 25, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[99], " - "expected 25, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[99]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[100] == 94, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[100], " - "expected 94, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[100]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[101] == 5, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[101], " - "expected 5, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[101]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[102] == 22, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[102], " - "expected 22, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[102]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[103] == 24, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[103], " - "expected 24, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[103]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[104] == 162, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[104], " - "expected 162, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[104]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[105] == 175, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[105], " - "expected 175, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[105]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[106] == 38, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[106], " - "expected 38, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[106]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[107] == 157, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[107], " - "expected 157, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[107]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[108] == 98, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[108], " - "expected 98, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[108]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[109] == 44, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[109], " - "expected 44, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[109]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[110] == 160, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[110], " - "expected 160, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[110]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[111] == 47, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[111], " - "expected 47, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[111]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[112] == 97, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[112], " - "expected 97, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[112]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[113] == 142, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[113], " - "expected 142, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[113]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[114] == 8, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[114], " - "expected 8, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[114]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[115] == 74, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[115], " - "expected 74, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[115]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[116] == 13, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[116], " - "expected 13, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[116]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[117] == 177, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[117], " - "expected 177, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[117]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[118] == 15, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[118], " - "expected 15, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[118]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[119] == 128, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[119], " - "expected 128, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[119]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[120] == 26, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[120], " - "expected 26, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[120]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[121] == 131, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[121], " - "expected 131, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[121]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[122] == 154, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[122], " - "expected 154, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[122]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[123] == 65, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[123], " - "expected 65, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[123]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[124] == 169, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[124], " - "expected 169, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[124]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[125] == 55, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[125], " - "expected 55, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[125]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[126] == 136, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[126], " - "expected 136, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[126]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[127] == 125, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[127], " - "expected 125, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[127]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[128] == 171, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[128], " - "expected 171, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[128]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[129] == 161, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[129], " - "expected 161, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[129]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[130] == 29, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[130], " - "expected 29, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[130]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[131] == 129, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[131], " - "expected 129, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[131]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[132] == 151, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[132], " - "expected 151, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[132]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[133] == 68, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[133], " - "expected 68, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[133]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[134] == 166, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[134], " - "expected 166, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[134]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[135] == 51, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[135], " - "expected 51, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[135]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[136] == 70, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[136], " - "expected 70, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[136]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[137] == 45, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[137], " - "expected 45, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[137]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[138] == 56, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[138], " - "expected 56, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[138]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[139] == 79, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[139], " - "expected 79, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[139]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[140] == 149, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[140], " - "expected 149, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[140]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[141] == 99, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[141], " - "expected 99, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[141]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[142] == 42, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[142], " - "expected 42, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[142]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[143] == 101, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[143], " - "expected 101, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[143]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[144] == 152, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[144], " - "expected 152, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[144]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[145] == 39, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[145], " - "expected 39, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[145]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[146] == 89, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[146], " - "expected 89, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[146]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[147] == 180, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[147], " - "expected 180, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[147]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[148] == 64, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[148], " - "expected 64, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[148]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[149] == 49, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[149], " - "expected 49, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[149]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[150] == 6, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[150], " - "expected 6, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[150]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[151] == 80, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[151], " - "expected 80, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[151]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[152] == 172, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[152], " - "expected 172, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[152]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[153] == 32, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[153], " - "expected 32, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[153]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[154] == 109, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[154], " - "expected 109, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[154]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[155] == 2, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[155], " - "expected 2, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[155]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[156] == 119, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[156], " - "expected 119, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[156]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[157] == 93, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[157], " - "expected 93, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[157]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[158] == 176, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[158], " - "expected 176, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[158]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[159] == 0, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[159], " - "expected 0, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[159]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[160] == 33, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[160], " - "expected 33, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[160]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[161] == 57, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[161], " - "expected 57, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[161]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[162] == 34, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[162], " - "expected 34, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[162]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[163] == 18, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[163], " - "expected 18, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[163]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[164] == 85, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[164], " - "expected 85, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[164]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[165] == 121, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[165], " - "expected 121, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[165]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[166] == 137, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[166], " - "expected 137, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[166]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[167] == 83, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[167], " - "expected 83, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[167]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[168] == 111, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[168], " - "expected 111, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[168]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[169] == 59, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[169], " - "expected 59, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[169]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[170] == 7, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[170], " - "expected 7, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[170]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[171] == 77, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[171], " - "expected 77, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[171]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[172] == 4, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[172], " - "expected 4, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[172]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[173] == 117, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[173], " - "expected 117, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[173]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[174] == 159, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[174], " - "expected 159, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[174]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[175] == 148, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[175], " - "expected 148, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[175]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[176] == 35, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[176], " - "expected 35, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[176]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[177] == 61, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[177], " - "expected 61, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[177]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[178] == 41, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[178], " - "expected 41, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[178]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[179] == 67, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[179], " - "expected 67, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[179]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[180] == 46, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[180], " - "expected 46, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[180]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[181] == 127, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[181], " - "expected 127, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[181]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[182] == 75, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[182], " - "expected 75, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[182]); - ck_assert_msg(last_msg.msg.ecdsa_signature_dep.signed_messages[183] == 174, - "incorrect value for " - "last_msg.msg.ecdsa_signature_dep.signed_messages[183], " - "expected 174, is %d", - last_msg.msg.ecdsa_signature_dep.signed_messages[183]); - - ck_assert_msg( - last_msg.msg.ecdsa_signature_dep.stream_counter == 1, - "incorrect value for last_msg.msg.ecdsa_signature_dep.stream_counter, " - "expected 1, is %d", - last_msg.msg.ecdsa_signature_dep.stream_counter); - } -} -END_TEST - -Suite *auto_check_sbp_signing_MsgEcdsaSignatureDep_suite(void) { - Suite *s = suite_create( - "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDep"); - TCase *tc_acq = tcase_create( - "Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDep"); - tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignatureDep); - suite_add_tcase(s, tc_acq); - return s; -} \ No newline at end of file diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c new file mode 100644 index 0000000000..ad5d030a1f --- /dev/null +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c @@ -0,0 +1,1989 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include // for debugging +#include // for malloc + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + sbp_msg_type_t msg_type; + sbp_msg_t msg; + void *context; +} last_msg; + +static u32 dummy_wr = 0; +static u32 dummy_rd = 0; +static u8 dummy_buff[1024]; +static void *last_io_context; + +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; + +static void dummy_reset() { + dummy_rd = dummy_wr = 0; + memset(dummy_buff, 0, sizeof(dummy_buff)); +} + +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; +} + +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; +} + +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } + +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { + last_msg.n_callbacks_logged++; + last_msg.sender_id = sender_id; + last_msg.msg_type = msg_type; + last_msg.msg = *msg; + last_msg.context = context; +} + +START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignatureDepA) { + static sbp_msg_callbacks_node_t n; + + // State of the SBP message parser. + // Must be statically allocated. + sbp_state_t sbp_state; + + // + // Run tests: + // + // Test successful parsing of a message + { + // SBP parser state must be initialized before sbp_process is called. + // We re-initialize before every test so that callbacks for the same message + // types can be + // allocated multiple times across different tests. + sbp_state_init(&sbp_state); + + sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); + + logging_reset(); + + sbp_callback_register(&sbp_state, 0xC06, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, + 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, + 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 10, 21, 23, 63, 140, 37, 130, + 106, 28, 40, 165, 179, 73, 178, 60, 126, 114, 78, 113, 27, 95, + 3, 62, 104, 145, 96, 19, 92, 123, 14, 90, 153, 183, 9, 72, + 81, 118, 112, 124, 16, 182, 76, 146, 115, 58, 144, 17, 105, 66, + 31, 135, 54, 100, 84, 181, 103, 11, 88, 133, 155, 167, 173, 143, + 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, 147, 53, 87, 1, + 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, 30, 110, 156, + 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, 24, 162, + 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, 15, + 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, + 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, + 180, 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, + 57, 34, 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, + 148, 35, 61, 41, 67, 46, 127, 75, 174, 97, 172, + }; + + dummy_reset(); + + sbp_msg_t test_msg; + memset(&test_msg, 0, sizeof(test_msg)); + + test_msg.ecdsa_signature_dep_a.certificate_id[0] = 1; + + test_msg.ecdsa_signature_dep_a.certificate_id[1] = 2; + + test_msg.ecdsa_signature_dep_a.certificate_id[2] = 3; + + test_msg.ecdsa_signature_dep_a.certificate_id[3] = 4; + + test_msg.ecdsa_signature_dep_a.flags = 0; + + test_msg.ecdsa_signature_dep_a.n_signed_messages = 184; + + test_msg.ecdsa_signature_dep_a.on_demand_counter = 2; + + test_msg.ecdsa_signature_dep_a.signature[0] = 0; + + test_msg.ecdsa_signature_dep_a.signature[1] = 1; + + test_msg.ecdsa_signature_dep_a.signature[2] = 2; + + test_msg.ecdsa_signature_dep_a.signature[3] = 3; + + test_msg.ecdsa_signature_dep_a.signature[4] = 4; + + test_msg.ecdsa_signature_dep_a.signature[5] = 5; + + test_msg.ecdsa_signature_dep_a.signature[6] = 6; + + test_msg.ecdsa_signature_dep_a.signature[7] = 7; + + test_msg.ecdsa_signature_dep_a.signature[8] = 0; + + test_msg.ecdsa_signature_dep_a.signature[9] = 1; + + test_msg.ecdsa_signature_dep_a.signature[10] = 2; + + test_msg.ecdsa_signature_dep_a.signature[11] = 3; + + test_msg.ecdsa_signature_dep_a.signature[12] = 4; + + test_msg.ecdsa_signature_dep_a.signature[13] = 5; + + test_msg.ecdsa_signature_dep_a.signature[14] = 6; + + test_msg.ecdsa_signature_dep_a.signature[15] = 7; + + test_msg.ecdsa_signature_dep_a.signature[16] = 0; + + test_msg.ecdsa_signature_dep_a.signature[17] = 1; + + test_msg.ecdsa_signature_dep_a.signature[18] = 2; + + test_msg.ecdsa_signature_dep_a.signature[19] = 3; + + test_msg.ecdsa_signature_dep_a.signature[20] = 4; + + test_msg.ecdsa_signature_dep_a.signature[21] = 5; + + test_msg.ecdsa_signature_dep_a.signature[22] = 6; + + test_msg.ecdsa_signature_dep_a.signature[23] = 7; + + test_msg.ecdsa_signature_dep_a.signature[24] = 0; + + test_msg.ecdsa_signature_dep_a.signature[25] = 1; + + test_msg.ecdsa_signature_dep_a.signature[26] = 2; + + test_msg.ecdsa_signature_dep_a.signature[27] = 3; + + test_msg.ecdsa_signature_dep_a.signature[28] = 4; + + test_msg.ecdsa_signature_dep_a.signature[29] = 5; + + test_msg.ecdsa_signature_dep_a.signature[30] = 6; + + test_msg.ecdsa_signature_dep_a.signature[31] = 7; + + test_msg.ecdsa_signature_dep_a.signature[32] = 0; + + test_msg.ecdsa_signature_dep_a.signature[33] = 1; + + test_msg.ecdsa_signature_dep_a.signature[34] = 2; + + test_msg.ecdsa_signature_dep_a.signature[35] = 3; + + test_msg.ecdsa_signature_dep_a.signature[36] = 4; + + test_msg.ecdsa_signature_dep_a.signature[37] = 5; + + test_msg.ecdsa_signature_dep_a.signature[38] = 6; + + test_msg.ecdsa_signature_dep_a.signature[39] = 7; + + test_msg.ecdsa_signature_dep_a.signature[40] = 0; + + test_msg.ecdsa_signature_dep_a.signature[41] = 1; + + test_msg.ecdsa_signature_dep_a.signature[42] = 2; + + test_msg.ecdsa_signature_dep_a.signature[43] = 3; + + test_msg.ecdsa_signature_dep_a.signature[44] = 4; + + test_msg.ecdsa_signature_dep_a.signature[45] = 5; + + test_msg.ecdsa_signature_dep_a.signature[46] = 6; + + test_msg.ecdsa_signature_dep_a.signature[47] = 7; + + test_msg.ecdsa_signature_dep_a.signature[48] = 0; + + test_msg.ecdsa_signature_dep_a.signature[49] = 1; + + test_msg.ecdsa_signature_dep_a.signature[50] = 2; + + test_msg.ecdsa_signature_dep_a.signature[51] = 3; + + test_msg.ecdsa_signature_dep_a.signature[52] = 4; + + test_msg.ecdsa_signature_dep_a.signature[53] = 5; + + test_msg.ecdsa_signature_dep_a.signature[54] = 6; + + test_msg.ecdsa_signature_dep_a.signature[55] = 7; + + test_msg.ecdsa_signature_dep_a.signature[56] = 0; + + test_msg.ecdsa_signature_dep_a.signature[57] = 1; + + test_msg.ecdsa_signature_dep_a.signature[58] = 2; + + test_msg.ecdsa_signature_dep_a.signature[59] = 3; + + test_msg.ecdsa_signature_dep_a.signature[60] = 4; + + test_msg.ecdsa_signature_dep_a.signature[61] = 5; + + test_msg.ecdsa_signature_dep_a.signature[62] = 6; + + test_msg.ecdsa_signature_dep_a.signature[63] = 7; + + test_msg.ecdsa_signature_dep_a.signed_messages[0] = 10; + + test_msg.ecdsa_signature_dep_a.signed_messages[1] = 21; + + test_msg.ecdsa_signature_dep_a.signed_messages[2] = 23; + + test_msg.ecdsa_signature_dep_a.signed_messages[3] = 63; + + test_msg.ecdsa_signature_dep_a.signed_messages[4] = 140; + + test_msg.ecdsa_signature_dep_a.signed_messages[5] = 37; + + test_msg.ecdsa_signature_dep_a.signed_messages[6] = 130; + + test_msg.ecdsa_signature_dep_a.signed_messages[7] = 106; + + test_msg.ecdsa_signature_dep_a.signed_messages[8] = 28; + + test_msg.ecdsa_signature_dep_a.signed_messages[9] = 40; + + test_msg.ecdsa_signature_dep_a.signed_messages[10] = 165; + + test_msg.ecdsa_signature_dep_a.signed_messages[11] = 179; + + test_msg.ecdsa_signature_dep_a.signed_messages[12] = 73; + + test_msg.ecdsa_signature_dep_a.signed_messages[13] = 178; + + test_msg.ecdsa_signature_dep_a.signed_messages[14] = 60; + + test_msg.ecdsa_signature_dep_a.signed_messages[15] = 126; + + test_msg.ecdsa_signature_dep_a.signed_messages[16] = 114; + + test_msg.ecdsa_signature_dep_a.signed_messages[17] = 78; + + test_msg.ecdsa_signature_dep_a.signed_messages[18] = 113; + + test_msg.ecdsa_signature_dep_a.signed_messages[19] = 27; + + test_msg.ecdsa_signature_dep_a.signed_messages[20] = 95; + + test_msg.ecdsa_signature_dep_a.signed_messages[21] = 3; + + test_msg.ecdsa_signature_dep_a.signed_messages[22] = 62; + + test_msg.ecdsa_signature_dep_a.signed_messages[23] = 104; + + test_msg.ecdsa_signature_dep_a.signed_messages[24] = 145; + + test_msg.ecdsa_signature_dep_a.signed_messages[25] = 96; + + test_msg.ecdsa_signature_dep_a.signed_messages[26] = 19; + + test_msg.ecdsa_signature_dep_a.signed_messages[27] = 92; + + test_msg.ecdsa_signature_dep_a.signed_messages[28] = 123; + + test_msg.ecdsa_signature_dep_a.signed_messages[29] = 14; + + test_msg.ecdsa_signature_dep_a.signed_messages[30] = 90; + + test_msg.ecdsa_signature_dep_a.signed_messages[31] = 153; + + test_msg.ecdsa_signature_dep_a.signed_messages[32] = 183; + + test_msg.ecdsa_signature_dep_a.signed_messages[33] = 9; + + test_msg.ecdsa_signature_dep_a.signed_messages[34] = 72; + + test_msg.ecdsa_signature_dep_a.signed_messages[35] = 81; + + test_msg.ecdsa_signature_dep_a.signed_messages[36] = 118; + + test_msg.ecdsa_signature_dep_a.signed_messages[37] = 112; + + test_msg.ecdsa_signature_dep_a.signed_messages[38] = 124; + + test_msg.ecdsa_signature_dep_a.signed_messages[39] = 16; + + test_msg.ecdsa_signature_dep_a.signed_messages[40] = 182; + + test_msg.ecdsa_signature_dep_a.signed_messages[41] = 76; + + test_msg.ecdsa_signature_dep_a.signed_messages[42] = 146; + + test_msg.ecdsa_signature_dep_a.signed_messages[43] = 115; + + test_msg.ecdsa_signature_dep_a.signed_messages[44] = 58; + + test_msg.ecdsa_signature_dep_a.signed_messages[45] = 144; + + test_msg.ecdsa_signature_dep_a.signed_messages[46] = 17; + + test_msg.ecdsa_signature_dep_a.signed_messages[47] = 105; + + test_msg.ecdsa_signature_dep_a.signed_messages[48] = 66; + + test_msg.ecdsa_signature_dep_a.signed_messages[49] = 31; + + test_msg.ecdsa_signature_dep_a.signed_messages[50] = 135; + + test_msg.ecdsa_signature_dep_a.signed_messages[51] = 54; + + test_msg.ecdsa_signature_dep_a.signed_messages[52] = 100; + + test_msg.ecdsa_signature_dep_a.signed_messages[53] = 84; + + test_msg.ecdsa_signature_dep_a.signed_messages[54] = 181; + + test_msg.ecdsa_signature_dep_a.signed_messages[55] = 103; + + test_msg.ecdsa_signature_dep_a.signed_messages[56] = 11; + + test_msg.ecdsa_signature_dep_a.signed_messages[57] = 88; + + test_msg.ecdsa_signature_dep_a.signed_messages[58] = 133; + + test_msg.ecdsa_signature_dep_a.signed_messages[59] = 155; + + test_msg.ecdsa_signature_dep_a.signed_messages[60] = 167; + + test_msg.ecdsa_signature_dep_a.signed_messages[61] = 173; + + test_msg.ecdsa_signature_dep_a.signed_messages[62] = 143; + + test_msg.ecdsa_signature_dep_a.signed_messages[63] = 86; + + test_msg.ecdsa_signature_dep_a.signed_messages[64] = 158; + + test_msg.ecdsa_signature_dep_a.signed_messages[65] = 20; + + test_msg.ecdsa_signature_dep_a.signed_messages[66] = 168; + + test_msg.ecdsa_signature_dep_a.signed_messages[67] = 132; + + test_msg.ecdsa_signature_dep_a.signed_messages[68] = 141; + + test_msg.ecdsa_signature_dep_a.signed_messages[69] = 102; + + test_msg.ecdsa_signature_dep_a.signed_messages[70] = 50; + + test_msg.ecdsa_signature_dep_a.signed_messages[71] = 48; + + test_msg.ecdsa_signature_dep_a.signed_messages[72] = 71; + + test_msg.ecdsa_signature_dep_a.signed_messages[73] = 147; + + test_msg.ecdsa_signature_dep_a.signed_messages[74] = 53; + + test_msg.ecdsa_signature_dep_a.signed_messages[75] = 87; + + test_msg.ecdsa_signature_dep_a.signed_messages[76] = 1; + + test_msg.ecdsa_signature_dep_a.signed_messages[77] = 108; + + test_msg.ecdsa_signature_dep_a.signed_messages[78] = 138; + + test_msg.ecdsa_signature_dep_a.signed_messages[79] = 36; + + test_msg.ecdsa_signature_dep_a.signed_messages[80] = 134; + + test_msg.ecdsa_signature_dep_a.signed_messages[81] = 139; + + test_msg.ecdsa_signature_dep_a.signed_messages[82] = 163; + + test_msg.ecdsa_signature_dep_a.signed_messages[83] = 82; + + test_msg.ecdsa_signature_dep_a.signed_messages[84] = 43; + + test_msg.ecdsa_signature_dep_a.signed_messages[85] = 52; + + test_msg.ecdsa_signature_dep_a.signed_messages[86] = 150; + + test_msg.ecdsa_signature_dep_a.signed_messages[87] = 12; + + test_msg.ecdsa_signature_dep_a.signed_messages[88] = 30; + + test_msg.ecdsa_signature_dep_a.signed_messages[89] = 110; + + test_msg.ecdsa_signature_dep_a.signed_messages[90] = 156; + + test_msg.ecdsa_signature_dep_a.signed_messages[91] = 107; + + test_msg.ecdsa_signature_dep_a.signed_messages[92] = 120; + + test_msg.ecdsa_signature_dep_a.signed_messages[93] = 91; + + test_msg.ecdsa_signature_dep_a.signed_messages[94] = 122; + + test_msg.ecdsa_signature_dep_a.signed_messages[95] = 69; + + test_msg.ecdsa_signature_dep_a.signed_messages[96] = 164; + + test_msg.ecdsa_signature_dep_a.signed_messages[97] = 170; + + test_msg.ecdsa_signature_dep_a.signed_messages[98] = 116; + + test_msg.ecdsa_signature_dep_a.signed_messages[99] = 25; + + test_msg.ecdsa_signature_dep_a.signed_messages[100] = 94; + + test_msg.ecdsa_signature_dep_a.signed_messages[101] = 5; + + test_msg.ecdsa_signature_dep_a.signed_messages[102] = 22; + + test_msg.ecdsa_signature_dep_a.signed_messages[103] = 24; + + test_msg.ecdsa_signature_dep_a.signed_messages[104] = 162; + + test_msg.ecdsa_signature_dep_a.signed_messages[105] = 175; + + test_msg.ecdsa_signature_dep_a.signed_messages[106] = 38; + + test_msg.ecdsa_signature_dep_a.signed_messages[107] = 157; + + test_msg.ecdsa_signature_dep_a.signed_messages[108] = 98; + + test_msg.ecdsa_signature_dep_a.signed_messages[109] = 44; + + test_msg.ecdsa_signature_dep_a.signed_messages[110] = 160; + + test_msg.ecdsa_signature_dep_a.signed_messages[111] = 47; + + test_msg.ecdsa_signature_dep_a.signed_messages[112] = 97; + + test_msg.ecdsa_signature_dep_a.signed_messages[113] = 142; + + test_msg.ecdsa_signature_dep_a.signed_messages[114] = 8; + + test_msg.ecdsa_signature_dep_a.signed_messages[115] = 74; + + test_msg.ecdsa_signature_dep_a.signed_messages[116] = 13; + + test_msg.ecdsa_signature_dep_a.signed_messages[117] = 177; + + test_msg.ecdsa_signature_dep_a.signed_messages[118] = 15; + + test_msg.ecdsa_signature_dep_a.signed_messages[119] = 128; + + test_msg.ecdsa_signature_dep_a.signed_messages[120] = 26; + + test_msg.ecdsa_signature_dep_a.signed_messages[121] = 131; + + test_msg.ecdsa_signature_dep_a.signed_messages[122] = 154; + + test_msg.ecdsa_signature_dep_a.signed_messages[123] = 65; + + test_msg.ecdsa_signature_dep_a.signed_messages[124] = 169; + + test_msg.ecdsa_signature_dep_a.signed_messages[125] = 55; + + test_msg.ecdsa_signature_dep_a.signed_messages[126] = 136; + + test_msg.ecdsa_signature_dep_a.signed_messages[127] = 125; + + test_msg.ecdsa_signature_dep_a.signed_messages[128] = 171; + + test_msg.ecdsa_signature_dep_a.signed_messages[129] = 161; + + test_msg.ecdsa_signature_dep_a.signed_messages[130] = 29; + + test_msg.ecdsa_signature_dep_a.signed_messages[131] = 129; + + test_msg.ecdsa_signature_dep_a.signed_messages[132] = 151; + + test_msg.ecdsa_signature_dep_a.signed_messages[133] = 68; + + test_msg.ecdsa_signature_dep_a.signed_messages[134] = 166; + + test_msg.ecdsa_signature_dep_a.signed_messages[135] = 51; + + test_msg.ecdsa_signature_dep_a.signed_messages[136] = 70; + + test_msg.ecdsa_signature_dep_a.signed_messages[137] = 45; + + test_msg.ecdsa_signature_dep_a.signed_messages[138] = 56; + + test_msg.ecdsa_signature_dep_a.signed_messages[139] = 79; + + test_msg.ecdsa_signature_dep_a.signed_messages[140] = 149; + + test_msg.ecdsa_signature_dep_a.signed_messages[141] = 99; + + test_msg.ecdsa_signature_dep_a.signed_messages[142] = 42; + + test_msg.ecdsa_signature_dep_a.signed_messages[143] = 101; + + test_msg.ecdsa_signature_dep_a.signed_messages[144] = 152; + + test_msg.ecdsa_signature_dep_a.signed_messages[145] = 39; + + test_msg.ecdsa_signature_dep_a.signed_messages[146] = 89; + + test_msg.ecdsa_signature_dep_a.signed_messages[147] = 180; + + test_msg.ecdsa_signature_dep_a.signed_messages[148] = 64; + + test_msg.ecdsa_signature_dep_a.signed_messages[149] = 49; + + test_msg.ecdsa_signature_dep_a.signed_messages[150] = 6; + + test_msg.ecdsa_signature_dep_a.signed_messages[151] = 80; + + test_msg.ecdsa_signature_dep_a.signed_messages[152] = 172; + + test_msg.ecdsa_signature_dep_a.signed_messages[153] = 32; + + test_msg.ecdsa_signature_dep_a.signed_messages[154] = 109; + + test_msg.ecdsa_signature_dep_a.signed_messages[155] = 2; + + test_msg.ecdsa_signature_dep_a.signed_messages[156] = 119; + + test_msg.ecdsa_signature_dep_a.signed_messages[157] = 93; + + test_msg.ecdsa_signature_dep_a.signed_messages[158] = 176; + + test_msg.ecdsa_signature_dep_a.signed_messages[159] = 0; + + test_msg.ecdsa_signature_dep_a.signed_messages[160] = 33; + + test_msg.ecdsa_signature_dep_a.signed_messages[161] = 57; + + test_msg.ecdsa_signature_dep_a.signed_messages[162] = 34; + + test_msg.ecdsa_signature_dep_a.signed_messages[163] = 18; + + test_msg.ecdsa_signature_dep_a.signed_messages[164] = 85; + + test_msg.ecdsa_signature_dep_a.signed_messages[165] = 121; + + test_msg.ecdsa_signature_dep_a.signed_messages[166] = 137; + + test_msg.ecdsa_signature_dep_a.signed_messages[167] = 83; + + test_msg.ecdsa_signature_dep_a.signed_messages[168] = 111; + + test_msg.ecdsa_signature_dep_a.signed_messages[169] = 59; + + test_msg.ecdsa_signature_dep_a.signed_messages[170] = 7; + + test_msg.ecdsa_signature_dep_a.signed_messages[171] = 77; + + test_msg.ecdsa_signature_dep_a.signed_messages[172] = 4; + + test_msg.ecdsa_signature_dep_a.signed_messages[173] = 117; + + test_msg.ecdsa_signature_dep_a.signed_messages[174] = 159; + + test_msg.ecdsa_signature_dep_a.signed_messages[175] = 148; + + test_msg.ecdsa_signature_dep_a.signed_messages[176] = 35; + + test_msg.ecdsa_signature_dep_a.signed_messages[177] = 61; + + test_msg.ecdsa_signature_dep_a.signed_messages[178] = 41; + + test_msg.ecdsa_signature_dep_a.signed_messages[179] = 67; + + test_msg.ecdsa_signature_dep_a.signed_messages[180] = 46; + + test_msg.ecdsa_signature_dep_a.signed_messages[181] = 127; + + test_msg.ecdsa_signature_dep_a.signed_messages[182] = 75; + + test_msg.ecdsa_signature_dep_a.signed_messages[183] = 174; + + test_msg.ecdsa_signature_dep_a.stream_counter = 1; + + sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepA, 66, &test_msg, + &dummy_write); + + ck_assert_msg(dummy_wr == sizeof(encoded_frame), + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); + ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, + "frame was not encoded properly"); + + while (dummy_rd < dummy_wr) { + ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, + "sbp_process threw an error!"); + } + + ck_assert_msg(last_msg.n_callbacks_logged == 1, + "msg_callback: one callback should have been logged"); + ck_assert_msg(last_msg.sender_id == 66, + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepA, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[0] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[0], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[1] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[1], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[2] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[2], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.certificate_id[3] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.certificate_id[3], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.flags == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.flags, expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.flags); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.n_signed_messages == 184, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.n_signed_messages, " + "expected 184, is %d", + last_msg.msg.ecdsa_signature_dep_a.n_signed_messages); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.on_demand_counter == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.on_demand_counter, " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[0], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[1], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[2], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[3], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[3]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[4], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[4]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[5], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[5]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[6], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[6]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[7], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[7]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[8] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[8], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[8]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[9] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[9], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[9]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[10] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[10], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[10]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[11] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[11], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[11]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[12] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[12], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[12]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[13] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[13], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[13]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[14] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[14], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[14]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[15] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[15], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[15]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[16] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[16], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[16]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[17] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[17], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[17]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[18] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[18], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[18]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[19] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[19], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[19]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[20] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[20], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[20]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[21] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[21], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[21]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[22] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[22], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[22]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[23] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[23], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[23]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[24] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[24], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[24]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[25] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[25], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[25]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[26] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[26], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[26]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[27] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[27], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[27]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[28] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[28], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[28]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[29] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[29], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[29]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[30] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[30], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[30]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[31] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[31], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[31]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[32] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[32], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[32]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[33] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[33], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[33]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[34] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[34], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[34]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[35] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[35], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[35]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[36] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[36], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[36]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[37] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[37], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[37]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[38] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[38], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[38]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[39] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[39], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[39]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[40] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[40], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[40]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[41] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[41], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[41]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[42] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[42], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[42]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[43] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[43], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[43]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[44] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[44], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[44]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[45] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[45], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[45]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[46] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[46], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[46]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[47] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[47], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[47]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[48] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[48], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[48]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[49] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[49], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[49]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[50] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[50], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[50]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[51] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[51], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[51]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[52] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[52], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[52]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[53] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[53], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[53]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[54] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[54], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[54]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[55] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[55], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[55]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[56] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[56], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[56]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[57] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[57], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[57]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[58] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[58], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[58]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[59] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[59], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[59]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[60] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[60], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[60]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[61] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[61], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[61]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[62] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[62], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[62]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signature[63] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_a.signature[63], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signature[63]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[0] == 10, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[1] == 21, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[1], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[2] == 23, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[2], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[3] == 63, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[3], " + "expected 63, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[3]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[4] == 140, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[4], " + "expected 140, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[4]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[5] == 37, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[5], " + "expected 37, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[5]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[6] == 130, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[6], " + "expected 130, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[6]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[7] == 106, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[7], " + "expected 106, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[7]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[8] == 28, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[8], " + "expected 28, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[8]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[9] == 40, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[9], " + "expected 40, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[9]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[10] == 165, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[10], " + "expected 165, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[10]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[11] == 179, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[11], " + "expected 179, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[11]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[12] == 73, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[12], " + "expected 73, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[12]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[13] == 178, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[13], " + "expected 178, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[13]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[14] == 60, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[14], " + "expected 60, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[14]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[15] == 126, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[15], " + "expected 126, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[15]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[16] == 114, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[16], " + "expected 114, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[16]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[17] == 78, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[17], " + "expected 78, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[17]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[18] == 113, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[18], " + "expected 113, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[18]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[19] == 27, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[19], " + "expected 27, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[19]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[20] == 95, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[20], " + "expected 95, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[20]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[21] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[21], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[21]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[22] == 62, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[22], " + "expected 62, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[22]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[23] == 104, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[23], " + "expected 104, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[23]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[24] == 145, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[24], " + "expected 145, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[24]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[25] == 96, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[25], " + "expected 96, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[25]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[26] == 19, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[26], " + "expected 19, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[26]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[27] == 92, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[27], " + "expected 92, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[27]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[28] == 123, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[28], " + "expected 123, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[28]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[29] == 14, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[29], " + "expected 14, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[29]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[30] == 90, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[30], " + "expected 90, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[30]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[31] == 153, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[31], " + "expected 153, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[31]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[32] == 183, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[32], " + "expected 183, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[32]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[33] == 9, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[33], " + "expected 9, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[33]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[34] == 72, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[34], " + "expected 72, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[34]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[35] == 81, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[35], " + "expected 81, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[35]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[36] == 118, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[36], " + "expected 118, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[36]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[37] == 112, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[37], " + "expected 112, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[37]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[38] == 124, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[38], " + "expected 124, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[38]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[39] == 16, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[39], " + "expected 16, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[39]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[40] == 182, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[40], " + "expected 182, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[40]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[41] == 76, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[41], " + "expected 76, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[41]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[42] == 146, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[42], " + "expected 146, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[42]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[43] == 115, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[43], " + "expected 115, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[43]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[44] == 58, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[44], " + "expected 58, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[44]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[45] == 144, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[45], " + "expected 144, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[45]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[46] == 17, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[46], " + "expected 17, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[46]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[47] == 105, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[47], " + "expected 105, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[47]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[48] == 66, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[48], " + "expected 66, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[48]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[49] == 31, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[49], " + "expected 31, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[49]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[50] == 135, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[50], " + "expected 135, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[50]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[51] == 54, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[51], " + "expected 54, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[51]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[52] == 100, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[52], " + "expected 100, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[52]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[53] == 84, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[53], " + "expected 84, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[53]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[54] == 181, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[54], " + "expected 181, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[54]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[55] == 103, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[55], " + "expected 103, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[55]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[56] == 11, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[56], " + "expected 11, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[56]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[57] == 88, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[57], " + "expected 88, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[57]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[58] == 133, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[58], " + "expected 133, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[58]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[59] == 155, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[59], " + "expected 155, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[59]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[60] == 167, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[60], " + "expected 167, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[60]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[61] == 173, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[61], " + "expected 173, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[61]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[62] == 143, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[62], " + "expected 143, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[62]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[63] == 86, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[63], " + "expected 86, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[63]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[64] == 158, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[64], " + "expected 158, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[64]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[65] == 20, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[65], " + "expected 20, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[65]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[66] == 168, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[66], " + "expected 168, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[66]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[67] == 132, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[67], " + "expected 132, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[67]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[68] == 141, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[68], " + "expected 141, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[68]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[69] == 102, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[69], " + "expected 102, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[69]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[70] == 50, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[70], " + "expected 50, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[70]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[71] == 48, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[71], " + "expected 48, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[71]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[72] == 71, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[72], " + "expected 71, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[72]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[73] == 147, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[73], " + "expected 147, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[73]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[74] == 53, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[74], " + "expected 53, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[74]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[75] == 87, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[75], " + "expected 87, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[75]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[76] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[76], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[76]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[77] == 108, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[77], " + "expected 108, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[77]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[78] == 138, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[78], " + "expected 138, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[78]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[79] == 36, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[79], " + "expected 36, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[79]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[80] == 134, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[80], " + "expected 134, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[80]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[81] == 139, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[81], " + "expected 139, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[81]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[82] == 163, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[82], " + "expected 163, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[82]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[83] == 82, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[83], " + "expected 82, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[83]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[84] == 43, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[84], " + "expected 43, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[84]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[85] == 52, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[85], " + "expected 52, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[85]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[86] == 150, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[86], " + "expected 150, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[86]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[87] == 12, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[87], " + "expected 12, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[87]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[88] == 30, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[88], " + "expected 30, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[88]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[89] == 110, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[89], " + "expected 110, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[89]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[90] == 156, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[90], " + "expected 156, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[90]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[91] == 107, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[91], " + "expected 107, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[91]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[92] == 120, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[92], " + "expected 120, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[92]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[93] == 91, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[93], " + "expected 91, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[93]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[94] == 122, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[94], " + "expected 122, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[94]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[95] == 69, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[95], " + "expected 69, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[95]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[96] == 164, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[96], " + "expected 164, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[96]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[97] == 170, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[97], " + "expected 170, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[97]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[98] == 116, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[98], " + "expected 116, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[98]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[99] == 25, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[99], " + "expected 25, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[99]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[100] == 94, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[100], " + "expected 94, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[100]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[101] == 5, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[101], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[101]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[102] == 22, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[102], " + "expected 22, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[102]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[103] == 24, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[103], " + "expected 24, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[103]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[104] == 162, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[104], expected " + "162, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[104]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[105] == 175, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[105], expected " + "175, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[105]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[106] == 38, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[106], " + "expected 38, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[106]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[107] == 157, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[107], expected " + "157, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[107]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[108] == 98, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[108], " + "expected 98, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[108]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[109] == 44, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[109], " + "expected 44, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[109]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[110] == 160, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[110], expected " + "160, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[110]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[111] == 47, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[111], " + "expected 47, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[111]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[112] == 97, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[112], " + "expected 97, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[112]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[113] == 142, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[113], expected " + "142, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[113]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[114] == 8, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[114], " + "expected 8, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[114]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[115] == 74, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[115], " + "expected 74, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[115]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[116] == 13, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[116], " + "expected 13, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[116]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[117] == 177, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[117], expected " + "177, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[117]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[118] == 15, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[118], " + "expected 15, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[118]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[119] == 128, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[119], expected " + "128, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[119]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[120] == 26, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[120], " + "expected 26, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[120]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[121] == 131, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[121], expected " + "131, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[121]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[122] == 154, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[122], expected " + "154, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[122]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[123] == 65, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[123], " + "expected 65, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[123]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[124] == 169, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[124], expected " + "169, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[124]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[125] == 55, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[125], " + "expected 55, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[125]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[126] == 136, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[126], expected " + "136, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[126]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[127] == 125, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[127], expected " + "125, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[127]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[128] == 171, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[128], expected " + "171, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[128]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[129] == 161, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[129], expected " + "161, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[129]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[130] == 29, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[130], " + "expected 29, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[130]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[131] == 129, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[131], expected " + "129, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[131]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[132] == 151, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[132], expected " + "151, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[132]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[133] == 68, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[133], " + "expected 68, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[133]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[134] == 166, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[134], expected " + "166, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[134]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[135] == 51, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[135], " + "expected 51, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[135]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[136] == 70, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[136], " + "expected 70, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[136]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[137] == 45, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[137], " + "expected 45, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[137]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[138] == 56, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[138], " + "expected 56, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[138]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[139] == 79, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[139], " + "expected 79, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[139]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[140] == 149, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[140], expected " + "149, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[140]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[141] == 99, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[141], " + "expected 99, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[141]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[142] == 42, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[142], " + "expected 42, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[142]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[143] == 101, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[143], expected " + "101, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[143]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[144] == 152, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[144], expected " + "152, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[144]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[145] == 39, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[145], " + "expected 39, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[145]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[146] == 89, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[146], " + "expected 89, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[146]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[147] == 180, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[147], expected " + "180, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[147]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[148] == 64, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[148], " + "expected 64, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[148]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[149] == 49, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[149], " + "expected 49, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[149]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[150] == 6, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[150], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[150]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[151] == 80, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[151], " + "expected 80, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[151]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[152] == 172, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[152], expected " + "172, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[152]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[153] == 32, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[153], " + "expected 32, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[153]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[154] == 109, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[154], expected " + "109, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[154]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[155] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[155], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[155]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[156] == 119, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[156], expected " + "119, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[156]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[157] == 93, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[157], " + "expected 93, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[157]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[158] == 176, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[158], expected " + "176, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[158]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[159] == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[159], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[159]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[160] == 33, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[160], " + "expected 33, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[160]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[161] == 57, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[161], " + "expected 57, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[161]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[162] == 34, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[162], " + "expected 34, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[162]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[163] == 18, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[163], " + "expected 18, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[163]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[164] == 85, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[164], " + "expected 85, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[164]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[165] == 121, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[165], expected " + "121, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[165]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[166] == 137, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[166], expected " + "137, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[166]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[167] == 83, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[167], " + "expected 83, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[167]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[168] == 111, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[168], expected " + "111, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[168]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[169] == 59, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[169], " + "expected 59, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[169]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[170] == 7, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[170], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[170]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[171] == 77, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[171], " + "expected 77, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[171]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[172] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[172], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[172]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[173] == 117, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[173], expected " + "117, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[173]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[174] == 159, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[174], expected " + "159, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[174]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[175] == 148, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[175], expected " + "148, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[175]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[176] == 35, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[176], " + "expected 35, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[176]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[177] == 61, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[177], " + "expected 61, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[177]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[178] == 41, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[178], " + "expected 41, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[178]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[179] == 67, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[179], " + "expected 67, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[179]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[180] == 46, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[180], " + "expected 46, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[180]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[181] == 127, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[181], expected " + "127, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[181]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_a.signed_messages[182] == 75, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[182], " + "expected 75, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[182]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.signed_messages[183] == 174, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.signed_messages[183], expected " + "174, is %d", + last_msg.msg.ecdsa_signature_dep_a.signed_messages[183]); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_a.stream_counter == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_a.stream_counter, expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_a.stream_counter); + } +} +END_TEST + +Suite *auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepA"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); + tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignatureDepA); + suite_add_tcase(s, tc_acq); + return s; +} \ No newline at end of file diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c new file mode 100644 index 0000000000..a4f88b4cdb --- /dev/null +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c @@ -0,0 +1,740 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include // for debugging +#include // for malloc + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + sbp_msg_type_t msg_type; + sbp_msg_t msg; + void *context; +} last_msg; + +static u32 dummy_wr = 0; +static u32 dummy_rd = 0; +static u8 dummy_buff[1024]; +static void *last_io_context; + +static void *DUMMY_MEMORY_FOR_CALLBACKS = (void *)0xdeadbeef; +static void *DUMMY_MEMORY_FOR_IO = (void *)0xdead0000; + +static void dummy_reset() { + dummy_rd = dummy_wr = 0; + memset(dummy_buff, 0, sizeof(dummy_buff)); +} + +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return (s32)real_n; +} + +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return (s32)real_n; +} + +static void logging_reset() { memset(&last_msg, 0, sizeof(last_msg)); } + +static void msg_callback(u16 sender_id, sbp_msg_type_t msg_type, + const sbp_msg_t *msg, void *context) { + last_msg.n_callbacks_logged++; + last_msg.sender_id = sender_id; + last_msg.msg_type = msg_type; + last_msg.msg = *msg; + last_msg.context = context; +} + +START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignatureDepB) { + static sbp_msg_callbacks_node_t n; + + // State of the SBP message parser. + // Must be statically allocated. + sbp_state_t sbp_state; + + // + // Run tests: + // + // Test successful parsing of a message + { + // SBP parser state must be initialized before sbp_process is called. + // We re-initialize before every test so that callbacks for the same message + // types can be + // allocated multiple times across different tests. + sbp_state_init(&sbp_state); + + sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); + + logging_reset(); + + sbp_callback_register(&sbp_state, 0xC07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + + u8 encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; + + dummy_reset(); + + sbp_msg_t test_msg; + memset(&test_msg, 0, sizeof(test_msg)); + + test_msg.ecdsa_signature_dep_b.certificate_id[0] = 1; + + test_msg.ecdsa_signature_dep_b.certificate_id[1] = 2; + + test_msg.ecdsa_signature_dep_b.certificate_id[2] = 3; + + test_msg.ecdsa_signature_dep_b.certificate_id[3] = 4; + + test_msg.ecdsa_signature_dep_b.flags = 0; + + test_msg.ecdsa_signature_dep_b.n_signature_bytes = 72; + + test_msg.ecdsa_signature_dep_b.n_signed_messages = 3; + + test_msg.ecdsa_signature_dep_b.on_demand_counter = 2; + + test_msg.ecdsa_signature_dep_b.signature[0] = 0; + + test_msg.ecdsa_signature_dep_b.signature[1] = 1; + + test_msg.ecdsa_signature_dep_b.signature[2] = 2; + + test_msg.ecdsa_signature_dep_b.signature[3] = 3; + + test_msg.ecdsa_signature_dep_b.signature[4] = 4; + + test_msg.ecdsa_signature_dep_b.signature[5] = 5; + + test_msg.ecdsa_signature_dep_b.signature[6] = 6; + + test_msg.ecdsa_signature_dep_b.signature[7] = 7; + + test_msg.ecdsa_signature_dep_b.signature[8] = 8; + + test_msg.ecdsa_signature_dep_b.signature[9] = 9; + + test_msg.ecdsa_signature_dep_b.signature[10] = 10; + + test_msg.ecdsa_signature_dep_b.signature[11] = 11; + + test_msg.ecdsa_signature_dep_b.signature[12] = 12; + + test_msg.ecdsa_signature_dep_b.signature[13] = 13; + + test_msg.ecdsa_signature_dep_b.signature[14] = 14; + + test_msg.ecdsa_signature_dep_b.signature[15] = 15; + + test_msg.ecdsa_signature_dep_b.signature[16] = 16; + + test_msg.ecdsa_signature_dep_b.signature[17] = 17; + + test_msg.ecdsa_signature_dep_b.signature[18] = 18; + + test_msg.ecdsa_signature_dep_b.signature[19] = 19; + + test_msg.ecdsa_signature_dep_b.signature[20] = 20; + + test_msg.ecdsa_signature_dep_b.signature[21] = 21; + + test_msg.ecdsa_signature_dep_b.signature[22] = 22; + + test_msg.ecdsa_signature_dep_b.signature[23] = 23; + + test_msg.ecdsa_signature_dep_b.signature[24] = 24; + + test_msg.ecdsa_signature_dep_b.signature[25] = 25; + + test_msg.ecdsa_signature_dep_b.signature[26] = 26; + + test_msg.ecdsa_signature_dep_b.signature[27] = 27; + + test_msg.ecdsa_signature_dep_b.signature[28] = 28; + + test_msg.ecdsa_signature_dep_b.signature[29] = 29; + + test_msg.ecdsa_signature_dep_b.signature[30] = 30; + + test_msg.ecdsa_signature_dep_b.signature[31] = 31; + + test_msg.ecdsa_signature_dep_b.signature[32] = 32; + + test_msg.ecdsa_signature_dep_b.signature[33] = 33; + + test_msg.ecdsa_signature_dep_b.signature[34] = 34; + + test_msg.ecdsa_signature_dep_b.signature[35] = 35; + + test_msg.ecdsa_signature_dep_b.signature[36] = 36; + + test_msg.ecdsa_signature_dep_b.signature[37] = 37; + + test_msg.ecdsa_signature_dep_b.signature[38] = 38; + + test_msg.ecdsa_signature_dep_b.signature[39] = 39; + + test_msg.ecdsa_signature_dep_b.signature[40] = 40; + + test_msg.ecdsa_signature_dep_b.signature[41] = 41; + + test_msg.ecdsa_signature_dep_b.signature[42] = 42; + + test_msg.ecdsa_signature_dep_b.signature[43] = 43; + + test_msg.ecdsa_signature_dep_b.signature[44] = 44; + + test_msg.ecdsa_signature_dep_b.signature[45] = 45; + + test_msg.ecdsa_signature_dep_b.signature[46] = 46; + + test_msg.ecdsa_signature_dep_b.signature[47] = 47; + + test_msg.ecdsa_signature_dep_b.signature[48] = 48; + + test_msg.ecdsa_signature_dep_b.signature[49] = 49; + + test_msg.ecdsa_signature_dep_b.signature[50] = 50; + + test_msg.ecdsa_signature_dep_b.signature[51] = 51; + + test_msg.ecdsa_signature_dep_b.signature[52] = 52; + + test_msg.ecdsa_signature_dep_b.signature[53] = 53; + + test_msg.ecdsa_signature_dep_b.signature[54] = 54; + + test_msg.ecdsa_signature_dep_b.signature[55] = 55; + + test_msg.ecdsa_signature_dep_b.signature[56] = 56; + + test_msg.ecdsa_signature_dep_b.signature[57] = 57; + + test_msg.ecdsa_signature_dep_b.signature[58] = 58; + + test_msg.ecdsa_signature_dep_b.signature[59] = 59; + + test_msg.ecdsa_signature_dep_b.signature[60] = 60; + + test_msg.ecdsa_signature_dep_b.signature[61] = 61; + + test_msg.ecdsa_signature_dep_b.signature[62] = 62; + + test_msg.ecdsa_signature_dep_b.signature[63] = 63; + + test_msg.ecdsa_signature_dep_b.signature[64] = 64; + + test_msg.ecdsa_signature_dep_b.signature[65] = 65; + + test_msg.ecdsa_signature_dep_b.signature[66] = 66; + + test_msg.ecdsa_signature_dep_b.signature[67] = 67; + + test_msg.ecdsa_signature_dep_b.signature[68] = 68; + + test_msg.ecdsa_signature_dep_b.signature[69] = 69; + + test_msg.ecdsa_signature_dep_b.signature[70] = 70; + + test_msg.ecdsa_signature_dep_b.signature[71] = 71; + + test_msg.ecdsa_signature_dep_b.signed_messages[0] = 10; + + test_msg.ecdsa_signature_dep_b.signed_messages[1] = 21; + + test_msg.ecdsa_signature_dep_b.signed_messages[2] = 23; + + test_msg.ecdsa_signature_dep_b.stream_counter = 1; + + sbp_message_send(&sbp_state, SbpMsgEcdsaSignatureDepB, 66, &test_msg, + &dummy_write); + + ck_assert_msg(dummy_wr == sizeof(encoded_frame), + "not enough data was written to dummy_buff (expected: %zu, " + "actual: %zu)", + sizeof(encoded_frame), dummy_wr); + ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, + "frame was not encoded properly"); + + while (dummy_rd < dummy_wr) { + ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, + "sbp_process threw an error!"); + } + + ck_assert_msg(last_msg.n_callbacks_logged == 1, + "msg_callback: one callback should have been logged"); + ck_assert_msg(last_msg.sender_id == 66, + "msg_callback: sender_id decoded incorrectly"); + + ck_assert_msg(sbp_message_cmp(SbpMsgEcdsaSignatureDepB, &last_msg.msg, + &test_msg) == 0, + "Sent and received messages did not compare equal"); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[0] == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[0], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[1] == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[1], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[2] == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[2], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[2]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.certificate_id[3] == 4, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.certificate_id[3], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_b.certificate_id[3]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.flags == 0, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.flags, expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_b.flags); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes == 72, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes, " + "expected 72, is %d", + last_msg.msg.ecdsa_signature_dep_b.n_signature_bytes); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.n_signed_messages == 3, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.n_signed_messages, " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.n_signed_messages); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.on_demand_counter == 2, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.on_demand_counter, " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.on_demand_counter); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[0] == 0, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[0], " + "expected 0, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[0]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[1] == 1, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[1], " + "expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[1]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[2] == 2, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[2], " + "expected 2, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[2]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[3] == 3, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[3], " + "expected 3, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[3]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[4] == 4, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[4], " + "expected 4, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[4]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[5] == 5, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[5], " + "expected 5, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[5]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[6] == 6, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[6], " + "expected 6, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[6]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[7] == 7, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[7], " + "expected 7, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[7]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[8] == 8, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[8], " + "expected 8, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[8]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[9] == 9, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[9], " + "expected 9, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[9]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[10] == 10, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[10], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[10]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[11] == 11, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[11], " + "expected 11, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[11]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[12] == 12, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[12], " + "expected 12, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[12]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[13] == 13, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[13], " + "expected 13, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[13]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[14] == 14, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[14], " + "expected 14, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[14]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[15] == 15, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[15], " + "expected 15, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[15]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[16] == 16, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[16], " + "expected 16, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[16]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[17] == 17, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[17], " + "expected 17, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[17]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[18] == 18, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[18], " + "expected 18, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[18]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[19] == 19, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[19], " + "expected 19, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[19]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[20] == 20, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[20], " + "expected 20, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[20]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[21] == 21, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[21], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[21]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[22] == 22, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[22], " + "expected 22, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[22]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[23] == 23, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[23], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[23]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[24] == 24, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[24], " + "expected 24, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[24]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[25] == 25, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[25], " + "expected 25, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[25]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[26] == 26, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[26], " + "expected 26, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[26]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[27] == 27, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[27], " + "expected 27, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[27]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[28] == 28, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[28], " + "expected 28, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[28]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[29] == 29, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[29], " + "expected 29, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[29]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[30] == 30, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[30], " + "expected 30, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[30]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[31] == 31, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[31], " + "expected 31, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[31]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[32] == 32, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[32], " + "expected 32, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[32]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[33] == 33, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[33], " + "expected 33, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[33]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[34] == 34, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[34], " + "expected 34, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[34]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[35] == 35, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[35], " + "expected 35, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[35]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[36] == 36, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[36], " + "expected 36, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[36]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[37] == 37, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[37], " + "expected 37, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[37]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[38] == 38, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[38], " + "expected 38, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[38]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[39] == 39, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[39], " + "expected 39, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[39]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[40] == 40, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[40], " + "expected 40, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[40]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[41] == 41, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[41], " + "expected 41, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[41]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[42] == 42, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[42], " + "expected 42, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[42]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[43] == 43, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[43], " + "expected 43, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[43]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[44] == 44, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[44], " + "expected 44, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[44]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[45] == 45, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[45], " + "expected 45, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[45]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[46] == 46, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[46], " + "expected 46, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[46]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[47] == 47, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[47], " + "expected 47, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[47]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[48] == 48, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[48], " + "expected 48, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[48]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[49] == 49, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[49], " + "expected 49, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[49]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[50] == 50, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[50], " + "expected 50, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[50]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[51] == 51, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[51], " + "expected 51, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[51]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[52] == 52, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[52], " + "expected 52, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[52]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[53] == 53, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[53], " + "expected 53, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[53]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[54] == 54, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[54], " + "expected 54, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[54]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[55] == 55, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[55], " + "expected 55, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[55]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[56] == 56, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[56], " + "expected 56, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[56]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[57] == 57, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[57], " + "expected 57, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[57]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[58] == 58, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[58], " + "expected 58, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[58]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[59] == 59, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[59], " + "expected 59, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[59]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[60] == 60, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[60], " + "expected 60, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[60]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[61] == 61, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[61], " + "expected 61, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[61]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[62] == 62, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[62], " + "expected 62, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[62]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[63] == 63, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[63], " + "expected 63, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[63]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[64] == 64, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[64], " + "expected 64, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[64]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[65] == 65, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[65], " + "expected 65, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[65]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[66] == 66, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[66], " + "expected 66, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[66]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[67] == 67, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[67], " + "expected 67, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[67]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[68] == 68, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[68], " + "expected 68, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[68]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[69] == 69, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[69], " + "expected 69, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[69]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[70] == 70, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[70], " + "expected 70, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[70]); + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.signature[71] == 71, + "incorrect value for last_msg.msg.ecdsa_signature_dep_b.signature[71], " + "expected 71, is %d", + last_msg.msg.ecdsa_signature_dep_b.signature[71]); + + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[0] == 10, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[0], " + "expected 10, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[0]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[1] == 21, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[1], " + "expected 21, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[1]); + ck_assert_msg(last_msg.msg.ecdsa_signature_dep_b.signed_messages[2] == 23, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.signed_messages[2], " + "expected 23, is %d", + last_msg.msg.ecdsa_signature_dep_b.signed_messages[2]); + + ck_assert_msg( + last_msg.msg.ecdsa_signature_dep_b.stream_counter == 1, + "incorrect value for " + "last_msg.msg.ecdsa_signature_dep_b.stream_counter, expected 1, is %d", + last_msg.msg.ecdsa_signature_dep_b.stream_counter); + } +} +END_TEST + +Suite *auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + tcase_add_test(tc_acq, test_auto_check_sbp_signing_MsgEcdsaSignatureDepB); + suite_add_tcase(s, tc_acq); + return s; +} \ No newline at end of file diff --git a/c/test/check_main.c b/c/test/check_main.c index 43f862a2d2..68a6885a4f 100644 --- a/c/test/check_main.c +++ b/c/test/check_main.c @@ -116,9 +116,11 @@ int main(void) { srunner_add_suite(sr, auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgCertificateChain_suite()); + srunner_add_suite(sr, auto_check_sbp_signing_MsgCertificateChainDep_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaCertificate_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignature_suite()); - srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignatureDep_suite()); + srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite()); + srunner_add_suite(sr, auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); srunner_add_suite(sr, auto_check_sbp_signing_MsgEd25519SignatureDepA_suite()); diff --git a/c/test/check_main_legacy.c b/c/test/check_main_legacy.c index 15c515965f..08c7edda8b 100644 --- a/c/test/check_main_legacy.c +++ b/c/test/check_main_legacy.c @@ -154,12 +154,16 @@ int main(void) { sr, legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgCertificateChain_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite()); srunner_add_suite(sr, legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite()); - srunner_add_suite(sr, - legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite()); + srunner_add_suite( + sr, legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite()); srunner_add_suite( sr, legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite()); srunner_add_suite( diff --git a/c/test/check_suites.h b/c/test/check_suites.h index 2230dd5156..b7d0f28c07 100644 --- a/c/test/check_suites.h +++ b/c/test/check_suites.h @@ -101,9 +101,11 @@ Suite* auto_check_sbp_sbas_MsgSbasRaw_suite(void); Suite* auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void); Suite* auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void); Suite* auto_check_sbp_signing_MsgCertificateChain_suite(void); +Suite* auto_check_sbp_signing_MsgCertificateChainDep_suite(void); Suite* auto_check_sbp_signing_MsgEcdsaCertificate_suite(void); Suite* auto_check_sbp_signing_MsgEcdsaSignature_suite(void); -Suite* auto_check_sbp_signing_MsgEcdsaSignatureDep_suite(void); +Suite* auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void); +Suite* auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void); Suite* auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void); Suite* auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void); Suite* auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void); diff --git a/c/test/check_suites_legacy.h b/c/test/check_suites_legacy.h index 128cb3b3bf..10254c99e1 100644 --- a/c/test/check_suites_legacy.h +++ b/c/test/check_suites_legacy.h @@ -102,9 +102,11 @@ Suite* legacy_auto_check_sbp_sbas_MsgSbasRaw_suite(void); Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexDone_suite(void); Suite* legacy_auto_check_sbp_settings_MsgSettingsReadByIndexResp_suite(void); Suite* legacy_auto_check_sbp_signing_MsgCertificateChain_suite(void); +Suite* legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite(void); Suite* legacy_auto_check_sbp_signing_MsgEcdsaCertificate_suite(void); Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignature_suite(void); -Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep_suite(void); +Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void); +Suite* legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void); Suite* legacy_auto_check_sbp_signing_MsgEd25519CertificateDep_suite(void); Suite* legacy_auto_check_sbp_signing_MsgEd25519SignatureDepA_suite(void); Suite* legacy_auto_check_sbp_signing_MsgEd25519SignatureDepB_suite(void); diff --git a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc index f4cf92bb62..0c11ddad02 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChain.cc @@ -76,15 +76,15 @@ class Test_auto_check_sbp_signing_MsgCertificateChain0 TEST_F(Test_auto_check_sbp_signing_MsgCertificateChain0, Test) { uint8_t encoded_frame[] = { - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, }; sbp_msg_certificate_chain_t test_msg{}; @@ -216,133 +216,150 @@ TEST_F(Test_auto_check_sbp_signing_MsgCertificateChain0, Test) { test_msg.root_certificate[19] = 19; - test_msg.signature[0] = 0; + test_msg.signature.data[0] = 0; - test_msg.signature[1] = 1; + test_msg.signature.data[1] = 1; - test_msg.signature[2] = 2; + test_msg.signature.data[2] = 2; - test_msg.signature[3] = 3; + test_msg.signature.data[3] = 3; - test_msg.signature[4] = 4; + test_msg.signature.data[4] = 4; - test_msg.signature[5] = 5; + test_msg.signature.data[5] = 5; - test_msg.signature[6] = 6; + test_msg.signature.data[6] = 6; - test_msg.signature[7] = 7; + test_msg.signature.data[7] = 7; - test_msg.signature[8] = 0; + test_msg.signature.data[8] = 8; - test_msg.signature[9] = 1; + test_msg.signature.data[9] = 9; - test_msg.signature[10] = 2; + test_msg.signature.data[10] = 10; - test_msg.signature[11] = 3; + test_msg.signature.data[11] = 11; - test_msg.signature[12] = 4; + test_msg.signature.data[12] = 12; - test_msg.signature[13] = 5; + test_msg.signature.data[13] = 13; - test_msg.signature[14] = 6; + test_msg.signature.data[14] = 14; - test_msg.signature[15] = 7; + test_msg.signature.data[15] = 15; - test_msg.signature[16] = 0; + test_msg.signature.data[16] = 16; - test_msg.signature[17] = 1; + test_msg.signature.data[17] = 17; - test_msg.signature[18] = 2; + test_msg.signature.data[18] = 18; - test_msg.signature[19] = 3; + test_msg.signature.data[19] = 19; - test_msg.signature[20] = 4; + test_msg.signature.data[20] = 20; - test_msg.signature[21] = 5; + test_msg.signature.data[21] = 21; - test_msg.signature[22] = 6; + test_msg.signature.data[22] = 22; - test_msg.signature[23] = 7; + test_msg.signature.data[23] = 23; - test_msg.signature[24] = 0; + test_msg.signature.data[24] = 24; - test_msg.signature[25] = 1; + test_msg.signature.data[25] = 25; - test_msg.signature[26] = 2; + test_msg.signature.data[26] = 26; - test_msg.signature[27] = 3; + test_msg.signature.data[27] = 27; - test_msg.signature[28] = 4; + test_msg.signature.data[28] = 28; - test_msg.signature[29] = 5; + test_msg.signature.data[29] = 29; - test_msg.signature[30] = 6; + test_msg.signature.data[30] = 30; - test_msg.signature[31] = 7; + test_msg.signature.data[31] = 31; - test_msg.signature[32] = 0; + test_msg.signature.data[32] = 32; - test_msg.signature[33] = 1; + test_msg.signature.data[33] = 33; - test_msg.signature[34] = 2; + test_msg.signature.data[34] = 34; - test_msg.signature[35] = 3; + test_msg.signature.data[35] = 35; - test_msg.signature[36] = 4; + test_msg.signature.data[36] = 36; - test_msg.signature[37] = 5; + test_msg.signature.data[37] = 37; - test_msg.signature[38] = 6; + test_msg.signature.data[38] = 38; - test_msg.signature[39] = 7; + test_msg.signature.data[39] = 39; - test_msg.signature[40] = 0; + test_msg.signature.data[40] = 40; - test_msg.signature[41] = 1; + test_msg.signature.data[41] = 41; - test_msg.signature[42] = 2; + test_msg.signature.data[42] = 42; - test_msg.signature[43] = 3; + test_msg.signature.data[43] = 43; - test_msg.signature[44] = 4; + test_msg.signature.data[44] = 44; - test_msg.signature[45] = 5; + test_msg.signature.data[45] = 45; - test_msg.signature[46] = 6; + test_msg.signature.data[46] = 46; - test_msg.signature[47] = 7; + test_msg.signature.data[47] = 47; - test_msg.signature[48] = 0; + test_msg.signature.data[48] = 48; - test_msg.signature[49] = 1; + test_msg.signature.data[49] = 49; - test_msg.signature[50] = 2; + test_msg.signature.data[50] = 50; - test_msg.signature[51] = 3; + test_msg.signature.data[51] = 51; - test_msg.signature[52] = 4; + test_msg.signature.data[52] = 52; - test_msg.signature[53] = 5; + test_msg.signature.data[53] = 53; - test_msg.signature[54] = 6; + test_msg.signature.data[54] = 54; - test_msg.signature[55] = 7; + test_msg.signature.data[55] = 55; - test_msg.signature[56] = 0; + test_msg.signature.data[56] = 56; - test_msg.signature[57] = 1; + test_msg.signature.data[57] = 57; - test_msg.signature[58] = 2; + test_msg.signature.data[58] = 58; - test_msg.signature[59] = 3; + test_msg.signature.data[59] = 59; - test_msg.signature[60] = 4; + test_msg.signature.data[60] = 60; - test_msg.signature[61] = 5; + test_msg.signature.data[61] = 61; - test_msg.signature[62] = 6; + test_msg.signature.data[62] = 62; - test_msg.signature[63] = 7; + test_msg.signature.data[63] = 63; + + test_msg.signature.data[64] = 64; + + test_msg.signature.data[65] = 65; + + test_msg.signature.data[66] = 66; + + test_msg.signature.data[67] = 67; + + test_msg.signature.data[68] = 68; + + test_msg.signature.data[69] = 69; + + test_msg.signature.data[70] = 70; + + test_msg.signature.data[71] = 71; + test_msg.signature.len = 72; EXPECT_EQ(send_message(66, test_msg), SBP_OK); @@ -597,196 +614,223 @@ TEST_F(Test_auto_check_sbp_signing_MsgCertificateChain0, Test) { EXPECT_EQ(last_msg_.root_certificate[19], 19) << "incorrect value for last_msg_.root_certificate[19], expected 19, is " << last_msg_.root_certificate[19]; - EXPECT_EQ(last_msg_.signature[0], 0) - << "incorrect value for last_msg_.signature[0], expected 0, is " - << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) - << "incorrect value for last_msg_.signature[1], expected 1, is " - << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) - << "incorrect value for last_msg_.signature[2], expected 2, is " - << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) - << "incorrect value for last_msg_.signature[3], expected 3, is " - << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) - << "incorrect value for last_msg_.signature[4], expected 4, is " - << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) - << "incorrect value for last_msg_.signature[5], expected 5, is " - << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) - << "incorrect value for last_msg_.signature[6], expected 6, is " - << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) - << "incorrect value for last_msg_.signature[7], expected 7, is " - << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 0) - << "incorrect value for last_msg_.signature[8], expected 0, is " - << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 1) - << "incorrect value for last_msg_.signature[9], expected 1, is " - << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 2) - << "incorrect value for last_msg_.signature[10], expected 2, is " - << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 3) - << "incorrect value for last_msg_.signature[11], expected 3, is " - << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 4) - << "incorrect value for last_msg_.signature[12], expected 4, is " - << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 5) - << "incorrect value for last_msg_.signature[13], expected 5, is " - << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 6) - << "incorrect value for last_msg_.signature[14], expected 6, is " - << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 7) - << "incorrect value for last_msg_.signature[15], expected 7, is " - << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 0) - << "incorrect value for last_msg_.signature[16], expected 0, is " - << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 1) - << "incorrect value for last_msg_.signature[17], expected 1, is " - << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 2) - << "incorrect value for last_msg_.signature[18], expected 2, is " - << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 3) - << "incorrect value for last_msg_.signature[19], expected 3, is " - << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 4) - << "incorrect value for last_msg_.signature[20], expected 4, is " - << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 5) - << "incorrect value for last_msg_.signature[21], expected 5, is " - << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 6) - << "incorrect value for last_msg_.signature[22], expected 6, is " - << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 7) - << "incorrect value for last_msg_.signature[23], expected 7, is " - << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 0) - << "incorrect value for last_msg_.signature[24], expected 0, is " - << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 1) - << "incorrect value for last_msg_.signature[25], expected 1, is " - << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 2) - << "incorrect value for last_msg_.signature[26], expected 2, is " - << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 3) - << "incorrect value for last_msg_.signature[27], expected 3, is " - << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 4) - << "incorrect value for last_msg_.signature[28], expected 4, is " - << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 5) - << "incorrect value for last_msg_.signature[29], expected 5, is " - << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 6) - << "incorrect value for last_msg_.signature[30], expected 6, is " - << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 7) - << "incorrect value for last_msg_.signature[31], expected 7, is " - << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 0) - << "incorrect value for last_msg_.signature[32], expected 0, is " - << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 1) - << "incorrect value for last_msg_.signature[33], expected 1, is " - << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 2) - << "incorrect value for last_msg_.signature[34], expected 2, is " - << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 3) - << "incorrect value for last_msg_.signature[35], expected 3, is " - << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 4) - << "incorrect value for last_msg_.signature[36], expected 4, is " - << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 5) - << "incorrect value for last_msg_.signature[37], expected 5, is " - << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 6) - << "incorrect value for last_msg_.signature[38], expected 6, is " - << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 7) - << "incorrect value for last_msg_.signature[39], expected 7, is " - << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 0) - << "incorrect value for last_msg_.signature[40], expected 0, is " - << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 1) - << "incorrect value for last_msg_.signature[41], expected 1, is " - << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 2) - << "incorrect value for last_msg_.signature[42], expected 2, is " - << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 3) - << "incorrect value for last_msg_.signature[43], expected 3, is " - << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 4) - << "incorrect value for last_msg_.signature[44], expected 4, is " - << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 5) - << "incorrect value for last_msg_.signature[45], expected 5, is " - << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 6) - << "incorrect value for last_msg_.signature[46], expected 6, is " - << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 7) - << "incorrect value for last_msg_.signature[47], expected 7, is " - << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 0) - << "incorrect value for last_msg_.signature[48], expected 0, is " - << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 1) - << "incorrect value for last_msg_.signature[49], expected 1, is " - << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 2) - << "incorrect value for last_msg_.signature[50], expected 2, is " - << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 3) - << "incorrect value for last_msg_.signature[51], expected 3, is " - << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 4) - << "incorrect value for last_msg_.signature[52], expected 4, is " - << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 5) - << "incorrect value for last_msg_.signature[53], expected 5, is " - << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 6) - << "incorrect value for last_msg_.signature[54], expected 6, is " - << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 7) - << "incorrect value for last_msg_.signature[55], expected 7, is " - << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 0) - << "incorrect value for last_msg_.signature[56], expected 0, is " - << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 1) - << "incorrect value for last_msg_.signature[57], expected 1, is " - << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 2) - << "incorrect value for last_msg_.signature[58], expected 2, is " - << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 3) - << "incorrect value for last_msg_.signature[59], expected 3, is " - << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 4) - << "incorrect value for last_msg_.signature[60], expected 4, is " - << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 5) - << "incorrect value for last_msg_.signature[61], expected 5, is " - << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 6) - << "incorrect value for last_msg_.signature[62], expected 6, is " - << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 7) - << "incorrect value for last_msg_.signature[63], expected 7, is " - << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signature.data[0], 0) + << "incorrect value for last_msg_.signature.data[0], expected 0, is " + << last_msg_.signature.data[0]; + EXPECT_EQ(last_msg_.signature.data[1], 1) + << "incorrect value for last_msg_.signature.data[1], expected 1, is " + << last_msg_.signature.data[1]; + EXPECT_EQ(last_msg_.signature.data[2], 2) + << "incorrect value for last_msg_.signature.data[2], expected 2, is " + << last_msg_.signature.data[2]; + EXPECT_EQ(last_msg_.signature.data[3], 3) + << "incorrect value for last_msg_.signature.data[3], expected 3, is " + << last_msg_.signature.data[3]; + EXPECT_EQ(last_msg_.signature.data[4], 4) + << "incorrect value for last_msg_.signature.data[4], expected 4, is " + << last_msg_.signature.data[4]; + EXPECT_EQ(last_msg_.signature.data[5], 5) + << "incorrect value for last_msg_.signature.data[5], expected 5, is " + << last_msg_.signature.data[5]; + EXPECT_EQ(last_msg_.signature.data[6], 6) + << "incorrect value for last_msg_.signature.data[6], expected 6, is " + << last_msg_.signature.data[6]; + EXPECT_EQ(last_msg_.signature.data[7], 7) + << "incorrect value for last_msg_.signature.data[7], expected 7, is " + << last_msg_.signature.data[7]; + EXPECT_EQ(last_msg_.signature.data[8], 8) + << "incorrect value for last_msg_.signature.data[8], expected 8, is " + << last_msg_.signature.data[8]; + EXPECT_EQ(last_msg_.signature.data[9], 9) + << "incorrect value for last_msg_.signature.data[9], expected 9, is " + << last_msg_.signature.data[9]; + EXPECT_EQ(last_msg_.signature.data[10], 10) + << "incorrect value for last_msg_.signature.data[10], expected 10, is " + << last_msg_.signature.data[10]; + EXPECT_EQ(last_msg_.signature.data[11], 11) + << "incorrect value for last_msg_.signature.data[11], expected 11, is " + << last_msg_.signature.data[11]; + EXPECT_EQ(last_msg_.signature.data[12], 12) + << "incorrect value for last_msg_.signature.data[12], expected 12, is " + << last_msg_.signature.data[12]; + EXPECT_EQ(last_msg_.signature.data[13], 13) + << "incorrect value for last_msg_.signature.data[13], expected 13, is " + << last_msg_.signature.data[13]; + EXPECT_EQ(last_msg_.signature.data[14], 14) + << "incorrect value for last_msg_.signature.data[14], expected 14, is " + << last_msg_.signature.data[14]; + EXPECT_EQ(last_msg_.signature.data[15], 15) + << "incorrect value for last_msg_.signature.data[15], expected 15, is " + << last_msg_.signature.data[15]; + EXPECT_EQ(last_msg_.signature.data[16], 16) + << "incorrect value for last_msg_.signature.data[16], expected 16, is " + << last_msg_.signature.data[16]; + EXPECT_EQ(last_msg_.signature.data[17], 17) + << "incorrect value for last_msg_.signature.data[17], expected 17, is " + << last_msg_.signature.data[17]; + EXPECT_EQ(last_msg_.signature.data[18], 18) + << "incorrect value for last_msg_.signature.data[18], expected 18, is " + << last_msg_.signature.data[18]; + EXPECT_EQ(last_msg_.signature.data[19], 19) + << "incorrect value for last_msg_.signature.data[19], expected 19, is " + << last_msg_.signature.data[19]; + EXPECT_EQ(last_msg_.signature.data[20], 20) + << "incorrect value for last_msg_.signature.data[20], expected 20, is " + << last_msg_.signature.data[20]; + EXPECT_EQ(last_msg_.signature.data[21], 21) + << "incorrect value for last_msg_.signature.data[21], expected 21, is " + << last_msg_.signature.data[21]; + EXPECT_EQ(last_msg_.signature.data[22], 22) + << "incorrect value for last_msg_.signature.data[22], expected 22, is " + << last_msg_.signature.data[22]; + EXPECT_EQ(last_msg_.signature.data[23], 23) + << "incorrect value for last_msg_.signature.data[23], expected 23, is " + << last_msg_.signature.data[23]; + EXPECT_EQ(last_msg_.signature.data[24], 24) + << "incorrect value for last_msg_.signature.data[24], expected 24, is " + << last_msg_.signature.data[24]; + EXPECT_EQ(last_msg_.signature.data[25], 25) + << "incorrect value for last_msg_.signature.data[25], expected 25, is " + << last_msg_.signature.data[25]; + EXPECT_EQ(last_msg_.signature.data[26], 26) + << "incorrect value for last_msg_.signature.data[26], expected 26, is " + << last_msg_.signature.data[26]; + EXPECT_EQ(last_msg_.signature.data[27], 27) + << "incorrect value for last_msg_.signature.data[27], expected 27, is " + << last_msg_.signature.data[27]; + EXPECT_EQ(last_msg_.signature.data[28], 28) + << "incorrect value for last_msg_.signature.data[28], expected 28, is " + << last_msg_.signature.data[28]; + EXPECT_EQ(last_msg_.signature.data[29], 29) + << "incorrect value for last_msg_.signature.data[29], expected 29, is " + << last_msg_.signature.data[29]; + EXPECT_EQ(last_msg_.signature.data[30], 30) + << "incorrect value for last_msg_.signature.data[30], expected 30, is " + << last_msg_.signature.data[30]; + EXPECT_EQ(last_msg_.signature.data[31], 31) + << "incorrect value for last_msg_.signature.data[31], expected 31, is " + << last_msg_.signature.data[31]; + EXPECT_EQ(last_msg_.signature.data[32], 32) + << "incorrect value for last_msg_.signature.data[32], expected 32, is " + << last_msg_.signature.data[32]; + EXPECT_EQ(last_msg_.signature.data[33], 33) + << "incorrect value for last_msg_.signature.data[33], expected 33, is " + << last_msg_.signature.data[33]; + EXPECT_EQ(last_msg_.signature.data[34], 34) + << "incorrect value for last_msg_.signature.data[34], expected 34, is " + << last_msg_.signature.data[34]; + EXPECT_EQ(last_msg_.signature.data[35], 35) + << "incorrect value for last_msg_.signature.data[35], expected 35, is " + << last_msg_.signature.data[35]; + EXPECT_EQ(last_msg_.signature.data[36], 36) + << "incorrect value for last_msg_.signature.data[36], expected 36, is " + << last_msg_.signature.data[36]; + EXPECT_EQ(last_msg_.signature.data[37], 37) + << "incorrect value for last_msg_.signature.data[37], expected 37, is " + << last_msg_.signature.data[37]; + EXPECT_EQ(last_msg_.signature.data[38], 38) + << "incorrect value for last_msg_.signature.data[38], expected 38, is " + << last_msg_.signature.data[38]; + EXPECT_EQ(last_msg_.signature.data[39], 39) + << "incorrect value for last_msg_.signature.data[39], expected 39, is " + << last_msg_.signature.data[39]; + EXPECT_EQ(last_msg_.signature.data[40], 40) + << "incorrect value for last_msg_.signature.data[40], expected 40, is " + << last_msg_.signature.data[40]; + EXPECT_EQ(last_msg_.signature.data[41], 41) + << "incorrect value for last_msg_.signature.data[41], expected 41, is " + << last_msg_.signature.data[41]; + EXPECT_EQ(last_msg_.signature.data[42], 42) + << "incorrect value for last_msg_.signature.data[42], expected 42, is " + << last_msg_.signature.data[42]; + EXPECT_EQ(last_msg_.signature.data[43], 43) + << "incorrect value for last_msg_.signature.data[43], expected 43, is " + << last_msg_.signature.data[43]; + EXPECT_EQ(last_msg_.signature.data[44], 44) + << "incorrect value for last_msg_.signature.data[44], expected 44, is " + << last_msg_.signature.data[44]; + EXPECT_EQ(last_msg_.signature.data[45], 45) + << "incorrect value for last_msg_.signature.data[45], expected 45, is " + << last_msg_.signature.data[45]; + EXPECT_EQ(last_msg_.signature.data[46], 46) + << "incorrect value for last_msg_.signature.data[46], expected 46, is " + << last_msg_.signature.data[46]; + EXPECT_EQ(last_msg_.signature.data[47], 47) + << "incorrect value for last_msg_.signature.data[47], expected 47, is " + << last_msg_.signature.data[47]; + EXPECT_EQ(last_msg_.signature.data[48], 48) + << "incorrect value for last_msg_.signature.data[48], expected 48, is " + << last_msg_.signature.data[48]; + EXPECT_EQ(last_msg_.signature.data[49], 49) + << "incorrect value for last_msg_.signature.data[49], expected 49, is " + << last_msg_.signature.data[49]; + EXPECT_EQ(last_msg_.signature.data[50], 50) + << "incorrect value for last_msg_.signature.data[50], expected 50, is " + << last_msg_.signature.data[50]; + EXPECT_EQ(last_msg_.signature.data[51], 51) + << "incorrect value for last_msg_.signature.data[51], expected 51, is " + << last_msg_.signature.data[51]; + EXPECT_EQ(last_msg_.signature.data[52], 52) + << "incorrect value for last_msg_.signature.data[52], expected 52, is " + << last_msg_.signature.data[52]; + EXPECT_EQ(last_msg_.signature.data[53], 53) + << "incorrect value for last_msg_.signature.data[53], expected 53, is " + << last_msg_.signature.data[53]; + EXPECT_EQ(last_msg_.signature.data[54], 54) + << "incorrect value for last_msg_.signature.data[54], expected 54, is " + << last_msg_.signature.data[54]; + EXPECT_EQ(last_msg_.signature.data[55], 55) + << "incorrect value for last_msg_.signature.data[55], expected 55, is " + << last_msg_.signature.data[55]; + EXPECT_EQ(last_msg_.signature.data[56], 56) + << "incorrect value for last_msg_.signature.data[56], expected 56, is " + << last_msg_.signature.data[56]; + EXPECT_EQ(last_msg_.signature.data[57], 57) + << "incorrect value for last_msg_.signature.data[57], expected 57, is " + << last_msg_.signature.data[57]; + EXPECT_EQ(last_msg_.signature.data[58], 58) + << "incorrect value for last_msg_.signature.data[58], expected 58, is " + << last_msg_.signature.data[58]; + EXPECT_EQ(last_msg_.signature.data[59], 59) + << "incorrect value for last_msg_.signature.data[59], expected 59, is " + << last_msg_.signature.data[59]; + EXPECT_EQ(last_msg_.signature.data[60], 60) + << "incorrect value for last_msg_.signature.data[60], expected 60, is " + << last_msg_.signature.data[60]; + EXPECT_EQ(last_msg_.signature.data[61], 61) + << "incorrect value for last_msg_.signature.data[61], expected 61, is " + << last_msg_.signature.data[61]; + EXPECT_EQ(last_msg_.signature.data[62], 62) + << "incorrect value for last_msg_.signature.data[62], expected 62, is " + << last_msg_.signature.data[62]; + EXPECT_EQ(last_msg_.signature.data[63], 63) + << "incorrect value for last_msg_.signature.data[63], expected 63, is " + << last_msg_.signature.data[63]; + EXPECT_EQ(last_msg_.signature.data[64], 64) + << "incorrect value for last_msg_.signature.data[64], expected 64, is " + << last_msg_.signature.data[64]; + EXPECT_EQ(last_msg_.signature.data[65], 65) + << "incorrect value for last_msg_.signature.data[65], expected 65, is " + << last_msg_.signature.data[65]; + EXPECT_EQ(last_msg_.signature.data[66], 66) + << "incorrect value for last_msg_.signature.data[66], expected 66, is " + << last_msg_.signature.data[66]; + EXPECT_EQ(last_msg_.signature.data[67], 67) + << "incorrect value for last_msg_.signature.data[67], expected 67, is " + << last_msg_.signature.data[67]; + EXPECT_EQ(last_msg_.signature.data[68], 68) + << "incorrect value for last_msg_.signature.data[68], expected 68, is " + << last_msg_.signature.data[68]; + EXPECT_EQ(last_msg_.signature.data[69], 69) + << "incorrect value for last_msg_.signature.data[69], expected 69, is " + << last_msg_.signature.data[69]; + EXPECT_EQ(last_msg_.signature.data[70], 70) + << "incorrect value for last_msg_.signature.data[70], expected 70, is " + << last_msg_.signature.data[70]; + EXPECT_EQ(last_msg_.signature.data[71], 71) + << "incorrect value for last_msg_.signature.data[71], expected 71, is " + << last_msg_.signature.data[71]; + EXPECT_EQ(last_msg_.signature.len, 72) + << "incorrect value for last_msg_.signature.len, expected 72, is " + << last_msg_.signature.len; } diff --git a/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc new file mode 100644 index 0000000000..d35bc09dad --- /dev/null +++ b/c/test/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc @@ -0,0 +1,792 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include +#include +class Test_auto_check_sbp_signing_MsgCertificateChainDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgCertificateChainDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), + last_msg_(), + last_msg_len_(), + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { + set_reader(this); + set_writer(this); + } + + s32 read(uint8_t *buf, const uint32_t n) override { + uint32_t real_n = n; + memcpy(buf, dummy_buff_ + dummy_rd_, real_n); + dummy_rd_ += real_n; + return (s32)real_n; + } + + s32 write(const uint8_t *buf, uint32_t n) override { + uint32_t real_n = n; + memcpy(dummy_buff_ + dummy_wr_, buf, real_n); + dummy_wr_ += real_n; + return (s32)real_n; + } + + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_certificate_chain_dep_t &msg) override { + last_msg_ = msg; + last_sender_id_ = sender_id; + n_callbacks_logged_++; + } + + sbp_msg_certificate_chain_dep_t last_msg_; + uint8_t last_msg_len_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; + uint32_t dummy_wr_; + uint32_t dummy_rd_; + uint8_t dummy_buff_[1024]; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgCertificateChainDep0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + sbp_msg_certificate_chain_dep_t test_msg{}; + + test_msg.corrections_certificate[0] = 20; + + test_msg.corrections_certificate[1] = 21; + + test_msg.corrections_certificate[2] = 22; + + test_msg.corrections_certificate[3] = 23; + + test_msg.corrections_certificate[4] = 24; + + test_msg.corrections_certificate[5] = 25; + + test_msg.corrections_certificate[6] = 26; + + test_msg.corrections_certificate[7] = 27; + + test_msg.corrections_certificate[8] = 28; + + test_msg.corrections_certificate[9] = 29; + + test_msg.corrections_certificate[10] = 10; + + test_msg.corrections_certificate[11] = 11; + + test_msg.corrections_certificate[12] = 12; + + test_msg.corrections_certificate[13] = 13; + + test_msg.corrections_certificate[14] = 14; + + test_msg.corrections_certificate[15] = 15; + + test_msg.corrections_certificate[16] = 16; + + test_msg.corrections_certificate[17] = 17; + + test_msg.corrections_certificate[18] = 18; + + test_msg.corrections_certificate[19] = 19; + test_msg.expiration.day = 30; + test_msg.expiration.hours = 12; + test_msg.expiration.minutes = 34; + test_msg.expiration.month = 3; + test_msg.expiration.ns = 123456789; + test_msg.expiration.seconds = 59; + test_msg.expiration.year = 2024; + + test_msg.intermediate_certificate[0] = 10; + + test_msg.intermediate_certificate[1] = 11; + + test_msg.intermediate_certificate[2] = 12; + + test_msg.intermediate_certificate[3] = 13; + + test_msg.intermediate_certificate[4] = 14; + + test_msg.intermediate_certificate[5] = 15; + + test_msg.intermediate_certificate[6] = 16; + + test_msg.intermediate_certificate[7] = 17; + + test_msg.intermediate_certificate[8] = 18; + + test_msg.intermediate_certificate[9] = 19; + + test_msg.intermediate_certificate[10] = 0; + + test_msg.intermediate_certificate[11] = 1; + + test_msg.intermediate_certificate[12] = 2; + + test_msg.intermediate_certificate[13] = 3; + + test_msg.intermediate_certificate[14] = 4; + + test_msg.intermediate_certificate[15] = 5; + + test_msg.intermediate_certificate[16] = 6; + + test_msg.intermediate_certificate[17] = 7; + + test_msg.intermediate_certificate[18] = 8; + + test_msg.intermediate_certificate[19] = 9; + + test_msg.root_certificate[0] = 0; + + test_msg.root_certificate[1] = 1; + + test_msg.root_certificate[2] = 2; + + test_msg.root_certificate[3] = 3; + + test_msg.root_certificate[4] = 4; + + test_msg.root_certificate[5] = 5; + + test_msg.root_certificate[6] = 6; + + test_msg.root_certificate[7] = 7; + + test_msg.root_certificate[8] = 8; + + test_msg.root_certificate[9] = 9; + + test_msg.root_certificate[10] = 10; + + test_msg.root_certificate[11] = 11; + + test_msg.root_certificate[12] = 12; + + test_msg.root_certificate[13] = 13; + + test_msg.root_certificate[14] = 14; + + test_msg.root_certificate[15] = 15; + + test_msg.root_certificate[16] = 16; + + test_msg.root_certificate[17] = 17; + + test_msg.root_certificate[18] = 18; + + test_msg.root_certificate[19] = 19; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 0; + + test_msg.signature[9] = 1; + + test_msg.signature[10] = 2; + + test_msg.signature[11] = 3; + + test_msg.signature[12] = 4; + + test_msg.signature[13] = 5; + + test_msg.signature[14] = 6; + + test_msg.signature[15] = 7; + + test_msg.signature[16] = 0; + + test_msg.signature[17] = 1; + + test_msg.signature[18] = 2; + + test_msg.signature[19] = 3; + + test_msg.signature[20] = 4; + + test_msg.signature[21] = 5; + + test_msg.signature[22] = 6; + + test_msg.signature[23] = 7; + + test_msg.signature[24] = 0; + + test_msg.signature[25] = 1; + + test_msg.signature[26] = 2; + + test_msg.signature[27] = 3; + + test_msg.signature[28] = 4; + + test_msg.signature[29] = 5; + + test_msg.signature[30] = 6; + + test_msg.signature[31] = 7; + + test_msg.signature[32] = 0; + + test_msg.signature[33] = 1; + + test_msg.signature[34] = 2; + + test_msg.signature[35] = 3; + + test_msg.signature[36] = 4; + + test_msg.signature[37] = 5; + + test_msg.signature[38] = 6; + + test_msg.signature[39] = 7; + + test_msg.signature[40] = 0; + + test_msg.signature[41] = 1; + + test_msg.signature[42] = 2; + + test_msg.signature[43] = 3; + + test_msg.signature[44] = 4; + + test_msg.signature[45] = 5; + + test_msg.signature[46] = 6; + + test_msg.signature[47] = 7; + + test_msg.signature[48] = 0; + + test_msg.signature[49] = 1; + + test_msg.signature[50] = 2; + + test_msg.signature[51] = 3; + + test_msg.signature[52] = 4; + + test_msg.signature[53] = 5; + + test_msg.signature[54] = 6; + + test_msg.signature[55] = 7; + + test_msg.signature[56] = 0; + + test_msg.signature[57] = 1; + + test_msg.signature[58] = 2; + + test_msg.signature[59] = 3; + + test_msg.signature[60] = 4; + + test_msg.signature[61] = 5; + + test_msg.signature[62] = 6; + + test_msg.signature[63] = 7; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.corrections_certificate[0], 20) + << "incorrect value for last_msg_.corrections_certificate[0], expected " + "20, is " + << last_msg_.corrections_certificate[0]; + EXPECT_EQ(last_msg_.corrections_certificate[1], 21) + << "incorrect value for last_msg_.corrections_certificate[1], expected " + "21, is " + << last_msg_.corrections_certificate[1]; + EXPECT_EQ(last_msg_.corrections_certificate[2], 22) + << "incorrect value for last_msg_.corrections_certificate[2], expected " + "22, is " + << last_msg_.corrections_certificate[2]; + EXPECT_EQ(last_msg_.corrections_certificate[3], 23) + << "incorrect value for last_msg_.corrections_certificate[3], expected " + "23, is " + << last_msg_.corrections_certificate[3]; + EXPECT_EQ(last_msg_.corrections_certificate[4], 24) + << "incorrect value for last_msg_.corrections_certificate[4], expected " + "24, is " + << last_msg_.corrections_certificate[4]; + EXPECT_EQ(last_msg_.corrections_certificate[5], 25) + << "incorrect value for last_msg_.corrections_certificate[5], expected " + "25, is " + << last_msg_.corrections_certificate[5]; + EXPECT_EQ(last_msg_.corrections_certificate[6], 26) + << "incorrect value for last_msg_.corrections_certificate[6], expected " + "26, is " + << last_msg_.corrections_certificate[6]; + EXPECT_EQ(last_msg_.corrections_certificate[7], 27) + << "incorrect value for last_msg_.corrections_certificate[7], expected " + "27, is " + << last_msg_.corrections_certificate[7]; + EXPECT_EQ(last_msg_.corrections_certificate[8], 28) + << "incorrect value for last_msg_.corrections_certificate[8], expected " + "28, is " + << last_msg_.corrections_certificate[8]; + EXPECT_EQ(last_msg_.corrections_certificate[9], 29) + << "incorrect value for last_msg_.corrections_certificate[9], expected " + "29, is " + << last_msg_.corrections_certificate[9]; + EXPECT_EQ(last_msg_.corrections_certificate[10], 10) + << "incorrect value for last_msg_.corrections_certificate[10], expected " + "10, is " + << last_msg_.corrections_certificate[10]; + EXPECT_EQ(last_msg_.corrections_certificate[11], 11) + << "incorrect value for last_msg_.corrections_certificate[11], expected " + "11, is " + << last_msg_.corrections_certificate[11]; + EXPECT_EQ(last_msg_.corrections_certificate[12], 12) + << "incorrect value for last_msg_.corrections_certificate[12], expected " + "12, is " + << last_msg_.corrections_certificate[12]; + EXPECT_EQ(last_msg_.corrections_certificate[13], 13) + << "incorrect value for last_msg_.corrections_certificate[13], expected " + "13, is " + << last_msg_.corrections_certificate[13]; + EXPECT_EQ(last_msg_.corrections_certificate[14], 14) + << "incorrect value for last_msg_.corrections_certificate[14], expected " + "14, is " + << last_msg_.corrections_certificate[14]; + EXPECT_EQ(last_msg_.corrections_certificate[15], 15) + << "incorrect value for last_msg_.corrections_certificate[15], expected " + "15, is " + << last_msg_.corrections_certificate[15]; + EXPECT_EQ(last_msg_.corrections_certificate[16], 16) + << "incorrect value for last_msg_.corrections_certificate[16], expected " + "16, is " + << last_msg_.corrections_certificate[16]; + EXPECT_EQ(last_msg_.corrections_certificate[17], 17) + << "incorrect value for last_msg_.corrections_certificate[17], expected " + "17, is " + << last_msg_.corrections_certificate[17]; + EXPECT_EQ(last_msg_.corrections_certificate[18], 18) + << "incorrect value for last_msg_.corrections_certificate[18], expected " + "18, is " + << last_msg_.corrections_certificate[18]; + EXPECT_EQ(last_msg_.corrections_certificate[19], 19) + << "incorrect value for last_msg_.corrections_certificate[19], expected " + "19, is " + << last_msg_.corrections_certificate[19]; + EXPECT_EQ(last_msg_.expiration.day, 30) + << "incorrect value for last_msg_.expiration.day, expected 30, is " + << last_msg_.expiration.day; + EXPECT_EQ(last_msg_.expiration.hours, 12) + << "incorrect value for last_msg_.expiration.hours, expected 12, is " + << last_msg_.expiration.hours; + EXPECT_EQ(last_msg_.expiration.minutes, 34) + << "incorrect value for last_msg_.expiration.minutes, expected 34, is " + << last_msg_.expiration.minutes; + EXPECT_EQ(last_msg_.expiration.month, 3) + << "incorrect value for last_msg_.expiration.month, expected 3, is " + << last_msg_.expiration.month; + EXPECT_EQ(last_msg_.expiration.ns, 123456789) + << "incorrect value for last_msg_.expiration.ns, expected 123456789, is " + << last_msg_.expiration.ns; + EXPECT_EQ(last_msg_.expiration.seconds, 59) + << "incorrect value for last_msg_.expiration.seconds, expected 59, is " + << last_msg_.expiration.seconds; + EXPECT_EQ(last_msg_.expiration.year, 2024) + << "incorrect value for last_msg_.expiration.year, expected 2024, is " + << last_msg_.expiration.year; + EXPECT_EQ(last_msg_.intermediate_certificate[0], 10) + << "incorrect value for last_msg_.intermediate_certificate[0], expected " + "10, is " + << last_msg_.intermediate_certificate[0]; + EXPECT_EQ(last_msg_.intermediate_certificate[1], 11) + << "incorrect value for last_msg_.intermediate_certificate[1], expected " + "11, is " + << last_msg_.intermediate_certificate[1]; + EXPECT_EQ(last_msg_.intermediate_certificate[2], 12) + << "incorrect value for last_msg_.intermediate_certificate[2], expected " + "12, is " + << last_msg_.intermediate_certificate[2]; + EXPECT_EQ(last_msg_.intermediate_certificate[3], 13) + << "incorrect value for last_msg_.intermediate_certificate[3], expected " + "13, is " + << last_msg_.intermediate_certificate[3]; + EXPECT_EQ(last_msg_.intermediate_certificate[4], 14) + << "incorrect value for last_msg_.intermediate_certificate[4], expected " + "14, is " + << last_msg_.intermediate_certificate[4]; + EXPECT_EQ(last_msg_.intermediate_certificate[5], 15) + << "incorrect value for last_msg_.intermediate_certificate[5], expected " + "15, is " + << last_msg_.intermediate_certificate[5]; + EXPECT_EQ(last_msg_.intermediate_certificate[6], 16) + << "incorrect value for last_msg_.intermediate_certificate[6], expected " + "16, is " + << last_msg_.intermediate_certificate[6]; + EXPECT_EQ(last_msg_.intermediate_certificate[7], 17) + << "incorrect value for last_msg_.intermediate_certificate[7], expected " + "17, is " + << last_msg_.intermediate_certificate[7]; + EXPECT_EQ(last_msg_.intermediate_certificate[8], 18) + << "incorrect value for last_msg_.intermediate_certificate[8], expected " + "18, is " + << last_msg_.intermediate_certificate[8]; + EXPECT_EQ(last_msg_.intermediate_certificate[9], 19) + << "incorrect value for last_msg_.intermediate_certificate[9], expected " + "19, is " + << last_msg_.intermediate_certificate[9]; + EXPECT_EQ(last_msg_.intermediate_certificate[10], 0) + << "incorrect value for last_msg_.intermediate_certificate[10], expected " + "0, is " + << last_msg_.intermediate_certificate[10]; + EXPECT_EQ(last_msg_.intermediate_certificate[11], 1) + << "incorrect value for last_msg_.intermediate_certificate[11], expected " + "1, is " + << last_msg_.intermediate_certificate[11]; + EXPECT_EQ(last_msg_.intermediate_certificate[12], 2) + << "incorrect value for last_msg_.intermediate_certificate[12], expected " + "2, is " + << last_msg_.intermediate_certificate[12]; + EXPECT_EQ(last_msg_.intermediate_certificate[13], 3) + << "incorrect value for last_msg_.intermediate_certificate[13], expected " + "3, is " + << last_msg_.intermediate_certificate[13]; + EXPECT_EQ(last_msg_.intermediate_certificate[14], 4) + << "incorrect value for last_msg_.intermediate_certificate[14], expected " + "4, is " + << last_msg_.intermediate_certificate[14]; + EXPECT_EQ(last_msg_.intermediate_certificate[15], 5) + << "incorrect value for last_msg_.intermediate_certificate[15], expected " + "5, is " + << last_msg_.intermediate_certificate[15]; + EXPECT_EQ(last_msg_.intermediate_certificate[16], 6) + << "incorrect value for last_msg_.intermediate_certificate[16], expected " + "6, is " + << last_msg_.intermediate_certificate[16]; + EXPECT_EQ(last_msg_.intermediate_certificate[17], 7) + << "incorrect value for last_msg_.intermediate_certificate[17], expected " + "7, is " + << last_msg_.intermediate_certificate[17]; + EXPECT_EQ(last_msg_.intermediate_certificate[18], 8) + << "incorrect value for last_msg_.intermediate_certificate[18], expected " + "8, is " + << last_msg_.intermediate_certificate[18]; + EXPECT_EQ(last_msg_.intermediate_certificate[19], 9) + << "incorrect value for last_msg_.intermediate_certificate[19], expected " + "9, is " + << last_msg_.intermediate_certificate[19]; + EXPECT_EQ(last_msg_.root_certificate[0], 0) + << "incorrect value for last_msg_.root_certificate[0], expected 0, is " + << last_msg_.root_certificate[0]; + EXPECT_EQ(last_msg_.root_certificate[1], 1) + << "incorrect value for last_msg_.root_certificate[1], expected 1, is " + << last_msg_.root_certificate[1]; + EXPECT_EQ(last_msg_.root_certificate[2], 2) + << "incorrect value for last_msg_.root_certificate[2], expected 2, is " + << last_msg_.root_certificate[2]; + EXPECT_EQ(last_msg_.root_certificate[3], 3) + << "incorrect value for last_msg_.root_certificate[3], expected 3, is " + << last_msg_.root_certificate[3]; + EXPECT_EQ(last_msg_.root_certificate[4], 4) + << "incorrect value for last_msg_.root_certificate[4], expected 4, is " + << last_msg_.root_certificate[4]; + EXPECT_EQ(last_msg_.root_certificate[5], 5) + << "incorrect value for last_msg_.root_certificate[5], expected 5, is " + << last_msg_.root_certificate[5]; + EXPECT_EQ(last_msg_.root_certificate[6], 6) + << "incorrect value for last_msg_.root_certificate[6], expected 6, is " + << last_msg_.root_certificate[6]; + EXPECT_EQ(last_msg_.root_certificate[7], 7) + << "incorrect value for last_msg_.root_certificate[7], expected 7, is " + << last_msg_.root_certificate[7]; + EXPECT_EQ(last_msg_.root_certificate[8], 8) + << "incorrect value for last_msg_.root_certificate[8], expected 8, is " + << last_msg_.root_certificate[8]; + EXPECT_EQ(last_msg_.root_certificate[9], 9) + << "incorrect value for last_msg_.root_certificate[9], expected 9, is " + << last_msg_.root_certificate[9]; + EXPECT_EQ(last_msg_.root_certificate[10], 10) + << "incorrect value for last_msg_.root_certificate[10], expected 10, is " + << last_msg_.root_certificate[10]; + EXPECT_EQ(last_msg_.root_certificate[11], 11) + << "incorrect value for last_msg_.root_certificate[11], expected 11, is " + << last_msg_.root_certificate[11]; + EXPECT_EQ(last_msg_.root_certificate[12], 12) + << "incorrect value for last_msg_.root_certificate[12], expected 12, is " + << last_msg_.root_certificate[12]; + EXPECT_EQ(last_msg_.root_certificate[13], 13) + << "incorrect value for last_msg_.root_certificate[13], expected 13, is " + << last_msg_.root_certificate[13]; + EXPECT_EQ(last_msg_.root_certificate[14], 14) + << "incorrect value for last_msg_.root_certificate[14], expected 14, is " + << last_msg_.root_certificate[14]; + EXPECT_EQ(last_msg_.root_certificate[15], 15) + << "incorrect value for last_msg_.root_certificate[15], expected 15, is " + << last_msg_.root_certificate[15]; + EXPECT_EQ(last_msg_.root_certificate[16], 16) + << "incorrect value for last_msg_.root_certificate[16], expected 16, is " + << last_msg_.root_certificate[16]; + EXPECT_EQ(last_msg_.root_certificate[17], 17) + << "incorrect value for last_msg_.root_certificate[17], expected 17, is " + << last_msg_.root_certificate[17]; + EXPECT_EQ(last_msg_.root_certificate[18], 18) + << "incorrect value for last_msg_.root_certificate[18], expected 18, is " + << last_msg_.root_certificate[18]; + EXPECT_EQ(last_msg_.root_certificate[19], 19) + << "incorrect value for last_msg_.root_certificate[19], expected 19, is " + << last_msg_.root_certificate[19]; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 0) + << "incorrect value for last_msg_.signature[8], expected 0, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 1) + << "incorrect value for last_msg_.signature[9], expected 1, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 2) + << "incorrect value for last_msg_.signature[10], expected 2, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 3) + << "incorrect value for last_msg_.signature[11], expected 3, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 4) + << "incorrect value for last_msg_.signature[12], expected 4, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 5) + << "incorrect value for last_msg_.signature[13], expected 5, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 6) + << "incorrect value for last_msg_.signature[14], expected 6, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 7) + << "incorrect value for last_msg_.signature[15], expected 7, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 0) + << "incorrect value for last_msg_.signature[16], expected 0, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 1) + << "incorrect value for last_msg_.signature[17], expected 1, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 2) + << "incorrect value for last_msg_.signature[18], expected 2, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 3) + << "incorrect value for last_msg_.signature[19], expected 3, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 4) + << "incorrect value for last_msg_.signature[20], expected 4, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 5) + << "incorrect value for last_msg_.signature[21], expected 5, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 6) + << "incorrect value for last_msg_.signature[22], expected 6, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 7) + << "incorrect value for last_msg_.signature[23], expected 7, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 0) + << "incorrect value for last_msg_.signature[24], expected 0, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 1) + << "incorrect value for last_msg_.signature[25], expected 1, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 2) + << "incorrect value for last_msg_.signature[26], expected 2, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 3) + << "incorrect value for last_msg_.signature[27], expected 3, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 4) + << "incorrect value for last_msg_.signature[28], expected 4, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 5) + << "incorrect value for last_msg_.signature[29], expected 5, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 6) + << "incorrect value for last_msg_.signature[30], expected 6, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 7) + << "incorrect value for last_msg_.signature[31], expected 7, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 0) + << "incorrect value for last_msg_.signature[32], expected 0, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 1) + << "incorrect value for last_msg_.signature[33], expected 1, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 2) + << "incorrect value for last_msg_.signature[34], expected 2, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 3) + << "incorrect value for last_msg_.signature[35], expected 3, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 4) + << "incorrect value for last_msg_.signature[36], expected 4, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 5) + << "incorrect value for last_msg_.signature[37], expected 5, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 6) + << "incorrect value for last_msg_.signature[38], expected 6, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 7) + << "incorrect value for last_msg_.signature[39], expected 7, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 0) + << "incorrect value for last_msg_.signature[40], expected 0, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 1) + << "incorrect value for last_msg_.signature[41], expected 1, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 2) + << "incorrect value for last_msg_.signature[42], expected 2, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 3) + << "incorrect value for last_msg_.signature[43], expected 3, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 4) + << "incorrect value for last_msg_.signature[44], expected 4, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 5) + << "incorrect value for last_msg_.signature[45], expected 5, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 6) + << "incorrect value for last_msg_.signature[46], expected 6, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 7) + << "incorrect value for last_msg_.signature[47], expected 7, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 0) + << "incorrect value for last_msg_.signature[48], expected 0, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 1) + << "incorrect value for last_msg_.signature[49], expected 1, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 2) + << "incorrect value for last_msg_.signature[50], expected 2, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 3) + << "incorrect value for last_msg_.signature[51], expected 3, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 4) + << "incorrect value for last_msg_.signature[52], expected 4, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 5) + << "incorrect value for last_msg_.signature[53], expected 5, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 6) + << "incorrect value for last_msg_.signature[54], expected 6, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 7) + << "incorrect value for last_msg_.signature[55], expected 7, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 0) + << "incorrect value for last_msg_.signature[56], expected 0, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 1) + << "incorrect value for last_msg_.signature[57], expected 1, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 2) + << "incorrect value for last_msg_.signature[58], expected 2, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 3) + << "incorrect value for last_msg_.signature[59], expected 3, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 4) + << "incorrect value for last_msg_.signature[60], expected 4, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 5) + << "incorrect value for last_msg_.signature[61], expected 5, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 6) + << "incorrect value for last_msg_.signature[62], expected 6, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 7) + << "incorrect value for last_msg_.signature[63], expected 7, is " + << last_msg_.signature[63]; +} diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc index 1b686892d9..56a0027c1f 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc @@ -76,12 +76,12 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignature0 TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { uint8_t encoded_frame[] = { - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, }; sbp_msg_ecdsa_signature_t test_msg{}; @@ -94,153 +94,152 @@ TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { test_msg.certificate_id[3] = 4; test_msg.flags = 0; - test_msg.n_signature_bytes = 72; - test_msg.n_signed_messages = 3; test_msg.on_demand_counter = 2; - test_msg.signature[0] = 0; + test_msg.signature.data[0] = 0; - test_msg.signature[1] = 1; + test_msg.signature.data[1] = 1; - test_msg.signature[2] = 2; + test_msg.signature.data[2] = 2; - test_msg.signature[3] = 3; + test_msg.signature.data[3] = 3; - test_msg.signature[4] = 4; + test_msg.signature.data[4] = 4; - test_msg.signature[5] = 5; + test_msg.signature.data[5] = 5; - test_msg.signature[6] = 6; + test_msg.signature.data[6] = 6; - test_msg.signature[7] = 7; + test_msg.signature.data[7] = 7; - test_msg.signature[8] = 8; + test_msg.signature.data[8] = 8; - test_msg.signature[9] = 9; + test_msg.signature.data[9] = 9; - test_msg.signature[10] = 10; + test_msg.signature.data[10] = 10; - test_msg.signature[11] = 11; + test_msg.signature.data[11] = 11; - test_msg.signature[12] = 12; + test_msg.signature.data[12] = 12; - test_msg.signature[13] = 13; + test_msg.signature.data[13] = 13; - test_msg.signature[14] = 14; + test_msg.signature.data[14] = 14; - test_msg.signature[15] = 15; + test_msg.signature.data[15] = 15; - test_msg.signature[16] = 16; + test_msg.signature.data[16] = 16; - test_msg.signature[17] = 17; + test_msg.signature.data[17] = 17; - test_msg.signature[18] = 18; + test_msg.signature.data[18] = 18; - test_msg.signature[19] = 19; + test_msg.signature.data[19] = 19; - test_msg.signature[20] = 20; + test_msg.signature.data[20] = 20; - test_msg.signature[21] = 21; + test_msg.signature.data[21] = 21; - test_msg.signature[22] = 22; + test_msg.signature.data[22] = 22; - test_msg.signature[23] = 23; + test_msg.signature.data[23] = 23; - test_msg.signature[24] = 24; + test_msg.signature.data[24] = 24; - test_msg.signature[25] = 25; + test_msg.signature.data[25] = 25; - test_msg.signature[26] = 26; + test_msg.signature.data[26] = 26; - test_msg.signature[27] = 27; + test_msg.signature.data[27] = 27; - test_msg.signature[28] = 28; + test_msg.signature.data[28] = 28; - test_msg.signature[29] = 29; + test_msg.signature.data[29] = 29; - test_msg.signature[30] = 30; + test_msg.signature.data[30] = 30; - test_msg.signature[31] = 31; + test_msg.signature.data[31] = 31; - test_msg.signature[32] = 32; + test_msg.signature.data[32] = 32; - test_msg.signature[33] = 33; + test_msg.signature.data[33] = 33; - test_msg.signature[34] = 34; + test_msg.signature.data[34] = 34; - test_msg.signature[35] = 35; + test_msg.signature.data[35] = 35; - test_msg.signature[36] = 36; + test_msg.signature.data[36] = 36; - test_msg.signature[37] = 37; + test_msg.signature.data[37] = 37; - test_msg.signature[38] = 38; + test_msg.signature.data[38] = 38; - test_msg.signature[39] = 39; + test_msg.signature.data[39] = 39; - test_msg.signature[40] = 40; + test_msg.signature.data[40] = 40; - test_msg.signature[41] = 41; + test_msg.signature.data[41] = 41; - test_msg.signature[42] = 42; + test_msg.signature.data[42] = 42; - test_msg.signature[43] = 43; + test_msg.signature.data[43] = 43; - test_msg.signature[44] = 44; + test_msg.signature.data[44] = 44; - test_msg.signature[45] = 45; + test_msg.signature.data[45] = 45; - test_msg.signature[46] = 46; + test_msg.signature.data[46] = 46; - test_msg.signature[47] = 47; + test_msg.signature.data[47] = 47; - test_msg.signature[48] = 48; + test_msg.signature.data[48] = 48; - test_msg.signature[49] = 49; + test_msg.signature.data[49] = 49; - test_msg.signature[50] = 50; + test_msg.signature.data[50] = 50; - test_msg.signature[51] = 51; + test_msg.signature.data[51] = 51; - test_msg.signature[52] = 52; + test_msg.signature.data[52] = 52; - test_msg.signature[53] = 53; + test_msg.signature.data[53] = 53; - test_msg.signature[54] = 54; + test_msg.signature.data[54] = 54; - test_msg.signature[55] = 55; + test_msg.signature.data[55] = 55; - test_msg.signature[56] = 56; + test_msg.signature.data[56] = 56; - test_msg.signature[57] = 57; + test_msg.signature.data[57] = 57; - test_msg.signature[58] = 58; + test_msg.signature.data[58] = 58; - test_msg.signature[59] = 59; + test_msg.signature.data[59] = 59; - test_msg.signature[60] = 60; + test_msg.signature.data[60] = 60; - test_msg.signature[61] = 61; + test_msg.signature.data[61] = 61; - test_msg.signature[62] = 62; + test_msg.signature.data[62] = 62; - test_msg.signature[63] = 63; + test_msg.signature.data[63] = 63; - test_msg.signature[64] = 64; + test_msg.signature.data[64] = 64; - test_msg.signature[65] = 65; + test_msg.signature.data[65] = 65; - test_msg.signature[66] = 66; + test_msg.signature.data[66] = 66; - test_msg.signature[67] = 67; + test_msg.signature.data[67] = 67; - test_msg.signature[68] = 68; + test_msg.signature.data[68] = 68; - test_msg.signature[69] = 69; + test_msg.signature.data[69] = 69; - test_msg.signature[70] = 70; + test_msg.signature.data[70] = 70; - test_msg.signature[71] = 71; + test_msg.signature.data[71] = 71; + test_msg.signature.len = 72; test_msg.signed_messages[0] = 10; @@ -276,231 +275,228 @@ TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; - EXPECT_EQ(last_msg_.n_signature_bytes, 72) - << "incorrect value for last_msg_.n_signature_bytes, expected 72, is " - << last_msg_.n_signature_bytes; - EXPECT_EQ(last_msg_.n_signed_messages, 3) - << "incorrect value for last_msg_.n_signed_messages, expected 3, is " - << last_msg_.n_signed_messages; EXPECT_EQ(last_msg_.on_demand_counter, 2) << "incorrect value for last_msg_.on_demand_counter, expected 2, is " << last_msg_.on_demand_counter; - EXPECT_EQ(last_msg_.signature[0], 0) - << "incorrect value for last_msg_.signature[0], expected 0, is " - << last_msg_.signature[0]; - EXPECT_EQ(last_msg_.signature[1], 1) - << "incorrect value for last_msg_.signature[1], expected 1, is " - << last_msg_.signature[1]; - EXPECT_EQ(last_msg_.signature[2], 2) - << "incorrect value for last_msg_.signature[2], expected 2, is " - << last_msg_.signature[2]; - EXPECT_EQ(last_msg_.signature[3], 3) - << "incorrect value for last_msg_.signature[3], expected 3, is " - << last_msg_.signature[3]; - EXPECT_EQ(last_msg_.signature[4], 4) - << "incorrect value for last_msg_.signature[4], expected 4, is " - << last_msg_.signature[4]; - EXPECT_EQ(last_msg_.signature[5], 5) - << "incorrect value for last_msg_.signature[5], expected 5, is " - << last_msg_.signature[5]; - EXPECT_EQ(last_msg_.signature[6], 6) - << "incorrect value for last_msg_.signature[6], expected 6, is " - << last_msg_.signature[6]; - EXPECT_EQ(last_msg_.signature[7], 7) - << "incorrect value for last_msg_.signature[7], expected 7, is " - << last_msg_.signature[7]; - EXPECT_EQ(last_msg_.signature[8], 8) - << "incorrect value for last_msg_.signature[8], expected 8, is " - << last_msg_.signature[8]; - EXPECT_EQ(last_msg_.signature[9], 9) - << "incorrect value for last_msg_.signature[9], expected 9, is " - << last_msg_.signature[9]; - EXPECT_EQ(last_msg_.signature[10], 10) - << "incorrect value for last_msg_.signature[10], expected 10, is " - << last_msg_.signature[10]; - EXPECT_EQ(last_msg_.signature[11], 11) - << "incorrect value for last_msg_.signature[11], expected 11, is " - << last_msg_.signature[11]; - EXPECT_EQ(last_msg_.signature[12], 12) - << "incorrect value for last_msg_.signature[12], expected 12, is " - << last_msg_.signature[12]; - EXPECT_EQ(last_msg_.signature[13], 13) - << "incorrect value for last_msg_.signature[13], expected 13, is " - << last_msg_.signature[13]; - EXPECT_EQ(last_msg_.signature[14], 14) - << "incorrect value for last_msg_.signature[14], expected 14, is " - << last_msg_.signature[14]; - EXPECT_EQ(last_msg_.signature[15], 15) - << "incorrect value for last_msg_.signature[15], expected 15, is " - << last_msg_.signature[15]; - EXPECT_EQ(last_msg_.signature[16], 16) - << "incorrect value for last_msg_.signature[16], expected 16, is " - << last_msg_.signature[16]; - EXPECT_EQ(last_msg_.signature[17], 17) - << "incorrect value for last_msg_.signature[17], expected 17, is " - << last_msg_.signature[17]; - EXPECT_EQ(last_msg_.signature[18], 18) - << "incorrect value for last_msg_.signature[18], expected 18, is " - << last_msg_.signature[18]; - EXPECT_EQ(last_msg_.signature[19], 19) - << "incorrect value for last_msg_.signature[19], expected 19, is " - << last_msg_.signature[19]; - EXPECT_EQ(last_msg_.signature[20], 20) - << "incorrect value for last_msg_.signature[20], expected 20, is " - << last_msg_.signature[20]; - EXPECT_EQ(last_msg_.signature[21], 21) - << "incorrect value for last_msg_.signature[21], expected 21, is " - << last_msg_.signature[21]; - EXPECT_EQ(last_msg_.signature[22], 22) - << "incorrect value for last_msg_.signature[22], expected 22, is " - << last_msg_.signature[22]; - EXPECT_EQ(last_msg_.signature[23], 23) - << "incorrect value for last_msg_.signature[23], expected 23, is " - << last_msg_.signature[23]; - EXPECT_EQ(last_msg_.signature[24], 24) - << "incorrect value for last_msg_.signature[24], expected 24, is " - << last_msg_.signature[24]; - EXPECT_EQ(last_msg_.signature[25], 25) - << "incorrect value for last_msg_.signature[25], expected 25, is " - << last_msg_.signature[25]; - EXPECT_EQ(last_msg_.signature[26], 26) - << "incorrect value for last_msg_.signature[26], expected 26, is " - << last_msg_.signature[26]; - EXPECT_EQ(last_msg_.signature[27], 27) - << "incorrect value for last_msg_.signature[27], expected 27, is " - << last_msg_.signature[27]; - EXPECT_EQ(last_msg_.signature[28], 28) - << "incorrect value for last_msg_.signature[28], expected 28, is " - << last_msg_.signature[28]; - EXPECT_EQ(last_msg_.signature[29], 29) - << "incorrect value for last_msg_.signature[29], expected 29, is " - << last_msg_.signature[29]; - EXPECT_EQ(last_msg_.signature[30], 30) - << "incorrect value for last_msg_.signature[30], expected 30, is " - << last_msg_.signature[30]; - EXPECT_EQ(last_msg_.signature[31], 31) - << "incorrect value for last_msg_.signature[31], expected 31, is " - << last_msg_.signature[31]; - EXPECT_EQ(last_msg_.signature[32], 32) - << "incorrect value for last_msg_.signature[32], expected 32, is " - << last_msg_.signature[32]; - EXPECT_EQ(last_msg_.signature[33], 33) - << "incorrect value for last_msg_.signature[33], expected 33, is " - << last_msg_.signature[33]; - EXPECT_EQ(last_msg_.signature[34], 34) - << "incorrect value for last_msg_.signature[34], expected 34, is " - << last_msg_.signature[34]; - EXPECT_EQ(last_msg_.signature[35], 35) - << "incorrect value for last_msg_.signature[35], expected 35, is " - << last_msg_.signature[35]; - EXPECT_EQ(last_msg_.signature[36], 36) - << "incorrect value for last_msg_.signature[36], expected 36, is " - << last_msg_.signature[36]; - EXPECT_EQ(last_msg_.signature[37], 37) - << "incorrect value for last_msg_.signature[37], expected 37, is " - << last_msg_.signature[37]; - EXPECT_EQ(last_msg_.signature[38], 38) - << "incorrect value for last_msg_.signature[38], expected 38, is " - << last_msg_.signature[38]; - EXPECT_EQ(last_msg_.signature[39], 39) - << "incorrect value for last_msg_.signature[39], expected 39, is " - << last_msg_.signature[39]; - EXPECT_EQ(last_msg_.signature[40], 40) - << "incorrect value for last_msg_.signature[40], expected 40, is " - << last_msg_.signature[40]; - EXPECT_EQ(last_msg_.signature[41], 41) - << "incorrect value for last_msg_.signature[41], expected 41, is " - << last_msg_.signature[41]; - EXPECT_EQ(last_msg_.signature[42], 42) - << "incorrect value for last_msg_.signature[42], expected 42, is " - << last_msg_.signature[42]; - EXPECT_EQ(last_msg_.signature[43], 43) - << "incorrect value for last_msg_.signature[43], expected 43, is " - << last_msg_.signature[43]; - EXPECT_EQ(last_msg_.signature[44], 44) - << "incorrect value for last_msg_.signature[44], expected 44, is " - << last_msg_.signature[44]; - EXPECT_EQ(last_msg_.signature[45], 45) - << "incorrect value for last_msg_.signature[45], expected 45, is " - << last_msg_.signature[45]; - EXPECT_EQ(last_msg_.signature[46], 46) - << "incorrect value for last_msg_.signature[46], expected 46, is " - << last_msg_.signature[46]; - EXPECT_EQ(last_msg_.signature[47], 47) - << "incorrect value for last_msg_.signature[47], expected 47, is " - << last_msg_.signature[47]; - EXPECT_EQ(last_msg_.signature[48], 48) - << "incorrect value for last_msg_.signature[48], expected 48, is " - << last_msg_.signature[48]; - EXPECT_EQ(last_msg_.signature[49], 49) - << "incorrect value for last_msg_.signature[49], expected 49, is " - << last_msg_.signature[49]; - EXPECT_EQ(last_msg_.signature[50], 50) - << "incorrect value for last_msg_.signature[50], expected 50, is " - << last_msg_.signature[50]; - EXPECT_EQ(last_msg_.signature[51], 51) - << "incorrect value for last_msg_.signature[51], expected 51, is " - << last_msg_.signature[51]; - EXPECT_EQ(last_msg_.signature[52], 52) - << "incorrect value for last_msg_.signature[52], expected 52, is " - << last_msg_.signature[52]; - EXPECT_EQ(last_msg_.signature[53], 53) - << "incorrect value for last_msg_.signature[53], expected 53, is " - << last_msg_.signature[53]; - EXPECT_EQ(last_msg_.signature[54], 54) - << "incorrect value for last_msg_.signature[54], expected 54, is " - << last_msg_.signature[54]; - EXPECT_EQ(last_msg_.signature[55], 55) - << "incorrect value for last_msg_.signature[55], expected 55, is " - << last_msg_.signature[55]; - EXPECT_EQ(last_msg_.signature[56], 56) - << "incorrect value for last_msg_.signature[56], expected 56, is " - << last_msg_.signature[56]; - EXPECT_EQ(last_msg_.signature[57], 57) - << "incorrect value for last_msg_.signature[57], expected 57, is " - << last_msg_.signature[57]; - EXPECT_EQ(last_msg_.signature[58], 58) - << "incorrect value for last_msg_.signature[58], expected 58, is " - << last_msg_.signature[58]; - EXPECT_EQ(last_msg_.signature[59], 59) - << "incorrect value for last_msg_.signature[59], expected 59, is " - << last_msg_.signature[59]; - EXPECT_EQ(last_msg_.signature[60], 60) - << "incorrect value for last_msg_.signature[60], expected 60, is " - << last_msg_.signature[60]; - EXPECT_EQ(last_msg_.signature[61], 61) - << "incorrect value for last_msg_.signature[61], expected 61, is " - << last_msg_.signature[61]; - EXPECT_EQ(last_msg_.signature[62], 62) - << "incorrect value for last_msg_.signature[62], expected 62, is " - << last_msg_.signature[62]; - EXPECT_EQ(last_msg_.signature[63], 63) - << "incorrect value for last_msg_.signature[63], expected 63, is " - << last_msg_.signature[63]; - EXPECT_EQ(last_msg_.signature[64], 64) - << "incorrect value for last_msg_.signature[64], expected 64, is " - << last_msg_.signature[64]; - EXPECT_EQ(last_msg_.signature[65], 65) - << "incorrect value for last_msg_.signature[65], expected 65, is " - << last_msg_.signature[65]; - EXPECT_EQ(last_msg_.signature[66], 66) - << "incorrect value for last_msg_.signature[66], expected 66, is " - << last_msg_.signature[66]; - EXPECT_EQ(last_msg_.signature[67], 67) - << "incorrect value for last_msg_.signature[67], expected 67, is " - << last_msg_.signature[67]; - EXPECT_EQ(last_msg_.signature[68], 68) - << "incorrect value for last_msg_.signature[68], expected 68, is " - << last_msg_.signature[68]; - EXPECT_EQ(last_msg_.signature[69], 69) - << "incorrect value for last_msg_.signature[69], expected 69, is " - << last_msg_.signature[69]; - EXPECT_EQ(last_msg_.signature[70], 70) - << "incorrect value for last_msg_.signature[70], expected 70, is " - << last_msg_.signature[70]; - EXPECT_EQ(last_msg_.signature[71], 71) - << "incorrect value for last_msg_.signature[71], expected 71, is " - << last_msg_.signature[71]; + EXPECT_EQ(last_msg_.signature.data[0], 0) + << "incorrect value for last_msg_.signature.data[0], expected 0, is " + << last_msg_.signature.data[0]; + EXPECT_EQ(last_msg_.signature.data[1], 1) + << "incorrect value for last_msg_.signature.data[1], expected 1, is " + << last_msg_.signature.data[1]; + EXPECT_EQ(last_msg_.signature.data[2], 2) + << "incorrect value for last_msg_.signature.data[2], expected 2, is " + << last_msg_.signature.data[2]; + EXPECT_EQ(last_msg_.signature.data[3], 3) + << "incorrect value for last_msg_.signature.data[3], expected 3, is " + << last_msg_.signature.data[3]; + EXPECT_EQ(last_msg_.signature.data[4], 4) + << "incorrect value for last_msg_.signature.data[4], expected 4, is " + << last_msg_.signature.data[4]; + EXPECT_EQ(last_msg_.signature.data[5], 5) + << "incorrect value for last_msg_.signature.data[5], expected 5, is " + << last_msg_.signature.data[5]; + EXPECT_EQ(last_msg_.signature.data[6], 6) + << "incorrect value for last_msg_.signature.data[6], expected 6, is " + << last_msg_.signature.data[6]; + EXPECT_EQ(last_msg_.signature.data[7], 7) + << "incorrect value for last_msg_.signature.data[7], expected 7, is " + << last_msg_.signature.data[7]; + EXPECT_EQ(last_msg_.signature.data[8], 8) + << "incorrect value for last_msg_.signature.data[8], expected 8, is " + << last_msg_.signature.data[8]; + EXPECT_EQ(last_msg_.signature.data[9], 9) + << "incorrect value for last_msg_.signature.data[9], expected 9, is " + << last_msg_.signature.data[9]; + EXPECT_EQ(last_msg_.signature.data[10], 10) + << "incorrect value for last_msg_.signature.data[10], expected 10, is " + << last_msg_.signature.data[10]; + EXPECT_EQ(last_msg_.signature.data[11], 11) + << "incorrect value for last_msg_.signature.data[11], expected 11, is " + << last_msg_.signature.data[11]; + EXPECT_EQ(last_msg_.signature.data[12], 12) + << "incorrect value for last_msg_.signature.data[12], expected 12, is " + << last_msg_.signature.data[12]; + EXPECT_EQ(last_msg_.signature.data[13], 13) + << "incorrect value for last_msg_.signature.data[13], expected 13, is " + << last_msg_.signature.data[13]; + EXPECT_EQ(last_msg_.signature.data[14], 14) + << "incorrect value for last_msg_.signature.data[14], expected 14, is " + << last_msg_.signature.data[14]; + EXPECT_EQ(last_msg_.signature.data[15], 15) + << "incorrect value for last_msg_.signature.data[15], expected 15, is " + << last_msg_.signature.data[15]; + EXPECT_EQ(last_msg_.signature.data[16], 16) + << "incorrect value for last_msg_.signature.data[16], expected 16, is " + << last_msg_.signature.data[16]; + EXPECT_EQ(last_msg_.signature.data[17], 17) + << "incorrect value for last_msg_.signature.data[17], expected 17, is " + << last_msg_.signature.data[17]; + EXPECT_EQ(last_msg_.signature.data[18], 18) + << "incorrect value for last_msg_.signature.data[18], expected 18, is " + << last_msg_.signature.data[18]; + EXPECT_EQ(last_msg_.signature.data[19], 19) + << "incorrect value for last_msg_.signature.data[19], expected 19, is " + << last_msg_.signature.data[19]; + EXPECT_EQ(last_msg_.signature.data[20], 20) + << "incorrect value for last_msg_.signature.data[20], expected 20, is " + << last_msg_.signature.data[20]; + EXPECT_EQ(last_msg_.signature.data[21], 21) + << "incorrect value for last_msg_.signature.data[21], expected 21, is " + << last_msg_.signature.data[21]; + EXPECT_EQ(last_msg_.signature.data[22], 22) + << "incorrect value for last_msg_.signature.data[22], expected 22, is " + << last_msg_.signature.data[22]; + EXPECT_EQ(last_msg_.signature.data[23], 23) + << "incorrect value for last_msg_.signature.data[23], expected 23, is " + << last_msg_.signature.data[23]; + EXPECT_EQ(last_msg_.signature.data[24], 24) + << "incorrect value for last_msg_.signature.data[24], expected 24, is " + << last_msg_.signature.data[24]; + EXPECT_EQ(last_msg_.signature.data[25], 25) + << "incorrect value for last_msg_.signature.data[25], expected 25, is " + << last_msg_.signature.data[25]; + EXPECT_EQ(last_msg_.signature.data[26], 26) + << "incorrect value for last_msg_.signature.data[26], expected 26, is " + << last_msg_.signature.data[26]; + EXPECT_EQ(last_msg_.signature.data[27], 27) + << "incorrect value for last_msg_.signature.data[27], expected 27, is " + << last_msg_.signature.data[27]; + EXPECT_EQ(last_msg_.signature.data[28], 28) + << "incorrect value for last_msg_.signature.data[28], expected 28, is " + << last_msg_.signature.data[28]; + EXPECT_EQ(last_msg_.signature.data[29], 29) + << "incorrect value for last_msg_.signature.data[29], expected 29, is " + << last_msg_.signature.data[29]; + EXPECT_EQ(last_msg_.signature.data[30], 30) + << "incorrect value for last_msg_.signature.data[30], expected 30, is " + << last_msg_.signature.data[30]; + EXPECT_EQ(last_msg_.signature.data[31], 31) + << "incorrect value for last_msg_.signature.data[31], expected 31, is " + << last_msg_.signature.data[31]; + EXPECT_EQ(last_msg_.signature.data[32], 32) + << "incorrect value for last_msg_.signature.data[32], expected 32, is " + << last_msg_.signature.data[32]; + EXPECT_EQ(last_msg_.signature.data[33], 33) + << "incorrect value for last_msg_.signature.data[33], expected 33, is " + << last_msg_.signature.data[33]; + EXPECT_EQ(last_msg_.signature.data[34], 34) + << "incorrect value for last_msg_.signature.data[34], expected 34, is " + << last_msg_.signature.data[34]; + EXPECT_EQ(last_msg_.signature.data[35], 35) + << "incorrect value for last_msg_.signature.data[35], expected 35, is " + << last_msg_.signature.data[35]; + EXPECT_EQ(last_msg_.signature.data[36], 36) + << "incorrect value for last_msg_.signature.data[36], expected 36, is " + << last_msg_.signature.data[36]; + EXPECT_EQ(last_msg_.signature.data[37], 37) + << "incorrect value for last_msg_.signature.data[37], expected 37, is " + << last_msg_.signature.data[37]; + EXPECT_EQ(last_msg_.signature.data[38], 38) + << "incorrect value for last_msg_.signature.data[38], expected 38, is " + << last_msg_.signature.data[38]; + EXPECT_EQ(last_msg_.signature.data[39], 39) + << "incorrect value for last_msg_.signature.data[39], expected 39, is " + << last_msg_.signature.data[39]; + EXPECT_EQ(last_msg_.signature.data[40], 40) + << "incorrect value for last_msg_.signature.data[40], expected 40, is " + << last_msg_.signature.data[40]; + EXPECT_EQ(last_msg_.signature.data[41], 41) + << "incorrect value for last_msg_.signature.data[41], expected 41, is " + << last_msg_.signature.data[41]; + EXPECT_EQ(last_msg_.signature.data[42], 42) + << "incorrect value for last_msg_.signature.data[42], expected 42, is " + << last_msg_.signature.data[42]; + EXPECT_EQ(last_msg_.signature.data[43], 43) + << "incorrect value for last_msg_.signature.data[43], expected 43, is " + << last_msg_.signature.data[43]; + EXPECT_EQ(last_msg_.signature.data[44], 44) + << "incorrect value for last_msg_.signature.data[44], expected 44, is " + << last_msg_.signature.data[44]; + EXPECT_EQ(last_msg_.signature.data[45], 45) + << "incorrect value for last_msg_.signature.data[45], expected 45, is " + << last_msg_.signature.data[45]; + EXPECT_EQ(last_msg_.signature.data[46], 46) + << "incorrect value for last_msg_.signature.data[46], expected 46, is " + << last_msg_.signature.data[46]; + EXPECT_EQ(last_msg_.signature.data[47], 47) + << "incorrect value for last_msg_.signature.data[47], expected 47, is " + << last_msg_.signature.data[47]; + EXPECT_EQ(last_msg_.signature.data[48], 48) + << "incorrect value for last_msg_.signature.data[48], expected 48, is " + << last_msg_.signature.data[48]; + EXPECT_EQ(last_msg_.signature.data[49], 49) + << "incorrect value for last_msg_.signature.data[49], expected 49, is " + << last_msg_.signature.data[49]; + EXPECT_EQ(last_msg_.signature.data[50], 50) + << "incorrect value for last_msg_.signature.data[50], expected 50, is " + << last_msg_.signature.data[50]; + EXPECT_EQ(last_msg_.signature.data[51], 51) + << "incorrect value for last_msg_.signature.data[51], expected 51, is " + << last_msg_.signature.data[51]; + EXPECT_EQ(last_msg_.signature.data[52], 52) + << "incorrect value for last_msg_.signature.data[52], expected 52, is " + << last_msg_.signature.data[52]; + EXPECT_EQ(last_msg_.signature.data[53], 53) + << "incorrect value for last_msg_.signature.data[53], expected 53, is " + << last_msg_.signature.data[53]; + EXPECT_EQ(last_msg_.signature.data[54], 54) + << "incorrect value for last_msg_.signature.data[54], expected 54, is " + << last_msg_.signature.data[54]; + EXPECT_EQ(last_msg_.signature.data[55], 55) + << "incorrect value for last_msg_.signature.data[55], expected 55, is " + << last_msg_.signature.data[55]; + EXPECT_EQ(last_msg_.signature.data[56], 56) + << "incorrect value for last_msg_.signature.data[56], expected 56, is " + << last_msg_.signature.data[56]; + EXPECT_EQ(last_msg_.signature.data[57], 57) + << "incorrect value for last_msg_.signature.data[57], expected 57, is " + << last_msg_.signature.data[57]; + EXPECT_EQ(last_msg_.signature.data[58], 58) + << "incorrect value for last_msg_.signature.data[58], expected 58, is " + << last_msg_.signature.data[58]; + EXPECT_EQ(last_msg_.signature.data[59], 59) + << "incorrect value for last_msg_.signature.data[59], expected 59, is " + << last_msg_.signature.data[59]; + EXPECT_EQ(last_msg_.signature.data[60], 60) + << "incorrect value for last_msg_.signature.data[60], expected 60, is " + << last_msg_.signature.data[60]; + EXPECT_EQ(last_msg_.signature.data[61], 61) + << "incorrect value for last_msg_.signature.data[61], expected 61, is " + << last_msg_.signature.data[61]; + EXPECT_EQ(last_msg_.signature.data[62], 62) + << "incorrect value for last_msg_.signature.data[62], expected 62, is " + << last_msg_.signature.data[62]; + EXPECT_EQ(last_msg_.signature.data[63], 63) + << "incorrect value for last_msg_.signature.data[63], expected 63, is " + << last_msg_.signature.data[63]; + EXPECT_EQ(last_msg_.signature.data[64], 64) + << "incorrect value for last_msg_.signature.data[64], expected 64, is " + << last_msg_.signature.data[64]; + EXPECT_EQ(last_msg_.signature.data[65], 65) + << "incorrect value for last_msg_.signature.data[65], expected 65, is " + << last_msg_.signature.data[65]; + EXPECT_EQ(last_msg_.signature.data[66], 66) + << "incorrect value for last_msg_.signature.data[66], expected 66, is " + << last_msg_.signature.data[66]; + EXPECT_EQ(last_msg_.signature.data[67], 67) + << "incorrect value for last_msg_.signature.data[67], expected 67, is " + << last_msg_.signature.data[67]; + EXPECT_EQ(last_msg_.signature.data[68], 68) + << "incorrect value for last_msg_.signature.data[68], expected 68, is " + << last_msg_.signature.data[68]; + EXPECT_EQ(last_msg_.signature.data[69], 69) + << "incorrect value for last_msg_.signature.data[69], expected 69, is " + << last_msg_.signature.data[69]; + EXPECT_EQ(last_msg_.signature.data[70], 70) + << "incorrect value for last_msg_.signature.data[70], expected 70, is " + << last_msg_.signature.data[70]; + EXPECT_EQ(last_msg_.signature.data[71], 71) + << "incorrect value for last_msg_.signature.data[71], expected 71, is " + << last_msg_.signature.data[71]; + EXPECT_EQ(last_msg_.signature.len, 72) + << "incorrect value for last_msg_.signature.len, expected 72, is " + << last_msg_.signature.len; EXPECT_EQ(last_msg_.signed_messages[0], 10) << "incorrect value for last_msg_.signed_messages[0], expected 10, is " << last_msg_.signed_messages[0]; diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc similarity index 99% rename from c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc rename to c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc index 081c39fac4..3695ed6590 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc @@ -11,7 +11,7 @@ */ // This file was auto-generated from -// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by // generate.py. Do not modify by hand! #include @@ -19,19 +19,19 @@ #include #include #include -class Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0 +class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : public ::testing::Test, public sbp::State, public sbp::IReader, public sbp::IWriter, - sbp::MessageHandler { + sbp::MessageHandler { public: - Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0() + Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() : ::testing::Test(), sbp::State(), sbp::IReader(), sbp::IWriter(), - sbp::MessageHandler(this), + sbp::MessageHandler(this), last_msg_(), last_msg_len_(), last_sender_id_(), @@ -59,13 +59,13 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0 protected: void handle_sbp_msg(uint16_t sender_id, - const sbp_msg_ecdsa_signature_dep_t &msg) override { + const sbp_msg_ecdsa_signature_dep_a_t &msg) override { last_msg_ = msg; last_sender_id_ = sender_id; n_callbacks_logged_++; } - sbp_msg_ecdsa_signature_dep_t last_msg_; + sbp_msg_ecdsa_signature_dep_a_t last_msg_; uint8_t last_msg_len_; uint16_t last_sender_id_; size_t n_callbacks_logged_; @@ -74,7 +74,7 @@ class Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0 uint8_t dummy_buff_[1024]; }; -TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0, Test) { +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) { uint8_t encoded_frame[] = { 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, @@ -96,7 +96,7 @@ TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDep0, Test) { 41, 67, 46, 127, 75, 174, 97, 172, }; - sbp_msg_ecdsa_signature_dep_t test_msg{}; + sbp_msg_ecdsa_signature_dep_a_t test_msg{}; test_msg.certificate_id[0] = 1; diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc new file mode 100644 index 0000000000..0c90a45514 --- /dev/null +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc @@ -0,0 +1,516 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include +#include +class Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::MessageHandler { + public: + Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::MessageHandler(this), + last_msg_(), + last_msg_len_(), + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { + set_reader(this); + set_writer(this); + } + + s32 read(uint8_t *buf, const uint32_t n) override { + uint32_t real_n = n; + memcpy(buf, dummy_buff_ + dummy_rd_, real_n); + dummy_rd_ += real_n; + return (s32)real_n; + } + + s32 write(const uint8_t *buf, uint32_t n) override { + uint32_t real_n = n; + memcpy(dummy_buff_ + dummy_wr_, buf, real_n); + dummy_wr_ += real_n; + return (s32)real_n; + } + + protected: + void handle_sbp_msg(uint16_t sender_id, + const sbp_msg_ecdsa_signature_dep_b_t &msg) override { + last_msg_ = msg; + last_sender_id_ = sender_id; + n_callbacks_logged_++; + } + + sbp_msg_ecdsa_signature_dep_b_t last_msg_; + uint8_t last_msg_len_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; + uint32_t dummy_wr_; + uint32_t dummy_rd_; + uint8_t dummy_buff_[1024]; +}; + +TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; + + sbp_msg_ecdsa_signature_dep_b_t test_msg{}; + + test_msg.certificate_id[0] = 1; + + test_msg.certificate_id[1] = 2; + + test_msg.certificate_id[2] = 3; + + test_msg.certificate_id[3] = 4; + test_msg.flags = 0; + test_msg.n_signature_bytes = 72; + test_msg.n_signed_messages = 3; + test_msg.on_demand_counter = 2; + + test_msg.signature[0] = 0; + + test_msg.signature[1] = 1; + + test_msg.signature[2] = 2; + + test_msg.signature[3] = 3; + + test_msg.signature[4] = 4; + + test_msg.signature[5] = 5; + + test_msg.signature[6] = 6; + + test_msg.signature[7] = 7; + + test_msg.signature[8] = 8; + + test_msg.signature[9] = 9; + + test_msg.signature[10] = 10; + + test_msg.signature[11] = 11; + + test_msg.signature[12] = 12; + + test_msg.signature[13] = 13; + + test_msg.signature[14] = 14; + + test_msg.signature[15] = 15; + + test_msg.signature[16] = 16; + + test_msg.signature[17] = 17; + + test_msg.signature[18] = 18; + + test_msg.signature[19] = 19; + + test_msg.signature[20] = 20; + + test_msg.signature[21] = 21; + + test_msg.signature[22] = 22; + + test_msg.signature[23] = 23; + + test_msg.signature[24] = 24; + + test_msg.signature[25] = 25; + + test_msg.signature[26] = 26; + + test_msg.signature[27] = 27; + + test_msg.signature[28] = 28; + + test_msg.signature[29] = 29; + + test_msg.signature[30] = 30; + + test_msg.signature[31] = 31; + + test_msg.signature[32] = 32; + + test_msg.signature[33] = 33; + + test_msg.signature[34] = 34; + + test_msg.signature[35] = 35; + + test_msg.signature[36] = 36; + + test_msg.signature[37] = 37; + + test_msg.signature[38] = 38; + + test_msg.signature[39] = 39; + + test_msg.signature[40] = 40; + + test_msg.signature[41] = 41; + + test_msg.signature[42] = 42; + + test_msg.signature[43] = 43; + + test_msg.signature[44] = 44; + + test_msg.signature[45] = 45; + + test_msg.signature[46] = 46; + + test_msg.signature[47] = 47; + + test_msg.signature[48] = 48; + + test_msg.signature[49] = 49; + + test_msg.signature[50] = 50; + + test_msg.signature[51] = 51; + + test_msg.signature[52] = 52; + + test_msg.signature[53] = 53; + + test_msg.signature[54] = 54; + + test_msg.signature[55] = 55; + + test_msg.signature[56] = 56; + + test_msg.signature[57] = 57; + + test_msg.signature[58] = 58; + + test_msg.signature[59] = 59; + + test_msg.signature[60] = 60; + + test_msg.signature[61] = 61; + + test_msg.signature[62] = 62; + + test_msg.signature[63] = 63; + + test_msg.signature[64] = 64; + + test_msg.signature[65] = 65; + + test_msg.signature[66] = 66; + + test_msg.signature[67] = 67; + + test_msg.signature[68] = 68; + + test_msg.signature[69] = 69; + + test_msg.signature[70] = 70; + + test_msg.signature[71] = 71; + + test_msg.signed_messages[0] = 10; + + test_msg.signed_messages[1] = 21; + + test_msg.signed_messages[2] = 23; + test_msg.stream_counter = 1; + + EXPECT_EQ(send_message(66, test_msg), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_, test_msg); + EXPECT_EQ(last_msg_.certificate_id[0], 1) + << "incorrect value for last_msg_.certificate_id[0], expected 1, is " + << last_msg_.certificate_id[0]; + EXPECT_EQ(last_msg_.certificate_id[1], 2) + << "incorrect value for last_msg_.certificate_id[1], expected 2, is " + << last_msg_.certificate_id[1]; + EXPECT_EQ(last_msg_.certificate_id[2], 3) + << "incorrect value for last_msg_.certificate_id[2], expected 3, is " + << last_msg_.certificate_id[2]; + EXPECT_EQ(last_msg_.certificate_id[3], 4) + << "incorrect value for last_msg_.certificate_id[3], expected 4, is " + << last_msg_.certificate_id[3]; + EXPECT_EQ(last_msg_.flags, 0) + << "incorrect value for last_msg_.flags, expected 0, is " + << last_msg_.flags; + EXPECT_EQ(last_msg_.n_signature_bytes, 72) + << "incorrect value for last_msg_.n_signature_bytes, expected 72, is " + << last_msg_.n_signature_bytes; + EXPECT_EQ(last_msg_.n_signed_messages, 3) + << "incorrect value for last_msg_.n_signed_messages, expected 3, is " + << last_msg_.n_signed_messages; + EXPECT_EQ(last_msg_.on_demand_counter, 2) + << "incorrect value for last_msg_.on_demand_counter, expected 2, is " + << last_msg_.on_demand_counter; + EXPECT_EQ(last_msg_.signature[0], 0) + << "incorrect value for last_msg_.signature[0], expected 0, is " + << last_msg_.signature[0]; + EXPECT_EQ(last_msg_.signature[1], 1) + << "incorrect value for last_msg_.signature[1], expected 1, is " + << last_msg_.signature[1]; + EXPECT_EQ(last_msg_.signature[2], 2) + << "incorrect value for last_msg_.signature[2], expected 2, is " + << last_msg_.signature[2]; + EXPECT_EQ(last_msg_.signature[3], 3) + << "incorrect value for last_msg_.signature[3], expected 3, is " + << last_msg_.signature[3]; + EXPECT_EQ(last_msg_.signature[4], 4) + << "incorrect value for last_msg_.signature[4], expected 4, is " + << last_msg_.signature[4]; + EXPECT_EQ(last_msg_.signature[5], 5) + << "incorrect value for last_msg_.signature[5], expected 5, is " + << last_msg_.signature[5]; + EXPECT_EQ(last_msg_.signature[6], 6) + << "incorrect value for last_msg_.signature[6], expected 6, is " + << last_msg_.signature[6]; + EXPECT_EQ(last_msg_.signature[7], 7) + << "incorrect value for last_msg_.signature[7], expected 7, is " + << last_msg_.signature[7]; + EXPECT_EQ(last_msg_.signature[8], 8) + << "incorrect value for last_msg_.signature[8], expected 8, is " + << last_msg_.signature[8]; + EXPECT_EQ(last_msg_.signature[9], 9) + << "incorrect value for last_msg_.signature[9], expected 9, is " + << last_msg_.signature[9]; + EXPECT_EQ(last_msg_.signature[10], 10) + << "incorrect value for last_msg_.signature[10], expected 10, is " + << last_msg_.signature[10]; + EXPECT_EQ(last_msg_.signature[11], 11) + << "incorrect value for last_msg_.signature[11], expected 11, is " + << last_msg_.signature[11]; + EXPECT_EQ(last_msg_.signature[12], 12) + << "incorrect value for last_msg_.signature[12], expected 12, is " + << last_msg_.signature[12]; + EXPECT_EQ(last_msg_.signature[13], 13) + << "incorrect value for last_msg_.signature[13], expected 13, is " + << last_msg_.signature[13]; + EXPECT_EQ(last_msg_.signature[14], 14) + << "incorrect value for last_msg_.signature[14], expected 14, is " + << last_msg_.signature[14]; + EXPECT_EQ(last_msg_.signature[15], 15) + << "incorrect value for last_msg_.signature[15], expected 15, is " + << last_msg_.signature[15]; + EXPECT_EQ(last_msg_.signature[16], 16) + << "incorrect value for last_msg_.signature[16], expected 16, is " + << last_msg_.signature[16]; + EXPECT_EQ(last_msg_.signature[17], 17) + << "incorrect value for last_msg_.signature[17], expected 17, is " + << last_msg_.signature[17]; + EXPECT_EQ(last_msg_.signature[18], 18) + << "incorrect value for last_msg_.signature[18], expected 18, is " + << last_msg_.signature[18]; + EXPECT_EQ(last_msg_.signature[19], 19) + << "incorrect value for last_msg_.signature[19], expected 19, is " + << last_msg_.signature[19]; + EXPECT_EQ(last_msg_.signature[20], 20) + << "incorrect value for last_msg_.signature[20], expected 20, is " + << last_msg_.signature[20]; + EXPECT_EQ(last_msg_.signature[21], 21) + << "incorrect value for last_msg_.signature[21], expected 21, is " + << last_msg_.signature[21]; + EXPECT_EQ(last_msg_.signature[22], 22) + << "incorrect value for last_msg_.signature[22], expected 22, is " + << last_msg_.signature[22]; + EXPECT_EQ(last_msg_.signature[23], 23) + << "incorrect value for last_msg_.signature[23], expected 23, is " + << last_msg_.signature[23]; + EXPECT_EQ(last_msg_.signature[24], 24) + << "incorrect value for last_msg_.signature[24], expected 24, is " + << last_msg_.signature[24]; + EXPECT_EQ(last_msg_.signature[25], 25) + << "incorrect value for last_msg_.signature[25], expected 25, is " + << last_msg_.signature[25]; + EXPECT_EQ(last_msg_.signature[26], 26) + << "incorrect value for last_msg_.signature[26], expected 26, is " + << last_msg_.signature[26]; + EXPECT_EQ(last_msg_.signature[27], 27) + << "incorrect value for last_msg_.signature[27], expected 27, is " + << last_msg_.signature[27]; + EXPECT_EQ(last_msg_.signature[28], 28) + << "incorrect value for last_msg_.signature[28], expected 28, is " + << last_msg_.signature[28]; + EXPECT_EQ(last_msg_.signature[29], 29) + << "incorrect value for last_msg_.signature[29], expected 29, is " + << last_msg_.signature[29]; + EXPECT_EQ(last_msg_.signature[30], 30) + << "incorrect value for last_msg_.signature[30], expected 30, is " + << last_msg_.signature[30]; + EXPECT_EQ(last_msg_.signature[31], 31) + << "incorrect value for last_msg_.signature[31], expected 31, is " + << last_msg_.signature[31]; + EXPECT_EQ(last_msg_.signature[32], 32) + << "incorrect value for last_msg_.signature[32], expected 32, is " + << last_msg_.signature[32]; + EXPECT_EQ(last_msg_.signature[33], 33) + << "incorrect value for last_msg_.signature[33], expected 33, is " + << last_msg_.signature[33]; + EXPECT_EQ(last_msg_.signature[34], 34) + << "incorrect value for last_msg_.signature[34], expected 34, is " + << last_msg_.signature[34]; + EXPECT_EQ(last_msg_.signature[35], 35) + << "incorrect value for last_msg_.signature[35], expected 35, is " + << last_msg_.signature[35]; + EXPECT_EQ(last_msg_.signature[36], 36) + << "incorrect value for last_msg_.signature[36], expected 36, is " + << last_msg_.signature[36]; + EXPECT_EQ(last_msg_.signature[37], 37) + << "incorrect value for last_msg_.signature[37], expected 37, is " + << last_msg_.signature[37]; + EXPECT_EQ(last_msg_.signature[38], 38) + << "incorrect value for last_msg_.signature[38], expected 38, is " + << last_msg_.signature[38]; + EXPECT_EQ(last_msg_.signature[39], 39) + << "incorrect value for last_msg_.signature[39], expected 39, is " + << last_msg_.signature[39]; + EXPECT_EQ(last_msg_.signature[40], 40) + << "incorrect value for last_msg_.signature[40], expected 40, is " + << last_msg_.signature[40]; + EXPECT_EQ(last_msg_.signature[41], 41) + << "incorrect value for last_msg_.signature[41], expected 41, is " + << last_msg_.signature[41]; + EXPECT_EQ(last_msg_.signature[42], 42) + << "incorrect value for last_msg_.signature[42], expected 42, is " + << last_msg_.signature[42]; + EXPECT_EQ(last_msg_.signature[43], 43) + << "incorrect value for last_msg_.signature[43], expected 43, is " + << last_msg_.signature[43]; + EXPECT_EQ(last_msg_.signature[44], 44) + << "incorrect value for last_msg_.signature[44], expected 44, is " + << last_msg_.signature[44]; + EXPECT_EQ(last_msg_.signature[45], 45) + << "incorrect value for last_msg_.signature[45], expected 45, is " + << last_msg_.signature[45]; + EXPECT_EQ(last_msg_.signature[46], 46) + << "incorrect value for last_msg_.signature[46], expected 46, is " + << last_msg_.signature[46]; + EXPECT_EQ(last_msg_.signature[47], 47) + << "incorrect value for last_msg_.signature[47], expected 47, is " + << last_msg_.signature[47]; + EXPECT_EQ(last_msg_.signature[48], 48) + << "incorrect value for last_msg_.signature[48], expected 48, is " + << last_msg_.signature[48]; + EXPECT_EQ(last_msg_.signature[49], 49) + << "incorrect value for last_msg_.signature[49], expected 49, is " + << last_msg_.signature[49]; + EXPECT_EQ(last_msg_.signature[50], 50) + << "incorrect value for last_msg_.signature[50], expected 50, is " + << last_msg_.signature[50]; + EXPECT_EQ(last_msg_.signature[51], 51) + << "incorrect value for last_msg_.signature[51], expected 51, is " + << last_msg_.signature[51]; + EXPECT_EQ(last_msg_.signature[52], 52) + << "incorrect value for last_msg_.signature[52], expected 52, is " + << last_msg_.signature[52]; + EXPECT_EQ(last_msg_.signature[53], 53) + << "incorrect value for last_msg_.signature[53], expected 53, is " + << last_msg_.signature[53]; + EXPECT_EQ(last_msg_.signature[54], 54) + << "incorrect value for last_msg_.signature[54], expected 54, is " + << last_msg_.signature[54]; + EXPECT_EQ(last_msg_.signature[55], 55) + << "incorrect value for last_msg_.signature[55], expected 55, is " + << last_msg_.signature[55]; + EXPECT_EQ(last_msg_.signature[56], 56) + << "incorrect value for last_msg_.signature[56], expected 56, is " + << last_msg_.signature[56]; + EXPECT_EQ(last_msg_.signature[57], 57) + << "incorrect value for last_msg_.signature[57], expected 57, is " + << last_msg_.signature[57]; + EXPECT_EQ(last_msg_.signature[58], 58) + << "incorrect value for last_msg_.signature[58], expected 58, is " + << last_msg_.signature[58]; + EXPECT_EQ(last_msg_.signature[59], 59) + << "incorrect value for last_msg_.signature[59], expected 59, is " + << last_msg_.signature[59]; + EXPECT_EQ(last_msg_.signature[60], 60) + << "incorrect value for last_msg_.signature[60], expected 60, is " + << last_msg_.signature[60]; + EXPECT_EQ(last_msg_.signature[61], 61) + << "incorrect value for last_msg_.signature[61], expected 61, is " + << last_msg_.signature[61]; + EXPECT_EQ(last_msg_.signature[62], 62) + << "incorrect value for last_msg_.signature[62], expected 62, is " + << last_msg_.signature[62]; + EXPECT_EQ(last_msg_.signature[63], 63) + << "incorrect value for last_msg_.signature[63], expected 63, is " + << last_msg_.signature[63]; + EXPECT_EQ(last_msg_.signature[64], 64) + << "incorrect value for last_msg_.signature[64], expected 64, is " + << last_msg_.signature[64]; + EXPECT_EQ(last_msg_.signature[65], 65) + << "incorrect value for last_msg_.signature[65], expected 65, is " + << last_msg_.signature[65]; + EXPECT_EQ(last_msg_.signature[66], 66) + << "incorrect value for last_msg_.signature[66], expected 66, is " + << last_msg_.signature[66]; + EXPECT_EQ(last_msg_.signature[67], 67) + << "incorrect value for last_msg_.signature[67], expected 67, is " + << last_msg_.signature[67]; + EXPECT_EQ(last_msg_.signature[68], 68) + << "incorrect value for last_msg_.signature[68], expected 68, is " + << last_msg_.signature[68]; + EXPECT_EQ(last_msg_.signature[69], 69) + << "incorrect value for last_msg_.signature[69], expected 69, is " + << last_msg_.signature[69]; + EXPECT_EQ(last_msg_.signature[70], 70) + << "incorrect value for last_msg_.signature[70], expected 70, is " + << last_msg_.signature[70]; + EXPECT_EQ(last_msg_.signature[71], 71) + << "incorrect value for last_msg_.signature[71], expected 71, is " + << last_msg_.signature[71]; + EXPECT_EQ(last_msg_.signed_messages[0], 10) + << "incorrect value for last_msg_.signed_messages[0], expected 10, is " + << last_msg_.signed_messages[0]; + EXPECT_EQ(last_msg_.signed_messages[1], 21) + << "incorrect value for last_msg_.signed_messages[1], expected 21, is " + << last_msg_.signed_messages[1]; + EXPECT_EQ(last_msg_.signed_messages[2], 23) + << "incorrect value for last_msg_.signed_messages[2], expected 23, is " + << last_msg_.signed_messages[2]; + EXPECT_EQ(last_msg_.stream_counter, 1) + << "incorrect value for last_msg_.stream_counter, expected 1, is " + << last_msg_.stream_counter; +} diff --git a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c index d62bec392f..a3b9c909cd 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChain.c @@ -116,21 +116,21 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChain) { logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC05, &msg_callback, + sbp_payload_callback_register(&sbp_state, 0xC09, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC05, &frame_callback, + sbp_frame_callback_register(&sbp_state, 0xC09, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); u8 encoded_frame[] = { - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, }; dummy_reset(); @@ -448,327 +448,368 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChain) { test_msg_len += sizeof(test_msg->root_certificate[0]); } test_msg->root_certificate[19] = 19; - if (sizeof(test_msg->signature) == 0) { + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[8] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[9] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[10] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[11] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[12] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[13] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[14] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[15] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[16] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[17] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[18] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[19] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[20] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[21] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[22] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[23] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[24] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[25] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[26] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[27] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[28] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[29] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[30] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[31] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[32] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[33] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[34] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[35] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[36] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[37] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[38] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[39] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[40] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[41] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[42] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[43] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[44] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[45] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[46] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[47] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[48] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[49] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[50] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[51] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[52] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[53] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[54] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[55] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[56] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[57] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[58] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[59] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[60] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[61] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[62] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[63] = 7; - sbp_payload_send(&sbp_state, 0xC05, 66, test_msg_len, test_msg_storage, + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature.data[0]); + } + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; + sbp_payload_send(&sbp_state, 0xC09, 66, test_msg_len, test_msg_storage, &dummy_write); ck_assert_msg( @@ -802,7 +843,7 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChain) { "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, "frame_callback: sender_id decoded incorrectly"); - ck_assert_msg(last_frame.msg_type == 0xC05, + ck_assert_msg(last_frame.msg_type == 0xC09, "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, "frame_callback: msg_len decoded incorrectly"); @@ -1075,198 +1116,225 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChain) { check_msg->root_certificate[19] == 19, "incorrect value for root_certificate[19], expected 19, is %d", check_msg->root_certificate[19]); - ck_assert_msg(check_msg->signature[0] == 0, - "incorrect value for signature[0], expected 0, is %d", - check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, - "incorrect value for signature[1], expected 1, is %d", - check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, - "incorrect value for signature[2], expected 2, is %d", - check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, - "incorrect value for signature[3], expected 3, is %d", - check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, - "incorrect value for signature[4], expected 4, is %d", - check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, - "incorrect value for signature[5], expected 5, is %d", - check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, - "incorrect value for signature[6], expected 6, is %d", - check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, - "incorrect value for signature[7], expected 7, is %d", - check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 0, - "incorrect value for signature[8], expected 0, is %d", - check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 1, - "incorrect value for signature[9], expected 1, is %d", - check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 2, - "incorrect value for signature[10], expected 2, is %d", - check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 3, - "incorrect value for signature[11], expected 3, is %d", - check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 4, - "incorrect value for signature[12], expected 4, is %d", - check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 5, - "incorrect value for signature[13], expected 5, is %d", - check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 6, - "incorrect value for signature[14], expected 6, is %d", - check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 7, - "incorrect value for signature[15], expected 7, is %d", - check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 0, - "incorrect value for signature[16], expected 0, is %d", - check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 1, - "incorrect value for signature[17], expected 1, is %d", - check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 2, - "incorrect value for signature[18], expected 2, is %d", - check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 3, - "incorrect value for signature[19], expected 3, is %d", - check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 4, - "incorrect value for signature[20], expected 4, is %d", - check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 5, - "incorrect value for signature[21], expected 5, is %d", - check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 6, - "incorrect value for signature[22], expected 6, is %d", - check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 7, - "incorrect value for signature[23], expected 7, is %d", - check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 0, - "incorrect value for signature[24], expected 0, is %d", - check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 1, - "incorrect value for signature[25], expected 1, is %d", - check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 2, - "incorrect value for signature[26], expected 2, is %d", - check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 3, - "incorrect value for signature[27], expected 3, is %d", - check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 4, - "incorrect value for signature[28], expected 4, is %d", - check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 5, - "incorrect value for signature[29], expected 5, is %d", - check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 6, - "incorrect value for signature[30], expected 6, is %d", - check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 7, - "incorrect value for signature[31], expected 7, is %d", - check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 0, - "incorrect value for signature[32], expected 0, is %d", - check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 1, - "incorrect value for signature[33], expected 1, is %d", - check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 2, - "incorrect value for signature[34], expected 2, is %d", - check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 3, - "incorrect value for signature[35], expected 3, is %d", - check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 4, - "incorrect value for signature[36], expected 4, is %d", - check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 5, - "incorrect value for signature[37], expected 5, is %d", - check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 6, - "incorrect value for signature[38], expected 6, is %d", - check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 7, - "incorrect value for signature[39], expected 7, is %d", - check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 0, - "incorrect value for signature[40], expected 0, is %d", - check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 1, - "incorrect value for signature[41], expected 1, is %d", - check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 2, - "incorrect value for signature[42], expected 2, is %d", - check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 3, - "incorrect value for signature[43], expected 3, is %d", - check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 4, - "incorrect value for signature[44], expected 4, is %d", - check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 5, - "incorrect value for signature[45], expected 5, is %d", - check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 6, - "incorrect value for signature[46], expected 6, is %d", - check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 7, - "incorrect value for signature[47], expected 7, is %d", - check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 0, - "incorrect value for signature[48], expected 0, is %d", - check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 1, - "incorrect value for signature[49], expected 1, is %d", - check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 2, - "incorrect value for signature[50], expected 2, is %d", - check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 3, - "incorrect value for signature[51], expected 3, is %d", - check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 4, - "incorrect value for signature[52], expected 4, is %d", - check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 5, - "incorrect value for signature[53], expected 5, is %d", - check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 6, - "incorrect value for signature[54], expected 6, is %d", - check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 7, - "incorrect value for signature[55], expected 7, is %d", - check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 0, - "incorrect value for signature[56], expected 0, is %d", - check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 1, - "incorrect value for signature[57], expected 1, is %d", - check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 2, - "incorrect value for signature[58], expected 2, is %d", - check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 3, - "incorrect value for signature[59], expected 3, is %d", - check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 4, - "incorrect value for signature[60], expected 4, is %d", - check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 5, - "incorrect value for signature[61], expected 5, is %d", - check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 6, - "incorrect value for signature[62], expected 6, is %d", - check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 7, - "incorrect value for signature[63], expected 7, is %d", - check_msg->signature[63]); + ck_assert_msg(check_msg->signature.data[0] == 0, + "incorrect value for signature.data[0], expected 0, is %d", + check_msg->signature.data[0]); + ck_assert_msg(check_msg->signature.data[1] == 1, + "incorrect value for signature.data[1], expected 1, is %d", + check_msg->signature.data[1]); + ck_assert_msg(check_msg->signature.data[2] == 2, + "incorrect value for signature.data[2], expected 2, is %d", + check_msg->signature.data[2]); + ck_assert_msg(check_msg->signature.data[3] == 3, + "incorrect value for signature.data[3], expected 3, is %d", + check_msg->signature.data[3]); + ck_assert_msg(check_msg->signature.data[4] == 4, + "incorrect value for signature.data[4], expected 4, is %d", + check_msg->signature.data[4]); + ck_assert_msg(check_msg->signature.data[5] == 5, + "incorrect value for signature.data[5], expected 5, is %d", + check_msg->signature.data[5]); + ck_assert_msg(check_msg->signature.data[6] == 6, + "incorrect value for signature.data[6], expected 6, is %d", + check_msg->signature.data[6]); + ck_assert_msg(check_msg->signature.data[7] == 7, + "incorrect value for signature.data[7], expected 7, is %d", + check_msg->signature.data[7]); + ck_assert_msg(check_msg->signature.data[8] == 8, + "incorrect value for signature.data[8], expected 8, is %d", + check_msg->signature.data[8]); + ck_assert_msg(check_msg->signature.data[9] == 9, + "incorrect value for signature.data[9], expected 9, is %d", + check_msg->signature.data[9]); + ck_assert_msg(check_msg->signature.data[10] == 10, + "incorrect value for signature.data[10], expected 10, is %d", + check_msg->signature.data[10]); + ck_assert_msg(check_msg->signature.data[11] == 11, + "incorrect value for signature.data[11], expected 11, is %d", + check_msg->signature.data[11]); + ck_assert_msg(check_msg->signature.data[12] == 12, + "incorrect value for signature.data[12], expected 12, is %d", + check_msg->signature.data[12]); + ck_assert_msg(check_msg->signature.data[13] == 13, + "incorrect value for signature.data[13], expected 13, is %d", + check_msg->signature.data[13]); + ck_assert_msg(check_msg->signature.data[14] == 14, + "incorrect value for signature.data[14], expected 14, is %d", + check_msg->signature.data[14]); + ck_assert_msg(check_msg->signature.data[15] == 15, + "incorrect value for signature.data[15], expected 15, is %d", + check_msg->signature.data[15]); + ck_assert_msg(check_msg->signature.data[16] == 16, + "incorrect value for signature.data[16], expected 16, is %d", + check_msg->signature.data[16]); + ck_assert_msg(check_msg->signature.data[17] == 17, + "incorrect value for signature.data[17], expected 17, is %d", + check_msg->signature.data[17]); + ck_assert_msg(check_msg->signature.data[18] == 18, + "incorrect value for signature.data[18], expected 18, is %d", + check_msg->signature.data[18]); + ck_assert_msg(check_msg->signature.data[19] == 19, + "incorrect value for signature.data[19], expected 19, is %d", + check_msg->signature.data[19]); + ck_assert_msg(check_msg->signature.data[20] == 20, + "incorrect value for signature.data[20], expected 20, is %d", + check_msg->signature.data[20]); + ck_assert_msg(check_msg->signature.data[21] == 21, + "incorrect value for signature.data[21], expected 21, is %d", + check_msg->signature.data[21]); + ck_assert_msg(check_msg->signature.data[22] == 22, + "incorrect value for signature.data[22], expected 22, is %d", + check_msg->signature.data[22]); + ck_assert_msg(check_msg->signature.data[23] == 23, + "incorrect value for signature.data[23], expected 23, is %d", + check_msg->signature.data[23]); + ck_assert_msg(check_msg->signature.data[24] == 24, + "incorrect value for signature.data[24], expected 24, is %d", + check_msg->signature.data[24]); + ck_assert_msg(check_msg->signature.data[25] == 25, + "incorrect value for signature.data[25], expected 25, is %d", + check_msg->signature.data[25]); + ck_assert_msg(check_msg->signature.data[26] == 26, + "incorrect value for signature.data[26], expected 26, is %d", + check_msg->signature.data[26]); + ck_assert_msg(check_msg->signature.data[27] == 27, + "incorrect value for signature.data[27], expected 27, is %d", + check_msg->signature.data[27]); + ck_assert_msg(check_msg->signature.data[28] == 28, + "incorrect value for signature.data[28], expected 28, is %d", + check_msg->signature.data[28]); + ck_assert_msg(check_msg->signature.data[29] == 29, + "incorrect value for signature.data[29], expected 29, is %d", + check_msg->signature.data[29]); + ck_assert_msg(check_msg->signature.data[30] == 30, + "incorrect value for signature.data[30], expected 30, is %d", + check_msg->signature.data[30]); + ck_assert_msg(check_msg->signature.data[31] == 31, + "incorrect value for signature.data[31], expected 31, is %d", + check_msg->signature.data[31]); + ck_assert_msg(check_msg->signature.data[32] == 32, + "incorrect value for signature.data[32], expected 32, is %d", + check_msg->signature.data[32]); + ck_assert_msg(check_msg->signature.data[33] == 33, + "incorrect value for signature.data[33], expected 33, is %d", + check_msg->signature.data[33]); + ck_assert_msg(check_msg->signature.data[34] == 34, + "incorrect value for signature.data[34], expected 34, is %d", + check_msg->signature.data[34]); + ck_assert_msg(check_msg->signature.data[35] == 35, + "incorrect value for signature.data[35], expected 35, is %d", + check_msg->signature.data[35]); + ck_assert_msg(check_msg->signature.data[36] == 36, + "incorrect value for signature.data[36], expected 36, is %d", + check_msg->signature.data[36]); + ck_assert_msg(check_msg->signature.data[37] == 37, + "incorrect value for signature.data[37], expected 37, is %d", + check_msg->signature.data[37]); + ck_assert_msg(check_msg->signature.data[38] == 38, + "incorrect value for signature.data[38], expected 38, is %d", + check_msg->signature.data[38]); + ck_assert_msg(check_msg->signature.data[39] == 39, + "incorrect value for signature.data[39], expected 39, is %d", + check_msg->signature.data[39]); + ck_assert_msg(check_msg->signature.data[40] == 40, + "incorrect value for signature.data[40], expected 40, is %d", + check_msg->signature.data[40]); + ck_assert_msg(check_msg->signature.data[41] == 41, + "incorrect value for signature.data[41], expected 41, is %d", + check_msg->signature.data[41]); + ck_assert_msg(check_msg->signature.data[42] == 42, + "incorrect value for signature.data[42], expected 42, is %d", + check_msg->signature.data[42]); + ck_assert_msg(check_msg->signature.data[43] == 43, + "incorrect value for signature.data[43], expected 43, is %d", + check_msg->signature.data[43]); + ck_assert_msg(check_msg->signature.data[44] == 44, + "incorrect value for signature.data[44], expected 44, is %d", + check_msg->signature.data[44]); + ck_assert_msg(check_msg->signature.data[45] == 45, + "incorrect value for signature.data[45], expected 45, is %d", + check_msg->signature.data[45]); + ck_assert_msg(check_msg->signature.data[46] == 46, + "incorrect value for signature.data[46], expected 46, is %d", + check_msg->signature.data[46]); + ck_assert_msg(check_msg->signature.data[47] == 47, + "incorrect value for signature.data[47], expected 47, is %d", + check_msg->signature.data[47]); + ck_assert_msg(check_msg->signature.data[48] == 48, + "incorrect value for signature.data[48], expected 48, is %d", + check_msg->signature.data[48]); + ck_assert_msg(check_msg->signature.data[49] == 49, + "incorrect value for signature.data[49], expected 49, is %d", + check_msg->signature.data[49]); + ck_assert_msg(check_msg->signature.data[50] == 50, + "incorrect value for signature.data[50], expected 50, is %d", + check_msg->signature.data[50]); + ck_assert_msg(check_msg->signature.data[51] == 51, + "incorrect value for signature.data[51], expected 51, is %d", + check_msg->signature.data[51]); + ck_assert_msg(check_msg->signature.data[52] == 52, + "incorrect value for signature.data[52], expected 52, is %d", + check_msg->signature.data[52]); + ck_assert_msg(check_msg->signature.data[53] == 53, + "incorrect value for signature.data[53], expected 53, is %d", + check_msg->signature.data[53]); + ck_assert_msg(check_msg->signature.data[54] == 54, + "incorrect value for signature.data[54], expected 54, is %d", + check_msg->signature.data[54]); + ck_assert_msg(check_msg->signature.data[55] == 55, + "incorrect value for signature.data[55], expected 55, is %d", + check_msg->signature.data[55]); + ck_assert_msg(check_msg->signature.data[56] == 56, + "incorrect value for signature.data[56], expected 56, is %d", + check_msg->signature.data[56]); + ck_assert_msg(check_msg->signature.data[57] == 57, + "incorrect value for signature.data[57], expected 57, is %d", + check_msg->signature.data[57]); + ck_assert_msg(check_msg->signature.data[58] == 58, + "incorrect value for signature.data[58], expected 58, is %d", + check_msg->signature.data[58]); + ck_assert_msg(check_msg->signature.data[59] == 59, + "incorrect value for signature.data[59], expected 59, is %d", + check_msg->signature.data[59]); + ck_assert_msg(check_msg->signature.data[60] == 60, + "incorrect value for signature.data[60], expected 60, is %d", + check_msg->signature.data[60]); + ck_assert_msg(check_msg->signature.data[61] == 61, + "incorrect value for signature.data[61], expected 61, is %d", + check_msg->signature.data[61]); + ck_assert_msg(check_msg->signature.data[62] == 62, + "incorrect value for signature.data[62], expected 62, is %d", + check_msg->signature.data[62]); + ck_assert_msg(check_msg->signature.data[63] == 63, + "incorrect value for signature.data[63], expected 63, is %d", + check_msg->signature.data[63]); + ck_assert_msg(check_msg->signature.data[64] == 64, + "incorrect value for signature.data[64], expected 64, is %d", + check_msg->signature.data[64]); + ck_assert_msg(check_msg->signature.data[65] == 65, + "incorrect value for signature.data[65], expected 65, is %d", + check_msg->signature.data[65]); + ck_assert_msg(check_msg->signature.data[66] == 66, + "incorrect value for signature.data[66], expected 66, is %d", + check_msg->signature.data[66]); + ck_assert_msg(check_msg->signature.data[67] == 67, + "incorrect value for signature.data[67], expected 67, is %d", + check_msg->signature.data[67]); + ck_assert_msg(check_msg->signature.data[68] == 68, + "incorrect value for signature.data[68], expected 68, is %d", + check_msg->signature.data[68]); + ck_assert_msg(check_msg->signature.data[69] == 69, + "incorrect value for signature.data[69], expected 69, is %d", + check_msg->signature.data[69]); + ck_assert_msg(check_msg->signature.data[70] == 70, + "incorrect value for signature.data[70], expected 70, is %d", + check_msg->signature.data[70]); + ck_assert_msg(check_msg->signature.data[71] == 71, + "incorrect value for signature.data[71], expected 71, is %d", + check_msg->signature.data[71]); + ck_assert_msg(check_msg->signature.len == 72, + "incorrect value for signature.len, expected 72, is %d", + check_msg->signature.len); } } END_TEST diff --git a/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c new file mode 100644 index 0000000000..fa105352a9 --- /dev/null +++ b/c/test/legacy/auto_check_sbp_signing_MsgCertificateChainDep.c @@ -0,0 +1,1284 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include // for debugging +#include // for malloc + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + u8 len; + u8 msg[SBP_MAX_PAYLOAD_LEN]; + void *context; +} last_msg; + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + u16 msg_type; + u8 msg_len; + u8 msg[SBP_MAX_PAYLOAD_LEN]; + u16 frame_len; + u8 frame[SBP_MAX_FRAME_LEN]; + void *context; +} last_frame; + +static u32 dummy_wr = 0; +static u32 dummy_rd = 0; +static u8 dummy_buff[1024]; +static void *last_io_context; + +static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; +static int DUMMY_MEMORY_FOR_IO = 0xdead0000; + +static void dummy_reset() { + dummy_rd = dummy_wr = 0; + memset(dummy_buff, 0, sizeof(dummy_buff)); +} + +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; +} + +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; +} + +static void logging_reset() { + memset(&last_msg, 0, sizeof(last_msg)); + memset(&last_frame, 0, sizeof(last_frame)); +} + +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { + last_msg.n_callbacks_logged++; + last_msg.sender_id = sender_id; + last_msg.len = len; + last_msg.context = context; + memcpy(last_msg.msg, msg, len); +} + +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { + last_frame.n_callbacks_logged++; + last_frame.sender_id = sender_id; + last_frame.msg_type = msg_type; + last_frame.msg_len = msg_len; + memcpy(last_frame.msg, msg, msg_len); + last_frame.frame_len = frame_len; + memcpy(last_frame.frame, frame, frame_len); + last_frame.context = context; +} + +START_TEST(test_legacy_auto_check_sbp_signing_MsgCertificateChainDep) { + static sbp_msg_callbacks_node_t n; + static sbp_msg_callbacks_node_t n2; + + // State of the SBP message parser. + // Must be statically allocated. + sbp_state_t sbp_state; + + // + // Run tests: + // + // Test successful parsing of a message + { + // SBP parser state must be initialized before sbp_process is called. + // We re-initialize before every test so that callbacks for the same message + // types can be + // allocated multiple times across different tests. + sbp_state_init(&sbp_state); + + sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); + + logging_reset(); + + sbp_payload_callback_register(&sbp_state, 0xC05, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC05, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + dummy_reset(); + + u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; + memset(test_msg_storage, 0, sizeof(test_msg_storage)); + u8 test_msg_len = 0; + msg_certificate_chain_dep_t *test_msg = + (msg_certificate_chain_dep_t *)test_msg_storage; + test_msg_len = sizeof(*test_msg); + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[0] = 20; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[1] = 21; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[2] = 22; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[3] = 23; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[4] = 24; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[5] = 25; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[6] = 26; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[7] = 27; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[8] = 28; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[9] = 29; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[10] = 10; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[11] = 11; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[12] = 12; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[13] = 13; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[14] = 14; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[15] = 15; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[16] = 16; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[17] = 17; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[18] = 18; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->corrections_certificate[0]); + } + test_msg->corrections_certificate[19] = 19; + test_msg->expiration.day = 30; + test_msg->expiration.hours = 12; + test_msg->expiration.minutes = 34; + test_msg->expiration.month = 3; + test_msg->expiration.ns = 123456789; + test_msg->expiration.seconds = 59; + test_msg->expiration.year = 2024; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[0] = 10; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[1] = 11; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[2] = 12; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[3] = 13; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[4] = 14; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[5] = 15; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[6] = 16; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[7] = 17; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[8] = 18; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[9] = 19; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[10] = 0; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[11] = 1; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[12] = 2; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[13] = 3; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[14] = 4; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[15] = 5; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[16] = 6; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[17] = 7; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[18] = 8; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->intermediate_certificate[0]); + } + test_msg->intermediate_certificate[19] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[0] = 0; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[1] = 1; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[2] = 2; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[3] = 3; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[4] = 4; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[5] = 5; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[6] = 6; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[7] = 7; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[8] = 8; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[9] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[10] = 10; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[11] = 11; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[12] = 12; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[13] = 13; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[14] = 14; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[15] = 15; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[16] = 16; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[17] = 17; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[18] = 18; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->root_certificate[0]); + } + test_msg->root_certificate[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[8] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[9] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[10] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[11] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[12] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[13] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[14] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[15] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[16] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[17] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[18] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[19] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[20] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[21] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[22] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[23] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[24] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[25] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[26] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[27] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[28] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[29] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[30] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[31] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[32] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[33] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[34] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[35] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[36] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[37] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[38] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[39] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[40] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[41] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[42] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[43] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[44] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[45] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[46] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[47] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[48] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[49] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[50] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[51] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[52] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[53] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[54] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[55] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[56] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[57] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[58] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[59] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[60] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[61] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[62] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[63] = 7; + sbp_payload_send(&sbp_state, 0xC05, 66, test_msg_len, test_msg_storage, + &dummy_write); + + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); + + ck_assert_msg(dummy_wr == sizeof(encoded_frame), + "not enough data was written to dummy_buff"); + ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, + "frame was not encoded properly"); + + while (dummy_rd < dummy_wr) { + ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, + "sbp_process threw an error!"); + } + + ck_assert_msg(last_msg.n_callbacks_logged == 1, + "msg_callback: one callback should have been logged"); + ck_assert_msg(last_msg.sender_id == 66, + "msg_callback: sender_id decoded incorrectly"); + ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, + "msg_callback: test data decoded incorrectly"); + ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, + "frame_callback: context pointer incorrectly passed"); + + ck_assert_msg(last_frame.n_callbacks_logged == 1, + "frame_callback: one callback should have been logged"); + ck_assert_msg(last_frame.sender_id == 66, + "frame_callback: sender_id decoded incorrectly"); + ck_assert_msg(last_frame.msg_type == 0xC05, + "frame_callback: msg_type decoded incorrectly"); + ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); + ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame decoded incorrectly"); + ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, + "frame_callback: context pointer incorrectly passed"); + + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_certificate_chain_dep_t *check_msg = + (msg_certificate_chain_dep_t *)((void *)last_msg.msg); + // Run tests against fields + ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); + ck_assert_msg( + check_msg->corrections_certificate[0] == 20, + "incorrect value for corrections_certificate[0], expected 20, is %d", + check_msg->corrections_certificate[0]); + ck_assert_msg( + check_msg->corrections_certificate[1] == 21, + "incorrect value for corrections_certificate[1], expected 21, is %d", + check_msg->corrections_certificate[1]); + ck_assert_msg( + check_msg->corrections_certificate[2] == 22, + "incorrect value for corrections_certificate[2], expected 22, is %d", + check_msg->corrections_certificate[2]); + ck_assert_msg( + check_msg->corrections_certificate[3] == 23, + "incorrect value for corrections_certificate[3], expected 23, is %d", + check_msg->corrections_certificate[3]); + ck_assert_msg( + check_msg->corrections_certificate[4] == 24, + "incorrect value for corrections_certificate[4], expected 24, is %d", + check_msg->corrections_certificate[4]); + ck_assert_msg( + check_msg->corrections_certificate[5] == 25, + "incorrect value for corrections_certificate[5], expected 25, is %d", + check_msg->corrections_certificate[5]); + ck_assert_msg( + check_msg->corrections_certificate[6] == 26, + "incorrect value for corrections_certificate[6], expected 26, is %d", + check_msg->corrections_certificate[6]); + ck_assert_msg( + check_msg->corrections_certificate[7] == 27, + "incorrect value for corrections_certificate[7], expected 27, is %d", + check_msg->corrections_certificate[7]); + ck_assert_msg( + check_msg->corrections_certificate[8] == 28, + "incorrect value for corrections_certificate[8], expected 28, is %d", + check_msg->corrections_certificate[8]); + ck_assert_msg( + check_msg->corrections_certificate[9] == 29, + "incorrect value for corrections_certificate[9], expected 29, is %d", + check_msg->corrections_certificate[9]); + ck_assert_msg( + check_msg->corrections_certificate[10] == 10, + "incorrect value for corrections_certificate[10], expected 10, is %d", + check_msg->corrections_certificate[10]); + ck_assert_msg( + check_msg->corrections_certificate[11] == 11, + "incorrect value for corrections_certificate[11], expected 11, is %d", + check_msg->corrections_certificate[11]); + ck_assert_msg( + check_msg->corrections_certificate[12] == 12, + "incorrect value for corrections_certificate[12], expected 12, is %d", + check_msg->corrections_certificate[12]); + ck_assert_msg( + check_msg->corrections_certificate[13] == 13, + "incorrect value for corrections_certificate[13], expected 13, is %d", + check_msg->corrections_certificate[13]); + ck_assert_msg( + check_msg->corrections_certificate[14] == 14, + "incorrect value for corrections_certificate[14], expected 14, is %d", + check_msg->corrections_certificate[14]); + ck_assert_msg( + check_msg->corrections_certificate[15] == 15, + "incorrect value for corrections_certificate[15], expected 15, is %d", + check_msg->corrections_certificate[15]); + ck_assert_msg( + check_msg->corrections_certificate[16] == 16, + "incorrect value for corrections_certificate[16], expected 16, is %d", + check_msg->corrections_certificate[16]); + ck_assert_msg( + check_msg->corrections_certificate[17] == 17, + "incorrect value for corrections_certificate[17], expected 17, is %d", + check_msg->corrections_certificate[17]); + ck_assert_msg( + check_msg->corrections_certificate[18] == 18, + "incorrect value for corrections_certificate[18], expected 18, is %d", + check_msg->corrections_certificate[18]); + ck_assert_msg( + check_msg->corrections_certificate[19] == 19, + "incorrect value for corrections_certificate[19], expected 19, is %d", + check_msg->corrections_certificate[19]); + ck_assert_msg(check_msg->expiration.day == 30, + "incorrect value for expiration.day, expected 30, is %d", + check_msg->expiration.day); + ck_assert_msg(check_msg->expiration.hours == 12, + "incorrect value for expiration.hours, expected 12, is %d", + check_msg->expiration.hours); + ck_assert_msg(check_msg->expiration.minutes == 34, + "incorrect value for expiration.minutes, expected 34, is %d", + check_msg->expiration.minutes); + ck_assert_msg(check_msg->expiration.month == 3, + "incorrect value for expiration.month, expected 3, is %d", + check_msg->expiration.month); + ck_assert_msg( + check_msg->expiration.ns == 123456789, + "incorrect value for expiration.ns, expected 123456789, is %d", + check_msg->expiration.ns); + ck_assert_msg(check_msg->expiration.seconds == 59, + "incorrect value for expiration.seconds, expected 59, is %d", + check_msg->expiration.seconds); + ck_assert_msg(check_msg->expiration.year == 2024, + "incorrect value for expiration.year, expected 2024, is %d", + check_msg->expiration.year); + ck_assert_msg( + check_msg->intermediate_certificate[0] == 10, + "incorrect value for intermediate_certificate[0], expected 10, is %d", + check_msg->intermediate_certificate[0]); + ck_assert_msg( + check_msg->intermediate_certificate[1] == 11, + "incorrect value for intermediate_certificate[1], expected 11, is %d", + check_msg->intermediate_certificate[1]); + ck_assert_msg( + check_msg->intermediate_certificate[2] == 12, + "incorrect value for intermediate_certificate[2], expected 12, is %d", + check_msg->intermediate_certificate[2]); + ck_assert_msg( + check_msg->intermediate_certificate[3] == 13, + "incorrect value for intermediate_certificate[3], expected 13, is %d", + check_msg->intermediate_certificate[3]); + ck_assert_msg( + check_msg->intermediate_certificate[4] == 14, + "incorrect value for intermediate_certificate[4], expected 14, is %d", + check_msg->intermediate_certificate[4]); + ck_assert_msg( + check_msg->intermediate_certificate[5] == 15, + "incorrect value for intermediate_certificate[5], expected 15, is %d", + check_msg->intermediate_certificate[5]); + ck_assert_msg( + check_msg->intermediate_certificate[6] == 16, + "incorrect value for intermediate_certificate[6], expected 16, is %d", + check_msg->intermediate_certificate[6]); + ck_assert_msg( + check_msg->intermediate_certificate[7] == 17, + "incorrect value for intermediate_certificate[7], expected 17, is %d", + check_msg->intermediate_certificate[7]); + ck_assert_msg( + check_msg->intermediate_certificate[8] == 18, + "incorrect value for intermediate_certificate[8], expected 18, is %d", + check_msg->intermediate_certificate[8]); + ck_assert_msg( + check_msg->intermediate_certificate[9] == 19, + "incorrect value for intermediate_certificate[9], expected 19, is %d", + check_msg->intermediate_certificate[9]); + ck_assert_msg( + check_msg->intermediate_certificate[10] == 0, + "incorrect value for intermediate_certificate[10], expected 0, is %d", + check_msg->intermediate_certificate[10]); + ck_assert_msg( + check_msg->intermediate_certificate[11] == 1, + "incorrect value for intermediate_certificate[11], expected 1, is %d", + check_msg->intermediate_certificate[11]); + ck_assert_msg( + check_msg->intermediate_certificate[12] == 2, + "incorrect value for intermediate_certificate[12], expected 2, is %d", + check_msg->intermediate_certificate[12]); + ck_assert_msg( + check_msg->intermediate_certificate[13] == 3, + "incorrect value for intermediate_certificate[13], expected 3, is %d", + check_msg->intermediate_certificate[13]); + ck_assert_msg( + check_msg->intermediate_certificate[14] == 4, + "incorrect value for intermediate_certificate[14], expected 4, is %d", + check_msg->intermediate_certificate[14]); + ck_assert_msg( + check_msg->intermediate_certificate[15] == 5, + "incorrect value for intermediate_certificate[15], expected 5, is %d", + check_msg->intermediate_certificate[15]); + ck_assert_msg( + check_msg->intermediate_certificate[16] == 6, + "incorrect value for intermediate_certificate[16], expected 6, is %d", + check_msg->intermediate_certificate[16]); + ck_assert_msg( + check_msg->intermediate_certificate[17] == 7, + "incorrect value for intermediate_certificate[17], expected 7, is %d", + check_msg->intermediate_certificate[17]); + ck_assert_msg( + check_msg->intermediate_certificate[18] == 8, + "incorrect value for intermediate_certificate[18], expected 8, is %d", + check_msg->intermediate_certificate[18]); + ck_assert_msg( + check_msg->intermediate_certificate[19] == 9, + "incorrect value for intermediate_certificate[19], expected 9, is %d", + check_msg->intermediate_certificate[19]); + ck_assert_msg(check_msg->root_certificate[0] == 0, + "incorrect value for root_certificate[0], expected 0, is %d", + check_msg->root_certificate[0]); + ck_assert_msg(check_msg->root_certificate[1] == 1, + "incorrect value for root_certificate[1], expected 1, is %d", + check_msg->root_certificate[1]); + ck_assert_msg(check_msg->root_certificate[2] == 2, + "incorrect value for root_certificate[2], expected 2, is %d", + check_msg->root_certificate[2]); + ck_assert_msg(check_msg->root_certificate[3] == 3, + "incorrect value for root_certificate[3], expected 3, is %d", + check_msg->root_certificate[3]); + ck_assert_msg(check_msg->root_certificate[4] == 4, + "incorrect value for root_certificate[4], expected 4, is %d", + check_msg->root_certificate[4]); + ck_assert_msg(check_msg->root_certificate[5] == 5, + "incorrect value for root_certificate[5], expected 5, is %d", + check_msg->root_certificate[5]); + ck_assert_msg(check_msg->root_certificate[6] == 6, + "incorrect value for root_certificate[6], expected 6, is %d", + check_msg->root_certificate[6]); + ck_assert_msg(check_msg->root_certificate[7] == 7, + "incorrect value for root_certificate[7], expected 7, is %d", + check_msg->root_certificate[7]); + ck_assert_msg(check_msg->root_certificate[8] == 8, + "incorrect value for root_certificate[8], expected 8, is %d", + check_msg->root_certificate[8]); + ck_assert_msg(check_msg->root_certificate[9] == 9, + "incorrect value for root_certificate[9], expected 9, is %d", + check_msg->root_certificate[9]); + ck_assert_msg( + check_msg->root_certificate[10] == 10, + "incorrect value for root_certificate[10], expected 10, is %d", + check_msg->root_certificate[10]); + ck_assert_msg( + check_msg->root_certificate[11] == 11, + "incorrect value for root_certificate[11], expected 11, is %d", + check_msg->root_certificate[11]); + ck_assert_msg( + check_msg->root_certificate[12] == 12, + "incorrect value for root_certificate[12], expected 12, is %d", + check_msg->root_certificate[12]); + ck_assert_msg( + check_msg->root_certificate[13] == 13, + "incorrect value for root_certificate[13], expected 13, is %d", + check_msg->root_certificate[13]); + ck_assert_msg( + check_msg->root_certificate[14] == 14, + "incorrect value for root_certificate[14], expected 14, is %d", + check_msg->root_certificate[14]); + ck_assert_msg( + check_msg->root_certificate[15] == 15, + "incorrect value for root_certificate[15], expected 15, is %d", + check_msg->root_certificate[15]); + ck_assert_msg( + check_msg->root_certificate[16] == 16, + "incorrect value for root_certificate[16], expected 16, is %d", + check_msg->root_certificate[16]); + ck_assert_msg( + check_msg->root_certificate[17] == 17, + "incorrect value for root_certificate[17], expected 17, is %d", + check_msg->root_certificate[17]); + ck_assert_msg( + check_msg->root_certificate[18] == 18, + "incorrect value for root_certificate[18], expected 18, is %d", + check_msg->root_certificate[18]); + ck_assert_msg( + check_msg->root_certificate[19] == 19, + "incorrect value for root_certificate[19], expected 19, is %d", + check_msg->root_certificate[19]); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 0, + "incorrect value for signature[8], expected 0, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 1, + "incorrect value for signature[9], expected 1, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 2, + "incorrect value for signature[10], expected 2, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 3, + "incorrect value for signature[11], expected 3, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 4, + "incorrect value for signature[12], expected 4, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 5, + "incorrect value for signature[13], expected 5, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 6, + "incorrect value for signature[14], expected 6, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 7, + "incorrect value for signature[15], expected 7, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 0, + "incorrect value for signature[16], expected 0, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 1, + "incorrect value for signature[17], expected 1, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 2, + "incorrect value for signature[18], expected 2, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 3, + "incorrect value for signature[19], expected 3, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 4, + "incorrect value for signature[20], expected 4, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 5, + "incorrect value for signature[21], expected 5, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 6, + "incorrect value for signature[22], expected 6, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 7, + "incorrect value for signature[23], expected 7, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 0, + "incorrect value for signature[24], expected 0, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 1, + "incorrect value for signature[25], expected 1, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 2, + "incorrect value for signature[26], expected 2, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 3, + "incorrect value for signature[27], expected 3, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 4, + "incorrect value for signature[28], expected 4, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 5, + "incorrect value for signature[29], expected 5, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 6, + "incorrect value for signature[30], expected 6, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 7, + "incorrect value for signature[31], expected 7, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 0, + "incorrect value for signature[32], expected 0, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 1, + "incorrect value for signature[33], expected 1, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 2, + "incorrect value for signature[34], expected 2, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 3, + "incorrect value for signature[35], expected 3, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 4, + "incorrect value for signature[36], expected 4, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 5, + "incorrect value for signature[37], expected 5, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 6, + "incorrect value for signature[38], expected 6, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 7, + "incorrect value for signature[39], expected 7, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 0, + "incorrect value for signature[40], expected 0, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 1, + "incorrect value for signature[41], expected 1, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 2, + "incorrect value for signature[42], expected 2, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 3, + "incorrect value for signature[43], expected 3, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 4, + "incorrect value for signature[44], expected 4, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 5, + "incorrect value for signature[45], expected 5, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 6, + "incorrect value for signature[46], expected 6, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 7, + "incorrect value for signature[47], expected 7, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 0, + "incorrect value for signature[48], expected 0, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 1, + "incorrect value for signature[49], expected 1, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 2, + "incorrect value for signature[50], expected 2, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 3, + "incorrect value for signature[51], expected 3, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 4, + "incorrect value for signature[52], expected 4, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 5, + "incorrect value for signature[53], expected 5, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 6, + "incorrect value for signature[54], expected 6, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 7, + "incorrect value for signature[55], expected 7, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 0, + "incorrect value for signature[56], expected 0, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 1, + "incorrect value for signature[57], expected 1, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 2, + "incorrect value for signature[58], expected 2, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 3, + "incorrect value for signature[59], expected 3, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 4, + "incorrect value for signature[60], expected 4, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 5, + "incorrect value for signature[61], expected 5, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 6, + "incorrect value for signature[62], expected 6, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 7, + "incorrect value for signature[63], expected 7, is %d", + check_msg->signature[63]); + } +} +END_TEST + +Suite *legacy_auto_check_sbp_signing_MsgCertificateChainDep_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgCertificateChainDep"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgCertificateChainDep"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgCertificateChainDep); + suite_add_tcase(s, tc_acq); + return s; +} \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c index 297ebf98bd..1af4072e93 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignature.c @@ -116,18 +116,18 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { logging_reset(); - sbp_payload_callback_register(&sbp_state, 0xC07, &msg_callback, + sbp_payload_callback_register(&sbp_state, 0xC08, &msg_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n); - sbp_frame_callback_register(&sbp_state, 0xC07, &frame_callback, + sbp_frame_callback_register(&sbp_state, 0xC08, &frame_callback, &DUMMY_MEMORY_FOR_CALLBACKS, &n2); u8 encoded_frame[] = { - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, }; dummy_reset(); @@ -158,368 +158,368 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { } test_msg->certificate_id[3] = 4; test_msg->flags = 0; - test_msg->n_signature_bytes = 72; test_msg->on_demand_counter = 2; - if (sizeof(test_msg->signature) == 0) { + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[8] = 8; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[9] = 9; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[10] = 10; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[11] = 11; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[12] = 12; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[13] = 13; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[14] = 14; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[15] = 15; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[16] = 16; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[17] = 17; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[18] = 18; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[19] = 19; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[20] = 20; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[21] = 21; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[22] = 22; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[23] = 23; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[24] = 24; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[25] = 25; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[26] = 26; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[27] = 27; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[28] = 28; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[29] = 29; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[30] = 30; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[31] = 31; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[32] = 32; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[33] = 33; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[34] = 34; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[35] = 35; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[36] = 36; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[37] = 37; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[38] = 38; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[39] = 39; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[40] = 40; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[41] = 41; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[42] = 42; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[43] = 43; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[44] = 44; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[45] = 45; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[46] = 46; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[47] = 47; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[48] = 48; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[49] = 49; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[50] = 50; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[51] = 51; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[52] = 52; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[53] = 53; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[54] = 54; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[55] = 55; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[56] = 56; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[57] = 57; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[58] = 58; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[59] = 59; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[60] = 60; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[61] = 61; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[62] = 62; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[63] = 63; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[64] = 64; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[65] = 65; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[66] = 66; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[67] = 67; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[68] = 68; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[69] = 69; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[70] = 70; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len += sizeof(test_msg->signature[0]); + test_msg_len += sizeof(test_msg->signature.data[0]); } - test_msg->signature[71] = 71; + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; if (sizeof(test_msg->signed_messages) == 0) { // Cope with variable length arrays test_msg_len += sizeof(test_msg->signed_messages[0]); @@ -536,7 +536,7 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { } test_msg->signed_messages[2] = 23; test_msg->stream_counter = 1; - sbp_payload_send(&sbp_state, 0xC07, 66, test_msg_len, test_msg_storage, + sbp_payload_send(&sbp_state, 0xC08, 66, test_msg_len, test_msg_storage, &dummy_write); ck_assert_msg( @@ -570,7 +570,7 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { "frame_callback: one callback should have been logged"); ck_assert_msg(last_frame.sender_id == 66, "frame_callback: sender_id decoded incorrectly"); - ck_assert_msg(last_frame.msg_type == 0xC07, + ck_assert_msg(last_frame.msg_type == 0xC08, "frame_callback: msg_type decoded incorrectly"); ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, "frame_callback: msg_len decoded incorrectly"); @@ -606,228 +606,228 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignature) { ck_assert_msg(check_msg->flags == 0, "incorrect value for flags, expected 0, is %d", check_msg->flags); - ck_assert_msg(check_msg->n_signature_bytes == 72, - "incorrect value for n_signature_bytes, expected 72, is %d", - check_msg->n_signature_bytes); ck_assert_msg(check_msg->on_demand_counter == 2, "incorrect value for on_demand_counter, expected 2, is %d", check_msg->on_demand_counter); - ck_assert_msg(check_msg->signature[0] == 0, - "incorrect value for signature[0], expected 0, is %d", - check_msg->signature[0]); - ck_assert_msg(check_msg->signature[1] == 1, - "incorrect value for signature[1], expected 1, is %d", - check_msg->signature[1]); - ck_assert_msg(check_msg->signature[2] == 2, - "incorrect value for signature[2], expected 2, is %d", - check_msg->signature[2]); - ck_assert_msg(check_msg->signature[3] == 3, - "incorrect value for signature[3], expected 3, is %d", - check_msg->signature[3]); - ck_assert_msg(check_msg->signature[4] == 4, - "incorrect value for signature[4], expected 4, is %d", - check_msg->signature[4]); - ck_assert_msg(check_msg->signature[5] == 5, - "incorrect value for signature[5], expected 5, is %d", - check_msg->signature[5]); - ck_assert_msg(check_msg->signature[6] == 6, - "incorrect value for signature[6], expected 6, is %d", - check_msg->signature[6]); - ck_assert_msg(check_msg->signature[7] == 7, - "incorrect value for signature[7], expected 7, is %d", - check_msg->signature[7]); - ck_assert_msg(check_msg->signature[8] == 8, - "incorrect value for signature[8], expected 8, is %d", - check_msg->signature[8]); - ck_assert_msg(check_msg->signature[9] == 9, - "incorrect value for signature[9], expected 9, is %d", - check_msg->signature[9]); - ck_assert_msg(check_msg->signature[10] == 10, - "incorrect value for signature[10], expected 10, is %d", - check_msg->signature[10]); - ck_assert_msg(check_msg->signature[11] == 11, - "incorrect value for signature[11], expected 11, is %d", - check_msg->signature[11]); - ck_assert_msg(check_msg->signature[12] == 12, - "incorrect value for signature[12], expected 12, is %d", - check_msg->signature[12]); - ck_assert_msg(check_msg->signature[13] == 13, - "incorrect value for signature[13], expected 13, is %d", - check_msg->signature[13]); - ck_assert_msg(check_msg->signature[14] == 14, - "incorrect value for signature[14], expected 14, is %d", - check_msg->signature[14]); - ck_assert_msg(check_msg->signature[15] == 15, - "incorrect value for signature[15], expected 15, is %d", - check_msg->signature[15]); - ck_assert_msg(check_msg->signature[16] == 16, - "incorrect value for signature[16], expected 16, is %d", - check_msg->signature[16]); - ck_assert_msg(check_msg->signature[17] == 17, - "incorrect value for signature[17], expected 17, is %d", - check_msg->signature[17]); - ck_assert_msg(check_msg->signature[18] == 18, - "incorrect value for signature[18], expected 18, is %d", - check_msg->signature[18]); - ck_assert_msg(check_msg->signature[19] == 19, - "incorrect value for signature[19], expected 19, is %d", - check_msg->signature[19]); - ck_assert_msg(check_msg->signature[20] == 20, - "incorrect value for signature[20], expected 20, is %d", - check_msg->signature[20]); - ck_assert_msg(check_msg->signature[21] == 21, - "incorrect value for signature[21], expected 21, is %d", - check_msg->signature[21]); - ck_assert_msg(check_msg->signature[22] == 22, - "incorrect value for signature[22], expected 22, is %d", - check_msg->signature[22]); - ck_assert_msg(check_msg->signature[23] == 23, - "incorrect value for signature[23], expected 23, is %d", - check_msg->signature[23]); - ck_assert_msg(check_msg->signature[24] == 24, - "incorrect value for signature[24], expected 24, is %d", - check_msg->signature[24]); - ck_assert_msg(check_msg->signature[25] == 25, - "incorrect value for signature[25], expected 25, is %d", - check_msg->signature[25]); - ck_assert_msg(check_msg->signature[26] == 26, - "incorrect value for signature[26], expected 26, is %d", - check_msg->signature[26]); - ck_assert_msg(check_msg->signature[27] == 27, - "incorrect value for signature[27], expected 27, is %d", - check_msg->signature[27]); - ck_assert_msg(check_msg->signature[28] == 28, - "incorrect value for signature[28], expected 28, is %d", - check_msg->signature[28]); - ck_assert_msg(check_msg->signature[29] == 29, - "incorrect value for signature[29], expected 29, is %d", - check_msg->signature[29]); - ck_assert_msg(check_msg->signature[30] == 30, - "incorrect value for signature[30], expected 30, is %d", - check_msg->signature[30]); - ck_assert_msg(check_msg->signature[31] == 31, - "incorrect value for signature[31], expected 31, is %d", - check_msg->signature[31]); - ck_assert_msg(check_msg->signature[32] == 32, - "incorrect value for signature[32], expected 32, is %d", - check_msg->signature[32]); - ck_assert_msg(check_msg->signature[33] == 33, - "incorrect value for signature[33], expected 33, is %d", - check_msg->signature[33]); - ck_assert_msg(check_msg->signature[34] == 34, - "incorrect value for signature[34], expected 34, is %d", - check_msg->signature[34]); - ck_assert_msg(check_msg->signature[35] == 35, - "incorrect value for signature[35], expected 35, is %d", - check_msg->signature[35]); - ck_assert_msg(check_msg->signature[36] == 36, - "incorrect value for signature[36], expected 36, is %d", - check_msg->signature[36]); - ck_assert_msg(check_msg->signature[37] == 37, - "incorrect value for signature[37], expected 37, is %d", - check_msg->signature[37]); - ck_assert_msg(check_msg->signature[38] == 38, - "incorrect value for signature[38], expected 38, is %d", - check_msg->signature[38]); - ck_assert_msg(check_msg->signature[39] == 39, - "incorrect value for signature[39], expected 39, is %d", - check_msg->signature[39]); - ck_assert_msg(check_msg->signature[40] == 40, - "incorrect value for signature[40], expected 40, is %d", - check_msg->signature[40]); - ck_assert_msg(check_msg->signature[41] == 41, - "incorrect value for signature[41], expected 41, is %d", - check_msg->signature[41]); - ck_assert_msg(check_msg->signature[42] == 42, - "incorrect value for signature[42], expected 42, is %d", - check_msg->signature[42]); - ck_assert_msg(check_msg->signature[43] == 43, - "incorrect value for signature[43], expected 43, is %d", - check_msg->signature[43]); - ck_assert_msg(check_msg->signature[44] == 44, - "incorrect value for signature[44], expected 44, is %d", - check_msg->signature[44]); - ck_assert_msg(check_msg->signature[45] == 45, - "incorrect value for signature[45], expected 45, is %d", - check_msg->signature[45]); - ck_assert_msg(check_msg->signature[46] == 46, - "incorrect value for signature[46], expected 46, is %d", - check_msg->signature[46]); - ck_assert_msg(check_msg->signature[47] == 47, - "incorrect value for signature[47], expected 47, is %d", - check_msg->signature[47]); - ck_assert_msg(check_msg->signature[48] == 48, - "incorrect value for signature[48], expected 48, is %d", - check_msg->signature[48]); - ck_assert_msg(check_msg->signature[49] == 49, - "incorrect value for signature[49], expected 49, is %d", - check_msg->signature[49]); - ck_assert_msg(check_msg->signature[50] == 50, - "incorrect value for signature[50], expected 50, is %d", - check_msg->signature[50]); - ck_assert_msg(check_msg->signature[51] == 51, - "incorrect value for signature[51], expected 51, is %d", - check_msg->signature[51]); - ck_assert_msg(check_msg->signature[52] == 52, - "incorrect value for signature[52], expected 52, is %d", - check_msg->signature[52]); - ck_assert_msg(check_msg->signature[53] == 53, - "incorrect value for signature[53], expected 53, is %d", - check_msg->signature[53]); - ck_assert_msg(check_msg->signature[54] == 54, - "incorrect value for signature[54], expected 54, is %d", - check_msg->signature[54]); - ck_assert_msg(check_msg->signature[55] == 55, - "incorrect value for signature[55], expected 55, is %d", - check_msg->signature[55]); - ck_assert_msg(check_msg->signature[56] == 56, - "incorrect value for signature[56], expected 56, is %d", - check_msg->signature[56]); - ck_assert_msg(check_msg->signature[57] == 57, - "incorrect value for signature[57], expected 57, is %d", - check_msg->signature[57]); - ck_assert_msg(check_msg->signature[58] == 58, - "incorrect value for signature[58], expected 58, is %d", - check_msg->signature[58]); - ck_assert_msg(check_msg->signature[59] == 59, - "incorrect value for signature[59], expected 59, is %d", - check_msg->signature[59]); - ck_assert_msg(check_msg->signature[60] == 60, - "incorrect value for signature[60], expected 60, is %d", - check_msg->signature[60]); - ck_assert_msg(check_msg->signature[61] == 61, - "incorrect value for signature[61], expected 61, is %d", - check_msg->signature[61]); - ck_assert_msg(check_msg->signature[62] == 62, - "incorrect value for signature[62], expected 62, is %d", - check_msg->signature[62]); - ck_assert_msg(check_msg->signature[63] == 63, - "incorrect value for signature[63], expected 63, is %d", - check_msg->signature[63]); - ck_assert_msg(check_msg->signature[64] == 64, - "incorrect value for signature[64], expected 64, is %d", - check_msg->signature[64]); - ck_assert_msg(check_msg->signature[65] == 65, - "incorrect value for signature[65], expected 65, is %d", - check_msg->signature[65]); - ck_assert_msg(check_msg->signature[66] == 66, - "incorrect value for signature[66], expected 66, is %d", - check_msg->signature[66]); - ck_assert_msg(check_msg->signature[67] == 67, - "incorrect value for signature[67], expected 67, is %d", - check_msg->signature[67]); - ck_assert_msg(check_msg->signature[68] == 68, - "incorrect value for signature[68], expected 68, is %d", - check_msg->signature[68]); - ck_assert_msg(check_msg->signature[69] == 69, - "incorrect value for signature[69], expected 69, is %d", - check_msg->signature[69]); - ck_assert_msg(check_msg->signature[70] == 70, - "incorrect value for signature[70], expected 70, is %d", - check_msg->signature[70]); - ck_assert_msg(check_msg->signature[71] == 71, - "incorrect value for signature[71], expected 71, is %d", - check_msg->signature[71]); + ck_assert_msg(check_msg->signature.data[0] == 0, + "incorrect value for signature.data[0], expected 0, is %d", + check_msg->signature.data[0]); + ck_assert_msg(check_msg->signature.data[1] == 1, + "incorrect value for signature.data[1], expected 1, is %d", + check_msg->signature.data[1]); + ck_assert_msg(check_msg->signature.data[2] == 2, + "incorrect value for signature.data[2], expected 2, is %d", + check_msg->signature.data[2]); + ck_assert_msg(check_msg->signature.data[3] == 3, + "incorrect value for signature.data[3], expected 3, is %d", + check_msg->signature.data[3]); + ck_assert_msg(check_msg->signature.data[4] == 4, + "incorrect value for signature.data[4], expected 4, is %d", + check_msg->signature.data[4]); + ck_assert_msg(check_msg->signature.data[5] == 5, + "incorrect value for signature.data[5], expected 5, is %d", + check_msg->signature.data[5]); + ck_assert_msg(check_msg->signature.data[6] == 6, + "incorrect value for signature.data[6], expected 6, is %d", + check_msg->signature.data[6]); + ck_assert_msg(check_msg->signature.data[7] == 7, + "incorrect value for signature.data[7], expected 7, is %d", + check_msg->signature.data[7]); + ck_assert_msg(check_msg->signature.data[8] == 8, + "incorrect value for signature.data[8], expected 8, is %d", + check_msg->signature.data[8]); + ck_assert_msg(check_msg->signature.data[9] == 9, + "incorrect value for signature.data[9], expected 9, is %d", + check_msg->signature.data[9]); + ck_assert_msg(check_msg->signature.data[10] == 10, + "incorrect value for signature.data[10], expected 10, is %d", + check_msg->signature.data[10]); + ck_assert_msg(check_msg->signature.data[11] == 11, + "incorrect value for signature.data[11], expected 11, is %d", + check_msg->signature.data[11]); + ck_assert_msg(check_msg->signature.data[12] == 12, + "incorrect value for signature.data[12], expected 12, is %d", + check_msg->signature.data[12]); + ck_assert_msg(check_msg->signature.data[13] == 13, + "incorrect value for signature.data[13], expected 13, is %d", + check_msg->signature.data[13]); + ck_assert_msg(check_msg->signature.data[14] == 14, + "incorrect value for signature.data[14], expected 14, is %d", + check_msg->signature.data[14]); + ck_assert_msg(check_msg->signature.data[15] == 15, + "incorrect value for signature.data[15], expected 15, is %d", + check_msg->signature.data[15]); + ck_assert_msg(check_msg->signature.data[16] == 16, + "incorrect value for signature.data[16], expected 16, is %d", + check_msg->signature.data[16]); + ck_assert_msg(check_msg->signature.data[17] == 17, + "incorrect value for signature.data[17], expected 17, is %d", + check_msg->signature.data[17]); + ck_assert_msg(check_msg->signature.data[18] == 18, + "incorrect value for signature.data[18], expected 18, is %d", + check_msg->signature.data[18]); + ck_assert_msg(check_msg->signature.data[19] == 19, + "incorrect value for signature.data[19], expected 19, is %d", + check_msg->signature.data[19]); + ck_assert_msg(check_msg->signature.data[20] == 20, + "incorrect value for signature.data[20], expected 20, is %d", + check_msg->signature.data[20]); + ck_assert_msg(check_msg->signature.data[21] == 21, + "incorrect value for signature.data[21], expected 21, is %d", + check_msg->signature.data[21]); + ck_assert_msg(check_msg->signature.data[22] == 22, + "incorrect value for signature.data[22], expected 22, is %d", + check_msg->signature.data[22]); + ck_assert_msg(check_msg->signature.data[23] == 23, + "incorrect value for signature.data[23], expected 23, is %d", + check_msg->signature.data[23]); + ck_assert_msg(check_msg->signature.data[24] == 24, + "incorrect value for signature.data[24], expected 24, is %d", + check_msg->signature.data[24]); + ck_assert_msg(check_msg->signature.data[25] == 25, + "incorrect value for signature.data[25], expected 25, is %d", + check_msg->signature.data[25]); + ck_assert_msg(check_msg->signature.data[26] == 26, + "incorrect value for signature.data[26], expected 26, is %d", + check_msg->signature.data[26]); + ck_assert_msg(check_msg->signature.data[27] == 27, + "incorrect value for signature.data[27], expected 27, is %d", + check_msg->signature.data[27]); + ck_assert_msg(check_msg->signature.data[28] == 28, + "incorrect value for signature.data[28], expected 28, is %d", + check_msg->signature.data[28]); + ck_assert_msg(check_msg->signature.data[29] == 29, + "incorrect value for signature.data[29], expected 29, is %d", + check_msg->signature.data[29]); + ck_assert_msg(check_msg->signature.data[30] == 30, + "incorrect value for signature.data[30], expected 30, is %d", + check_msg->signature.data[30]); + ck_assert_msg(check_msg->signature.data[31] == 31, + "incorrect value for signature.data[31], expected 31, is %d", + check_msg->signature.data[31]); + ck_assert_msg(check_msg->signature.data[32] == 32, + "incorrect value for signature.data[32], expected 32, is %d", + check_msg->signature.data[32]); + ck_assert_msg(check_msg->signature.data[33] == 33, + "incorrect value for signature.data[33], expected 33, is %d", + check_msg->signature.data[33]); + ck_assert_msg(check_msg->signature.data[34] == 34, + "incorrect value for signature.data[34], expected 34, is %d", + check_msg->signature.data[34]); + ck_assert_msg(check_msg->signature.data[35] == 35, + "incorrect value for signature.data[35], expected 35, is %d", + check_msg->signature.data[35]); + ck_assert_msg(check_msg->signature.data[36] == 36, + "incorrect value for signature.data[36], expected 36, is %d", + check_msg->signature.data[36]); + ck_assert_msg(check_msg->signature.data[37] == 37, + "incorrect value for signature.data[37], expected 37, is %d", + check_msg->signature.data[37]); + ck_assert_msg(check_msg->signature.data[38] == 38, + "incorrect value for signature.data[38], expected 38, is %d", + check_msg->signature.data[38]); + ck_assert_msg(check_msg->signature.data[39] == 39, + "incorrect value for signature.data[39], expected 39, is %d", + check_msg->signature.data[39]); + ck_assert_msg(check_msg->signature.data[40] == 40, + "incorrect value for signature.data[40], expected 40, is %d", + check_msg->signature.data[40]); + ck_assert_msg(check_msg->signature.data[41] == 41, + "incorrect value for signature.data[41], expected 41, is %d", + check_msg->signature.data[41]); + ck_assert_msg(check_msg->signature.data[42] == 42, + "incorrect value for signature.data[42], expected 42, is %d", + check_msg->signature.data[42]); + ck_assert_msg(check_msg->signature.data[43] == 43, + "incorrect value for signature.data[43], expected 43, is %d", + check_msg->signature.data[43]); + ck_assert_msg(check_msg->signature.data[44] == 44, + "incorrect value for signature.data[44], expected 44, is %d", + check_msg->signature.data[44]); + ck_assert_msg(check_msg->signature.data[45] == 45, + "incorrect value for signature.data[45], expected 45, is %d", + check_msg->signature.data[45]); + ck_assert_msg(check_msg->signature.data[46] == 46, + "incorrect value for signature.data[46], expected 46, is %d", + check_msg->signature.data[46]); + ck_assert_msg(check_msg->signature.data[47] == 47, + "incorrect value for signature.data[47], expected 47, is %d", + check_msg->signature.data[47]); + ck_assert_msg(check_msg->signature.data[48] == 48, + "incorrect value for signature.data[48], expected 48, is %d", + check_msg->signature.data[48]); + ck_assert_msg(check_msg->signature.data[49] == 49, + "incorrect value for signature.data[49], expected 49, is %d", + check_msg->signature.data[49]); + ck_assert_msg(check_msg->signature.data[50] == 50, + "incorrect value for signature.data[50], expected 50, is %d", + check_msg->signature.data[50]); + ck_assert_msg(check_msg->signature.data[51] == 51, + "incorrect value for signature.data[51], expected 51, is %d", + check_msg->signature.data[51]); + ck_assert_msg(check_msg->signature.data[52] == 52, + "incorrect value for signature.data[52], expected 52, is %d", + check_msg->signature.data[52]); + ck_assert_msg(check_msg->signature.data[53] == 53, + "incorrect value for signature.data[53], expected 53, is %d", + check_msg->signature.data[53]); + ck_assert_msg(check_msg->signature.data[54] == 54, + "incorrect value for signature.data[54], expected 54, is %d", + check_msg->signature.data[54]); + ck_assert_msg(check_msg->signature.data[55] == 55, + "incorrect value for signature.data[55], expected 55, is %d", + check_msg->signature.data[55]); + ck_assert_msg(check_msg->signature.data[56] == 56, + "incorrect value for signature.data[56], expected 56, is %d", + check_msg->signature.data[56]); + ck_assert_msg(check_msg->signature.data[57] == 57, + "incorrect value for signature.data[57], expected 57, is %d", + check_msg->signature.data[57]); + ck_assert_msg(check_msg->signature.data[58] == 58, + "incorrect value for signature.data[58], expected 58, is %d", + check_msg->signature.data[58]); + ck_assert_msg(check_msg->signature.data[59] == 59, + "incorrect value for signature.data[59], expected 59, is %d", + check_msg->signature.data[59]); + ck_assert_msg(check_msg->signature.data[60] == 60, + "incorrect value for signature.data[60], expected 60, is %d", + check_msg->signature.data[60]); + ck_assert_msg(check_msg->signature.data[61] == 61, + "incorrect value for signature.data[61], expected 61, is %d", + check_msg->signature.data[61]); + ck_assert_msg(check_msg->signature.data[62] == 62, + "incorrect value for signature.data[62], expected 62, is %d", + check_msg->signature.data[62]); + ck_assert_msg(check_msg->signature.data[63] == 63, + "incorrect value for signature.data[63], expected 63, is %d", + check_msg->signature.data[63]); + ck_assert_msg(check_msg->signature.data[64] == 64, + "incorrect value for signature.data[64], expected 64, is %d", + check_msg->signature.data[64]); + ck_assert_msg(check_msg->signature.data[65] == 65, + "incorrect value for signature.data[65], expected 65, is %d", + check_msg->signature.data[65]); + ck_assert_msg(check_msg->signature.data[66] == 66, + "incorrect value for signature.data[66], expected 66, is %d", + check_msg->signature.data[66]); + ck_assert_msg(check_msg->signature.data[67] == 67, + "incorrect value for signature.data[67], expected 67, is %d", + check_msg->signature.data[67]); + ck_assert_msg(check_msg->signature.data[68] == 68, + "incorrect value for signature.data[68], expected 68, is %d", + check_msg->signature.data[68]); + ck_assert_msg(check_msg->signature.data[69] == 69, + "incorrect value for signature.data[69], expected 69, is %d", + check_msg->signature.data[69]); + ck_assert_msg(check_msg->signature.data[70] == 70, + "incorrect value for signature.data[70], expected 70, is %d", + check_msg->signature.data[70]); + ck_assert_msg(check_msg->signature.data[71] == 71, + "incorrect value for signature.data[71], expected 71, is %d", + check_msg->signature.data[71]); + ck_assert_msg(check_msg->signature.len == 72, + "incorrect value for signature.len, expected 72, is %d", + check_msg->signature.len); ck_assert_msg(check_msg->signed_messages[0] == 10, "incorrect value for signed_messages[0], expected 10, is %d", check_msg->signed_messages[0]); diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDep.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c similarity index 99% rename from c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDep.c rename to c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c index e52f29dc80..fddf4bcaab 100644 --- a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDep.c +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepA.c @@ -11,7 +11,7 @@ */ // This file was auto-generated from -// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by // generate.py. Do not modify by hand! #include @@ -93,7 +93,7 @@ static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], last_frame.context = context; } -START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep) { +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA) { static sbp_msg_callbacks_node_t n; static sbp_msg_callbacks_node_t n2; @@ -148,8 +148,8 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep) { u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; memset(test_msg_storage, 0, sizeof(test_msg_storage)); u8 test_msg_len = 0; - msg_ecdsa_signature_dep_t *test_msg = - (msg_ecdsa_signature_dep_t *)test_msg_storage; + msg_ecdsa_signature_dep_a_t *test_msg = + (msg_ecdsa_signature_dep_a_t *)test_msg_storage; test_msg_len = sizeof(*test_msg); if (sizeof(test_msg->certificate_id) == 0) { // Cope with variable length arrays @@ -1465,8 +1465,8 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep) { // Cast to expected message type - the +6 byte offset is where the payload // starts - msg_ecdsa_signature_dep_t *check_msg = - (msg_ecdsa_signature_dep_t *)((void *)last_msg.msg); + msg_ecdsa_signature_dep_a_t *check_msg = + (msg_ecdsa_signature_dep_a_t *)((void *)last_msg.msg); // Run tests against fields ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); ck_assert_msg(check_msg->certificate_id[0] == 1, @@ -2363,14 +2363,14 @@ START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep) { } END_TEST -Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep_suite(void) { +Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA_suite(void) { Suite *s = suite_create( "SBP generated test suite: " - "legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep"); + "legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); TCase *tc_acq = tcase_create( - "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep"); + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA"); tcase_add_test(tc_acq, - test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep); + test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA); suite_add_tcase(s, tc_acq); return s; } \ No newline at end of file diff --git a/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c new file mode 100644 index 0000000000..c4dbe5e194 --- /dev/null +++ b/c/test/legacy/auto_check_sbp_signing_MsgEcdsaSignatureDepB.c @@ -0,0 +1,858 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include // for debugging +#include // for malloc + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + u8 len; + u8 msg[SBP_MAX_PAYLOAD_LEN]; + void *context; +} last_msg; + +static struct { + u32 n_callbacks_logged; + u16 sender_id; + u16 msg_type; + u8 msg_len; + u8 msg[SBP_MAX_PAYLOAD_LEN]; + u16 frame_len; + u8 frame[SBP_MAX_FRAME_LEN]; + void *context; +} last_frame; + +static u32 dummy_wr = 0; +static u32 dummy_rd = 0; +static u8 dummy_buff[1024]; +static void *last_io_context; + +static int DUMMY_MEMORY_FOR_CALLBACKS = 0xdeadbeef; +static int DUMMY_MEMORY_FOR_IO = 0xdead0000; + +static void dummy_reset() { + dummy_rd = dummy_wr = 0; + memset(dummy_buff, 0, sizeof(dummy_buff)); +} + +static s32 dummy_write(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(dummy_buff + dummy_wr, buff, real_n); + dummy_wr += real_n; + return real_n; +} + +static s32 dummy_read(u8 *buff, u32 n, void *context) { + last_io_context = context; + u32 real_n = n; //(dummy_n > n) ? n : dummy_n; + memcpy(buff, dummy_buff + dummy_rd, real_n); + dummy_rd += real_n; + return real_n; +} + +static void logging_reset() { + memset(&last_msg, 0, sizeof(last_msg)); + memset(&last_frame, 0, sizeof(last_frame)); +} + +static void msg_callback(u16 sender_id, u8 len, u8 msg[], void *context) { + last_msg.n_callbacks_logged++; + last_msg.sender_id = sender_id; + last_msg.len = len; + last_msg.context = context; + memcpy(last_msg.msg, msg, len); +} + +static void frame_callback(u16 sender_id, u16 msg_type, u8 msg_len, u8 msg[], + u16 frame_len, u8 frame[], void *context) { + last_frame.n_callbacks_logged++; + last_frame.sender_id = sender_id; + last_frame.msg_type = msg_type; + last_frame.msg_len = msg_len; + memcpy(last_frame.msg, msg, msg_len); + last_frame.frame_len = frame_len; + memcpy(last_frame.frame, frame, frame_len); + last_frame.context = context; +} + +START_TEST(test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB) { + static sbp_msg_callbacks_node_t n; + static sbp_msg_callbacks_node_t n2; + + // State of the SBP message parser. + // Must be statically allocated. + sbp_state_t sbp_state; + + // + // Run tests: + // + // Test successful parsing of a message + { + // SBP parser state must be initialized before sbp_process is called. + // We re-initialize before every test so that callbacks for the same message + // types can be + // allocated multiple times across different tests. + sbp_state_init(&sbp_state); + + sbp_state_set_io_context(&sbp_state, &DUMMY_MEMORY_FOR_IO); + + logging_reset(); + + sbp_payload_callback_register(&sbp_state, 0xC07, &msg_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n); + sbp_frame_callback_register(&sbp_state, 0xC07, &frame_callback, + &DUMMY_MEMORY_FOR_CALLBACKS, &n2); + + u8 encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; + + dummy_reset(); + + u8 test_msg_storage[SBP_MAX_PAYLOAD_LEN]; + memset(test_msg_storage, 0, sizeof(test_msg_storage)); + u8 test_msg_len = 0; + msg_ecdsa_signature_dep_b_t *test_msg = + (msg_ecdsa_signature_dep_b_t *)test_msg_storage; + test_msg_len = sizeof(*test_msg); + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->certificate_id[0]); + } + test_msg->certificate_id[0] = 1; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->certificate_id[0]); + } + test_msg->certificate_id[1] = 2; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->certificate_id[0]); + } + test_msg->certificate_id[2] = 3; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->certificate_id[0]); + } + test_msg->certificate_id[3] = 4; + test_msg->flags = 0; + test_msg->n_signature_bytes = 72; + test_msg->on_demand_counter = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[8] = 8; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[9] = 9; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[10] = 10; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[11] = 11; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[12] = 12; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[13] = 13; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[14] = 14; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[15] = 15; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[16] = 16; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[17] = 17; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[18] = 18; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[20] = 20; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[21] = 21; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[22] = 22; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[23] = 23; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[24] = 24; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[25] = 25; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[26] = 26; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[27] = 27; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[28] = 28; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[29] = 29; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[30] = 30; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[31] = 31; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[32] = 32; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[33] = 33; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[34] = 34; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[35] = 35; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[36] = 36; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[37] = 37; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[38] = 38; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[39] = 39; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[40] = 40; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[41] = 41; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[42] = 42; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[43] = 43; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[44] = 44; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[45] = 45; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[46] = 46; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[47] = 47; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[48] = 48; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[49] = 49; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[50] = 50; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[51] = 51; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[52] = 52; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[53] = 53; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[54] = 54; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[55] = 55; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[56] = 56; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[57] = 57; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[58] = 58; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[59] = 59; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[60] = 60; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[61] = 61; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[62] = 62; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[63] = 63; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[64] = 64; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[65] = 65; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[66] = 66; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[67] = 67; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[68] = 68; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[69] = 69; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[70] = 70; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signature[0]); + } + test_msg->signature[71] = 71; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signed_messages[0]); + } + test_msg->signed_messages[0] = 10; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signed_messages[0]); + } + test_msg->signed_messages[1] = 21; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len += sizeof(test_msg->signed_messages[0]); + } + test_msg->signed_messages[2] = 23; + test_msg->stream_counter = 1; + sbp_payload_send(&sbp_state, 0xC07, 66, test_msg_len, test_msg_storage, + &dummy_write); + + ck_assert_msg( + test_msg_len == sizeof(encoded_frame) - 8, + "Test message has not been generated correctly, or the encoded frame " + "from the spec is badly defined. Check your test spec"); + + ck_assert_msg(dummy_wr == sizeof(encoded_frame), + "not enough data was written to dummy_buff"); + ck_assert_msg(memcmp(dummy_buff, encoded_frame, sizeof(encoded_frame)) == 0, + "frame was not encoded properly"); + + while (dummy_rd < dummy_wr) { + ck_assert_msg(sbp_process(&sbp_state, &dummy_read) >= SBP_OK, + "sbp_process threw an error!"); + } + + ck_assert_msg(last_msg.n_callbacks_logged == 1, + "msg_callback: one callback should have been logged"); + ck_assert_msg(last_msg.sender_id == 66, + "msg_callback: sender_id decoded incorrectly"); + ck_assert_msg(last_msg.len == sizeof(encoded_frame) - 8, + "msg_callback: len decoded incorrectly"); + ck_assert_msg( + memcmp(last_msg.msg, encoded_frame + 6, sizeof(encoded_frame) - 8) == 0, + "msg_callback: test data decoded incorrectly"); + ck_assert_msg(last_msg.context == &DUMMY_MEMORY_FOR_CALLBACKS, + "frame_callback: context pointer incorrectly passed"); + + ck_assert_msg(last_frame.n_callbacks_logged == 1, + "frame_callback: one callback should have been logged"); + ck_assert_msg(last_frame.sender_id == 66, + "frame_callback: sender_id decoded incorrectly"); + ck_assert_msg(last_frame.msg_type == 0xC07, + "frame_callback: msg_type decoded incorrectly"); + ck_assert_msg(last_frame.msg_len == sizeof(encoded_frame) - 8, + "frame_callback: msg_len decoded incorrectly"); + ck_assert_msg(memcmp(last_frame.msg, encoded_frame + 6, + sizeof(encoded_frame) - 8) == 0, + "frame_callback: test data decoded incorrectly"); + ck_assert_msg(last_frame.frame_len == sizeof(encoded_frame), + "frame_callback: frame_len decoded incorrectly"); + ck_assert_msg( + memcmp(last_frame.frame, encoded_frame, sizeof(encoded_frame)) == 0, + "frame_callback: frame decoded incorrectly"); + ck_assert_msg(last_frame.context == &DUMMY_MEMORY_FOR_CALLBACKS, + "frame_callback: context pointer incorrectly passed"); + + // Cast to expected message type - the +6 byte offset is where the payload + // starts + msg_ecdsa_signature_dep_b_t *check_msg = + (msg_ecdsa_signature_dep_b_t *)((void *)last_msg.msg); + // Run tests against fields + ck_assert_msg(check_msg != 0, "stub to prevent warnings if msg isn't used"); + ck_assert_msg(check_msg->certificate_id[0] == 1, + "incorrect value for certificate_id[0], expected 1, is %d", + check_msg->certificate_id[0]); + ck_assert_msg(check_msg->certificate_id[1] == 2, + "incorrect value for certificate_id[1], expected 2, is %d", + check_msg->certificate_id[1]); + ck_assert_msg(check_msg->certificate_id[2] == 3, + "incorrect value for certificate_id[2], expected 3, is %d", + check_msg->certificate_id[2]); + ck_assert_msg(check_msg->certificate_id[3] == 4, + "incorrect value for certificate_id[3], expected 4, is %d", + check_msg->certificate_id[3]); + ck_assert_msg(check_msg->flags == 0, + "incorrect value for flags, expected 0, is %d", + check_msg->flags); + ck_assert_msg(check_msg->n_signature_bytes == 72, + "incorrect value for n_signature_bytes, expected 72, is %d", + check_msg->n_signature_bytes); + ck_assert_msg(check_msg->on_demand_counter == 2, + "incorrect value for on_demand_counter, expected 2, is %d", + check_msg->on_demand_counter); + ck_assert_msg(check_msg->signature[0] == 0, + "incorrect value for signature[0], expected 0, is %d", + check_msg->signature[0]); + ck_assert_msg(check_msg->signature[1] == 1, + "incorrect value for signature[1], expected 1, is %d", + check_msg->signature[1]); + ck_assert_msg(check_msg->signature[2] == 2, + "incorrect value for signature[2], expected 2, is %d", + check_msg->signature[2]); + ck_assert_msg(check_msg->signature[3] == 3, + "incorrect value for signature[3], expected 3, is %d", + check_msg->signature[3]); + ck_assert_msg(check_msg->signature[4] == 4, + "incorrect value for signature[4], expected 4, is %d", + check_msg->signature[4]); + ck_assert_msg(check_msg->signature[5] == 5, + "incorrect value for signature[5], expected 5, is %d", + check_msg->signature[5]); + ck_assert_msg(check_msg->signature[6] == 6, + "incorrect value for signature[6], expected 6, is %d", + check_msg->signature[6]); + ck_assert_msg(check_msg->signature[7] == 7, + "incorrect value for signature[7], expected 7, is %d", + check_msg->signature[7]); + ck_assert_msg(check_msg->signature[8] == 8, + "incorrect value for signature[8], expected 8, is %d", + check_msg->signature[8]); + ck_assert_msg(check_msg->signature[9] == 9, + "incorrect value for signature[9], expected 9, is %d", + check_msg->signature[9]); + ck_assert_msg(check_msg->signature[10] == 10, + "incorrect value for signature[10], expected 10, is %d", + check_msg->signature[10]); + ck_assert_msg(check_msg->signature[11] == 11, + "incorrect value for signature[11], expected 11, is %d", + check_msg->signature[11]); + ck_assert_msg(check_msg->signature[12] == 12, + "incorrect value for signature[12], expected 12, is %d", + check_msg->signature[12]); + ck_assert_msg(check_msg->signature[13] == 13, + "incorrect value for signature[13], expected 13, is %d", + check_msg->signature[13]); + ck_assert_msg(check_msg->signature[14] == 14, + "incorrect value for signature[14], expected 14, is %d", + check_msg->signature[14]); + ck_assert_msg(check_msg->signature[15] == 15, + "incorrect value for signature[15], expected 15, is %d", + check_msg->signature[15]); + ck_assert_msg(check_msg->signature[16] == 16, + "incorrect value for signature[16], expected 16, is %d", + check_msg->signature[16]); + ck_assert_msg(check_msg->signature[17] == 17, + "incorrect value for signature[17], expected 17, is %d", + check_msg->signature[17]); + ck_assert_msg(check_msg->signature[18] == 18, + "incorrect value for signature[18], expected 18, is %d", + check_msg->signature[18]); + ck_assert_msg(check_msg->signature[19] == 19, + "incorrect value for signature[19], expected 19, is %d", + check_msg->signature[19]); + ck_assert_msg(check_msg->signature[20] == 20, + "incorrect value for signature[20], expected 20, is %d", + check_msg->signature[20]); + ck_assert_msg(check_msg->signature[21] == 21, + "incorrect value for signature[21], expected 21, is %d", + check_msg->signature[21]); + ck_assert_msg(check_msg->signature[22] == 22, + "incorrect value for signature[22], expected 22, is %d", + check_msg->signature[22]); + ck_assert_msg(check_msg->signature[23] == 23, + "incorrect value for signature[23], expected 23, is %d", + check_msg->signature[23]); + ck_assert_msg(check_msg->signature[24] == 24, + "incorrect value for signature[24], expected 24, is %d", + check_msg->signature[24]); + ck_assert_msg(check_msg->signature[25] == 25, + "incorrect value for signature[25], expected 25, is %d", + check_msg->signature[25]); + ck_assert_msg(check_msg->signature[26] == 26, + "incorrect value for signature[26], expected 26, is %d", + check_msg->signature[26]); + ck_assert_msg(check_msg->signature[27] == 27, + "incorrect value for signature[27], expected 27, is %d", + check_msg->signature[27]); + ck_assert_msg(check_msg->signature[28] == 28, + "incorrect value for signature[28], expected 28, is %d", + check_msg->signature[28]); + ck_assert_msg(check_msg->signature[29] == 29, + "incorrect value for signature[29], expected 29, is %d", + check_msg->signature[29]); + ck_assert_msg(check_msg->signature[30] == 30, + "incorrect value for signature[30], expected 30, is %d", + check_msg->signature[30]); + ck_assert_msg(check_msg->signature[31] == 31, + "incorrect value for signature[31], expected 31, is %d", + check_msg->signature[31]); + ck_assert_msg(check_msg->signature[32] == 32, + "incorrect value for signature[32], expected 32, is %d", + check_msg->signature[32]); + ck_assert_msg(check_msg->signature[33] == 33, + "incorrect value for signature[33], expected 33, is %d", + check_msg->signature[33]); + ck_assert_msg(check_msg->signature[34] == 34, + "incorrect value for signature[34], expected 34, is %d", + check_msg->signature[34]); + ck_assert_msg(check_msg->signature[35] == 35, + "incorrect value for signature[35], expected 35, is %d", + check_msg->signature[35]); + ck_assert_msg(check_msg->signature[36] == 36, + "incorrect value for signature[36], expected 36, is %d", + check_msg->signature[36]); + ck_assert_msg(check_msg->signature[37] == 37, + "incorrect value for signature[37], expected 37, is %d", + check_msg->signature[37]); + ck_assert_msg(check_msg->signature[38] == 38, + "incorrect value for signature[38], expected 38, is %d", + check_msg->signature[38]); + ck_assert_msg(check_msg->signature[39] == 39, + "incorrect value for signature[39], expected 39, is %d", + check_msg->signature[39]); + ck_assert_msg(check_msg->signature[40] == 40, + "incorrect value for signature[40], expected 40, is %d", + check_msg->signature[40]); + ck_assert_msg(check_msg->signature[41] == 41, + "incorrect value for signature[41], expected 41, is %d", + check_msg->signature[41]); + ck_assert_msg(check_msg->signature[42] == 42, + "incorrect value for signature[42], expected 42, is %d", + check_msg->signature[42]); + ck_assert_msg(check_msg->signature[43] == 43, + "incorrect value for signature[43], expected 43, is %d", + check_msg->signature[43]); + ck_assert_msg(check_msg->signature[44] == 44, + "incorrect value for signature[44], expected 44, is %d", + check_msg->signature[44]); + ck_assert_msg(check_msg->signature[45] == 45, + "incorrect value for signature[45], expected 45, is %d", + check_msg->signature[45]); + ck_assert_msg(check_msg->signature[46] == 46, + "incorrect value for signature[46], expected 46, is %d", + check_msg->signature[46]); + ck_assert_msg(check_msg->signature[47] == 47, + "incorrect value for signature[47], expected 47, is %d", + check_msg->signature[47]); + ck_assert_msg(check_msg->signature[48] == 48, + "incorrect value for signature[48], expected 48, is %d", + check_msg->signature[48]); + ck_assert_msg(check_msg->signature[49] == 49, + "incorrect value for signature[49], expected 49, is %d", + check_msg->signature[49]); + ck_assert_msg(check_msg->signature[50] == 50, + "incorrect value for signature[50], expected 50, is %d", + check_msg->signature[50]); + ck_assert_msg(check_msg->signature[51] == 51, + "incorrect value for signature[51], expected 51, is %d", + check_msg->signature[51]); + ck_assert_msg(check_msg->signature[52] == 52, + "incorrect value for signature[52], expected 52, is %d", + check_msg->signature[52]); + ck_assert_msg(check_msg->signature[53] == 53, + "incorrect value for signature[53], expected 53, is %d", + check_msg->signature[53]); + ck_assert_msg(check_msg->signature[54] == 54, + "incorrect value for signature[54], expected 54, is %d", + check_msg->signature[54]); + ck_assert_msg(check_msg->signature[55] == 55, + "incorrect value for signature[55], expected 55, is %d", + check_msg->signature[55]); + ck_assert_msg(check_msg->signature[56] == 56, + "incorrect value for signature[56], expected 56, is %d", + check_msg->signature[56]); + ck_assert_msg(check_msg->signature[57] == 57, + "incorrect value for signature[57], expected 57, is %d", + check_msg->signature[57]); + ck_assert_msg(check_msg->signature[58] == 58, + "incorrect value for signature[58], expected 58, is %d", + check_msg->signature[58]); + ck_assert_msg(check_msg->signature[59] == 59, + "incorrect value for signature[59], expected 59, is %d", + check_msg->signature[59]); + ck_assert_msg(check_msg->signature[60] == 60, + "incorrect value for signature[60], expected 60, is %d", + check_msg->signature[60]); + ck_assert_msg(check_msg->signature[61] == 61, + "incorrect value for signature[61], expected 61, is %d", + check_msg->signature[61]); + ck_assert_msg(check_msg->signature[62] == 62, + "incorrect value for signature[62], expected 62, is %d", + check_msg->signature[62]); + ck_assert_msg(check_msg->signature[63] == 63, + "incorrect value for signature[63], expected 63, is %d", + check_msg->signature[63]); + ck_assert_msg(check_msg->signature[64] == 64, + "incorrect value for signature[64], expected 64, is %d", + check_msg->signature[64]); + ck_assert_msg(check_msg->signature[65] == 65, + "incorrect value for signature[65], expected 65, is %d", + check_msg->signature[65]); + ck_assert_msg(check_msg->signature[66] == 66, + "incorrect value for signature[66], expected 66, is %d", + check_msg->signature[66]); + ck_assert_msg(check_msg->signature[67] == 67, + "incorrect value for signature[67], expected 67, is %d", + check_msg->signature[67]); + ck_assert_msg(check_msg->signature[68] == 68, + "incorrect value for signature[68], expected 68, is %d", + check_msg->signature[68]); + ck_assert_msg(check_msg->signature[69] == 69, + "incorrect value for signature[69], expected 69, is %d", + check_msg->signature[69]); + ck_assert_msg(check_msg->signature[70] == 70, + "incorrect value for signature[70], expected 70, is %d", + check_msg->signature[70]); + ck_assert_msg(check_msg->signature[71] == 71, + "incorrect value for signature[71], expected 71, is %d", + check_msg->signature[71]); + ck_assert_msg(check_msg->signed_messages[0] == 10, + "incorrect value for signed_messages[0], expected 10, is %d", + check_msg->signed_messages[0]); + ck_assert_msg(check_msg->signed_messages[1] == 21, + "incorrect value for signed_messages[1], expected 21, is %d", + check_msg->signed_messages[1]); + ck_assert_msg(check_msg->signed_messages[2] == 23, + "incorrect value for signed_messages[2], expected 23, is %d", + check_msg->signed_messages[2]); + ck_assert_msg(check_msg->stream_counter == 1, + "incorrect value for stream_counter, expected 1, is %d", + check_msg->stream_counter); + } +} +END_TEST + +Suite *legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB_suite(void) { + Suite *s = suite_create( + "SBP generated test suite: " + "legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + TCase *tc_acq = tcase_create( + "Automated_Suite_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB"); + tcase_add_test(tc_acq, + test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB); + suite_add_tcase(s, tc_acq); + return s; +} \ No newline at end of file diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc index 22920e7b7b..dc7ae2fc2f 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChain.cc @@ -79,15 +79,15 @@ class Test_legacy_auto_check_sbp_signing_MsgCertificateChain0 TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChain0, Test) { uint8_t encoded_frame[] = { - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, - 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, + 3, 30, 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, }; uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; @@ -462,328 +462,441 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChain0, Test) { (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); } test_msg->root_certificate[19] = 19; - if (sizeof(test_msg->signature) == 0) { + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); + } + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[8] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[9] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[10] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[11] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[12] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[13] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[14] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[15] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[16] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[17] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[18] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[19] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[20] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[21] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[22] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[23] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[24] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[25] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[26] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[27] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[28] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[29] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[30] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[31] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[32] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[33] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[34] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[35] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[36] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[37] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[38] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[39] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[40] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[41] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[42] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[43] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[44] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[45] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[46] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[47] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[48] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[49] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[50] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[51] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[52] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[53] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[54] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[55] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[56] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[57] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[58] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[59] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[60] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[61] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[62] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[63] = 7; + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; - EXPECT_EQ(send_message(0xC05, 66, test_msg_len, test_msg_storage), SBP_OK); + EXPECT_EQ(send_message(0xC09, 66, test_msg_len, test_msg_storage), SBP_OK); EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); @@ -996,196 +1109,223 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChain0, Test) { EXPECT_EQ(last_msg_->root_certificate[19], 19) << "incorrect value for root_certificate[19], expected 19, is " << last_msg_->root_certificate[19]; - EXPECT_EQ(last_msg_->signature[0], 0) - << "incorrect value for signature[0], expected 0, is " - << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) - << "incorrect value for signature[1], expected 1, is " - << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) - << "incorrect value for signature[2], expected 2, is " - << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) - << "incorrect value for signature[3], expected 3, is " - << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) - << "incorrect value for signature[4], expected 4, is " - << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) - << "incorrect value for signature[5], expected 5, is " - << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) - << "incorrect value for signature[6], expected 6, is " - << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) - << "incorrect value for signature[7], expected 7, is " - << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 0) - << "incorrect value for signature[8], expected 0, is " - << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 1) - << "incorrect value for signature[9], expected 1, is " - << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 2) - << "incorrect value for signature[10], expected 2, is " - << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 3) - << "incorrect value for signature[11], expected 3, is " - << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 4) - << "incorrect value for signature[12], expected 4, is " - << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 5) - << "incorrect value for signature[13], expected 5, is " - << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 6) - << "incorrect value for signature[14], expected 6, is " - << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 7) - << "incorrect value for signature[15], expected 7, is " - << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 0) - << "incorrect value for signature[16], expected 0, is " - << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 1) - << "incorrect value for signature[17], expected 1, is " - << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 2) - << "incorrect value for signature[18], expected 2, is " - << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 3) - << "incorrect value for signature[19], expected 3, is " - << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 4) - << "incorrect value for signature[20], expected 4, is " - << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 5) - << "incorrect value for signature[21], expected 5, is " - << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 6) - << "incorrect value for signature[22], expected 6, is " - << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 7) - << "incorrect value for signature[23], expected 7, is " - << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 0) - << "incorrect value for signature[24], expected 0, is " - << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 1) - << "incorrect value for signature[25], expected 1, is " - << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 2) - << "incorrect value for signature[26], expected 2, is " - << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 3) - << "incorrect value for signature[27], expected 3, is " - << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 4) - << "incorrect value for signature[28], expected 4, is " - << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 5) - << "incorrect value for signature[29], expected 5, is " - << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 6) - << "incorrect value for signature[30], expected 6, is " - << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 7) - << "incorrect value for signature[31], expected 7, is " - << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 0) - << "incorrect value for signature[32], expected 0, is " - << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 1) - << "incorrect value for signature[33], expected 1, is " - << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 2) - << "incorrect value for signature[34], expected 2, is " - << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 3) - << "incorrect value for signature[35], expected 3, is " - << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 4) - << "incorrect value for signature[36], expected 4, is " - << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 5) - << "incorrect value for signature[37], expected 5, is " - << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 6) - << "incorrect value for signature[38], expected 6, is " - << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 7) - << "incorrect value for signature[39], expected 7, is " - << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 0) - << "incorrect value for signature[40], expected 0, is " - << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 1) - << "incorrect value for signature[41], expected 1, is " - << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 2) - << "incorrect value for signature[42], expected 2, is " - << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 3) - << "incorrect value for signature[43], expected 3, is " - << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 4) - << "incorrect value for signature[44], expected 4, is " - << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 5) - << "incorrect value for signature[45], expected 5, is " - << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 6) - << "incorrect value for signature[46], expected 6, is " - << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 7) - << "incorrect value for signature[47], expected 7, is " - << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 0) - << "incorrect value for signature[48], expected 0, is " - << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 1) - << "incorrect value for signature[49], expected 1, is " - << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 2) - << "incorrect value for signature[50], expected 2, is " - << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 3) - << "incorrect value for signature[51], expected 3, is " - << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 4) - << "incorrect value for signature[52], expected 4, is " - << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 5) - << "incorrect value for signature[53], expected 5, is " - << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 6) - << "incorrect value for signature[54], expected 6, is " - << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 7) - << "incorrect value for signature[55], expected 7, is " - << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 0) - << "incorrect value for signature[56], expected 0, is " - << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 1) - << "incorrect value for signature[57], expected 1, is " - << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 2) - << "incorrect value for signature[58], expected 2, is " - << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 3) - << "incorrect value for signature[59], expected 3, is " - << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 4) - << "incorrect value for signature[60], expected 4, is " - << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 5) - << "incorrect value for signature[61], expected 5, is " - << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 6) - << "incorrect value for signature[62], expected 6, is " - << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 7) - << "incorrect value for signature[63], expected 7, is " - << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signature.data[0], 0) + << "incorrect value for signature.data[0], expected 0, is " + << last_msg_->signature.data[0]; + EXPECT_EQ(last_msg_->signature.data[1], 1) + << "incorrect value for signature.data[1], expected 1, is " + << last_msg_->signature.data[1]; + EXPECT_EQ(last_msg_->signature.data[2], 2) + << "incorrect value for signature.data[2], expected 2, is " + << last_msg_->signature.data[2]; + EXPECT_EQ(last_msg_->signature.data[3], 3) + << "incorrect value for signature.data[3], expected 3, is " + << last_msg_->signature.data[3]; + EXPECT_EQ(last_msg_->signature.data[4], 4) + << "incorrect value for signature.data[4], expected 4, is " + << last_msg_->signature.data[4]; + EXPECT_EQ(last_msg_->signature.data[5], 5) + << "incorrect value for signature.data[5], expected 5, is " + << last_msg_->signature.data[5]; + EXPECT_EQ(last_msg_->signature.data[6], 6) + << "incorrect value for signature.data[6], expected 6, is " + << last_msg_->signature.data[6]; + EXPECT_EQ(last_msg_->signature.data[7], 7) + << "incorrect value for signature.data[7], expected 7, is " + << last_msg_->signature.data[7]; + EXPECT_EQ(last_msg_->signature.data[8], 8) + << "incorrect value for signature.data[8], expected 8, is " + << last_msg_->signature.data[8]; + EXPECT_EQ(last_msg_->signature.data[9], 9) + << "incorrect value for signature.data[9], expected 9, is " + << last_msg_->signature.data[9]; + EXPECT_EQ(last_msg_->signature.data[10], 10) + << "incorrect value for signature.data[10], expected 10, is " + << last_msg_->signature.data[10]; + EXPECT_EQ(last_msg_->signature.data[11], 11) + << "incorrect value for signature.data[11], expected 11, is " + << last_msg_->signature.data[11]; + EXPECT_EQ(last_msg_->signature.data[12], 12) + << "incorrect value for signature.data[12], expected 12, is " + << last_msg_->signature.data[12]; + EXPECT_EQ(last_msg_->signature.data[13], 13) + << "incorrect value for signature.data[13], expected 13, is " + << last_msg_->signature.data[13]; + EXPECT_EQ(last_msg_->signature.data[14], 14) + << "incorrect value for signature.data[14], expected 14, is " + << last_msg_->signature.data[14]; + EXPECT_EQ(last_msg_->signature.data[15], 15) + << "incorrect value for signature.data[15], expected 15, is " + << last_msg_->signature.data[15]; + EXPECT_EQ(last_msg_->signature.data[16], 16) + << "incorrect value for signature.data[16], expected 16, is " + << last_msg_->signature.data[16]; + EXPECT_EQ(last_msg_->signature.data[17], 17) + << "incorrect value for signature.data[17], expected 17, is " + << last_msg_->signature.data[17]; + EXPECT_EQ(last_msg_->signature.data[18], 18) + << "incorrect value for signature.data[18], expected 18, is " + << last_msg_->signature.data[18]; + EXPECT_EQ(last_msg_->signature.data[19], 19) + << "incorrect value for signature.data[19], expected 19, is " + << last_msg_->signature.data[19]; + EXPECT_EQ(last_msg_->signature.data[20], 20) + << "incorrect value for signature.data[20], expected 20, is " + << last_msg_->signature.data[20]; + EXPECT_EQ(last_msg_->signature.data[21], 21) + << "incorrect value for signature.data[21], expected 21, is " + << last_msg_->signature.data[21]; + EXPECT_EQ(last_msg_->signature.data[22], 22) + << "incorrect value for signature.data[22], expected 22, is " + << last_msg_->signature.data[22]; + EXPECT_EQ(last_msg_->signature.data[23], 23) + << "incorrect value for signature.data[23], expected 23, is " + << last_msg_->signature.data[23]; + EXPECT_EQ(last_msg_->signature.data[24], 24) + << "incorrect value for signature.data[24], expected 24, is " + << last_msg_->signature.data[24]; + EXPECT_EQ(last_msg_->signature.data[25], 25) + << "incorrect value for signature.data[25], expected 25, is " + << last_msg_->signature.data[25]; + EXPECT_EQ(last_msg_->signature.data[26], 26) + << "incorrect value for signature.data[26], expected 26, is " + << last_msg_->signature.data[26]; + EXPECT_EQ(last_msg_->signature.data[27], 27) + << "incorrect value for signature.data[27], expected 27, is " + << last_msg_->signature.data[27]; + EXPECT_EQ(last_msg_->signature.data[28], 28) + << "incorrect value for signature.data[28], expected 28, is " + << last_msg_->signature.data[28]; + EXPECT_EQ(last_msg_->signature.data[29], 29) + << "incorrect value for signature.data[29], expected 29, is " + << last_msg_->signature.data[29]; + EXPECT_EQ(last_msg_->signature.data[30], 30) + << "incorrect value for signature.data[30], expected 30, is " + << last_msg_->signature.data[30]; + EXPECT_EQ(last_msg_->signature.data[31], 31) + << "incorrect value for signature.data[31], expected 31, is " + << last_msg_->signature.data[31]; + EXPECT_EQ(last_msg_->signature.data[32], 32) + << "incorrect value for signature.data[32], expected 32, is " + << last_msg_->signature.data[32]; + EXPECT_EQ(last_msg_->signature.data[33], 33) + << "incorrect value for signature.data[33], expected 33, is " + << last_msg_->signature.data[33]; + EXPECT_EQ(last_msg_->signature.data[34], 34) + << "incorrect value for signature.data[34], expected 34, is " + << last_msg_->signature.data[34]; + EXPECT_EQ(last_msg_->signature.data[35], 35) + << "incorrect value for signature.data[35], expected 35, is " + << last_msg_->signature.data[35]; + EXPECT_EQ(last_msg_->signature.data[36], 36) + << "incorrect value for signature.data[36], expected 36, is " + << last_msg_->signature.data[36]; + EXPECT_EQ(last_msg_->signature.data[37], 37) + << "incorrect value for signature.data[37], expected 37, is " + << last_msg_->signature.data[37]; + EXPECT_EQ(last_msg_->signature.data[38], 38) + << "incorrect value for signature.data[38], expected 38, is " + << last_msg_->signature.data[38]; + EXPECT_EQ(last_msg_->signature.data[39], 39) + << "incorrect value for signature.data[39], expected 39, is " + << last_msg_->signature.data[39]; + EXPECT_EQ(last_msg_->signature.data[40], 40) + << "incorrect value for signature.data[40], expected 40, is " + << last_msg_->signature.data[40]; + EXPECT_EQ(last_msg_->signature.data[41], 41) + << "incorrect value for signature.data[41], expected 41, is " + << last_msg_->signature.data[41]; + EXPECT_EQ(last_msg_->signature.data[42], 42) + << "incorrect value for signature.data[42], expected 42, is " + << last_msg_->signature.data[42]; + EXPECT_EQ(last_msg_->signature.data[43], 43) + << "incorrect value for signature.data[43], expected 43, is " + << last_msg_->signature.data[43]; + EXPECT_EQ(last_msg_->signature.data[44], 44) + << "incorrect value for signature.data[44], expected 44, is " + << last_msg_->signature.data[44]; + EXPECT_EQ(last_msg_->signature.data[45], 45) + << "incorrect value for signature.data[45], expected 45, is " + << last_msg_->signature.data[45]; + EXPECT_EQ(last_msg_->signature.data[46], 46) + << "incorrect value for signature.data[46], expected 46, is " + << last_msg_->signature.data[46]; + EXPECT_EQ(last_msg_->signature.data[47], 47) + << "incorrect value for signature.data[47], expected 47, is " + << last_msg_->signature.data[47]; + EXPECT_EQ(last_msg_->signature.data[48], 48) + << "incorrect value for signature.data[48], expected 48, is " + << last_msg_->signature.data[48]; + EXPECT_EQ(last_msg_->signature.data[49], 49) + << "incorrect value for signature.data[49], expected 49, is " + << last_msg_->signature.data[49]; + EXPECT_EQ(last_msg_->signature.data[50], 50) + << "incorrect value for signature.data[50], expected 50, is " + << last_msg_->signature.data[50]; + EXPECT_EQ(last_msg_->signature.data[51], 51) + << "incorrect value for signature.data[51], expected 51, is " + << last_msg_->signature.data[51]; + EXPECT_EQ(last_msg_->signature.data[52], 52) + << "incorrect value for signature.data[52], expected 52, is " + << last_msg_->signature.data[52]; + EXPECT_EQ(last_msg_->signature.data[53], 53) + << "incorrect value for signature.data[53], expected 53, is " + << last_msg_->signature.data[53]; + EXPECT_EQ(last_msg_->signature.data[54], 54) + << "incorrect value for signature.data[54], expected 54, is " + << last_msg_->signature.data[54]; + EXPECT_EQ(last_msg_->signature.data[55], 55) + << "incorrect value for signature.data[55], expected 55, is " + << last_msg_->signature.data[55]; + EXPECT_EQ(last_msg_->signature.data[56], 56) + << "incorrect value for signature.data[56], expected 56, is " + << last_msg_->signature.data[56]; + EXPECT_EQ(last_msg_->signature.data[57], 57) + << "incorrect value for signature.data[57], expected 57, is " + << last_msg_->signature.data[57]; + EXPECT_EQ(last_msg_->signature.data[58], 58) + << "incorrect value for signature.data[58], expected 58, is " + << last_msg_->signature.data[58]; + EXPECT_EQ(last_msg_->signature.data[59], 59) + << "incorrect value for signature.data[59], expected 59, is " + << last_msg_->signature.data[59]; + EXPECT_EQ(last_msg_->signature.data[60], 60) + << "incorrect value for signature.data[60], expected 60, is " + << last_msg_->signature.data[60]; + EXPECT_EQ(last_msg_->signature.data[61], 61) + << "incorrect value for signature.data[61], expected 61, is " + << last_msg_->signature.data[61]; + EXPECT_EQ(last_msg_->signature.data[62], 62) + << "incorrect value for signature.data[62], expected 62, is " + << last_msg_->signature.data[62]; + EXPECT_EQ(last_msg_->signature.data[63], 63) + << "incorrect value for signature.data[63], expected 63, is " + << last_msg_->signature.data[63]; + EXPECT_EQ(last_msg_->signature.data[64], 64) + << "incorrect value for signature.data[64], expected 64, is " + << last_msg_->signature.data[64]; + EXPECT_EQ(last_msg_->signature.data[65], 65) + << "incorrect value for signature.data[65], expected 65, is " + << last_msg_->signature.data[65]; + EXPECT_EQ(last_msg_->signature.data[66], 66) + << "incorrect value for signature.data[66], expected 66, is " + << last_msg_->signature.data[66]; + EXPECT_EQ(last_msg_->signature.data[67], 67) + << "incorrect value for signature.data[67], expected 67, is " + << last_msg_->signature.data[67]; + EXPECT_EQ(last_msg_->signature.data[68], 68) + << "incorrect value for signature.data[68], expected 68, is " + << last_msg_->signature.data[68]; + EXPECT_EQ(last_msg_->signature.data[69], 69) + << "incorrect value for signature.data[69], expected 69, is " + << last_msg_->signature.data[69]; + EXPECT_EQ(last_msg_->signature.data[70], 70) + << "incorrect value for signature.data[70], expected 70, is " + << last_msg_->signature.data[70]; + EXPECT_EQ(last_msg_->signature.data[71], 71) + << "incorrect value for signature.data[71], expected 71, is " + << last_msg_->signature.data[71]; + EXPECT_EQ(last_msg_->signature.len, 72) + << "incorrect value for signature.len, expected 72, is " + << last_msg_->signature.len; } diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc new file mode 100644 index 0000000000..bbe984b907 --- /dev/null +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgCertificateChainDep.cc @@ -0,0 +1,1191 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include +class Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), + last_msg_storage_(), + last_msg_( + reinterpret_cast(last_msg_storage_)), + last_msg_len_(), + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { + set_reader(this); + set_writer(this); + } + + s32 read(uint8_t *buf, const uint32_t n) override { + uint32_t real_n = n; + memcpy(buf, dummy_buff_ + dummy_rd_, real_n); + dummy_rd_ += real_n; + return (s32)real_n; + } + + s32 write(const uint8_t *buf, uint32_t n) override { + uint32_t real_n = n; + memcpy(dummy_buff_ + dummy_wr_, buf, real_n); + dummy_wr_ += real_n; + return (s32)real_n; + } + + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_certificate_chain_dep_t &msg) override { + memcpy(last_msg_storage_, &msg, message_length); + last_msg_len_ = message_length; + last_sender_id_ = sender_id; + n_callbacks_logged_++; + } + + uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; + msg_certificate_chain_dep_t *last_msg_; + uint8_t last_msg_len_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; + uint32_t dummy_wr_; + uint32_t dummy_rd_; + uint8_t dummy_buff_[1024]; +}; + +TEST_F(Test_legacy_auto_check_sbp_signing_MsgCertificateChainDep0, Test) { + uint8_t encoded_frame[] = { + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 232, 7, 3, 30, 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, + 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_certificate_chain_dep_t *test_msg = + (msg_certificate_chain_dep_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[0] = 20; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[1] = 21; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[2] = 22; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[3] = 23; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[4] = 24; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[5] = 25; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[6] = 26; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[7] = 27; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[8] = 28; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[9] = 29; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[10] = 10; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[11] = 11; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[12] = 12; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[13] = 13; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[14] = 14; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[15] = 15; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[16] = 16; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[17] = 17; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[18] = 18; + if (sizeof(test_msg->corrections_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->corrections_certificate[0])); + } + test_msg->corrections_certificate[19] = 19; + test_msg->expiration.day = 30; + test_msg->expiration.hours = 12; + test_msg->expiration.minutes = 34; + test_msg->expiration.month = 3; + test_msg->expiration.ns = 123456789; + test_msg->expiration.seconds = 59; + test_msg->expiration.year = 2024; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[0] = 10; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[1] = 11; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[2] = 12; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[3] = 13; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[4] = 14; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[5] = 15; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[6] = 16; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[7] = 17; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[8] = 18; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[9] = 19; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[10] = 0; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[11] = 1; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[12] = 2; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[13] = 3; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[14] = 4; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[15] = 5; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[16] = 6; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[17] = 7; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[18] = 8; + if (sizeof(test_msg->intermediate_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->intermediate_certificate[0])); + } + test_msg->intermediate_certificate[19] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[0] = 0; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[1] = 1; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[2] = 2; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[3] = 3; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[4] = 4; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[5] = 5; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[6] = 6; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[7] = 7; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[8] = 8; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[9] = 9; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[10] = 10; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[11] = 11; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[12] = 12; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[13] = 13; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[14] = 14; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[15] = 15; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[16] = 16; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[17] = 17; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[18] = 18; + if (sizeof(test_msg->root_certificate) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->root_certificate[0])); + } + test_msg->root_certificate[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 7; + + EXPECT_EQ(send_message(0xC05, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->corrections_certificate[0], 20) + << "incorrect value for corrections_certificate[0], expected 20, is " + << last_msg_->corrections_certificate[0]; + EXPECT_EQ(last_msg_->corrections_certificate[1], 21) + << "incorrect value for corrections_certificate[1], expected 21, is " + << last_msg_->corrections_certificate[1]; + EXPECT_EQ(last_msg_->corrections_certificate[2], 22) + << "incorrect value for corrections_certificate[2], expected 22, is " + << last_msg_->corrections_certificate[2]; + EXPECT_EQ(last_msg_->corrections_certificate[3], 23) + << "incorrect value for corrections_certificate[3], expected 23, is " + << last_msg_->corrections_certificate[3]; + EXPECT_EQ(last_msg_->corrections_certificate[4], 24) + << "incorrect value for corrections_certificate[4], expected 24, is " + << last_msg_->corrections_certificate[4]; + EXPECT_EQ(last_msg_->corrections_certificate[5], 25) + << "incorrect value for corrections_certificate[5], expected 25, is " + << last_msg_->corrections_certificate[5]; + EXPECT_EQ(last_msg_->corrections_certificate[6], 26) + << "incorrect value for corrections_certificate[6], expected 26, is " + << last_msg_->corrections_certificate[6]; + EXPECT_EQ(last_msg_->corrections_certificate[7], 27) + << "incorrect value for corrections_certificate[7], expected 27, is " + << last_msg_->corrections_certificate[7]; + EXPECT_EQ(last_msg_->corrections_certificate[8], 28) + << "incorrect value for corrections_certificate[8], expected 28, is " + << last_msg_->corrections_certificate[8]; + EXPECT_EQ(last_msg_->corrections_certificate[9], 29) + << "incorrect value for corrections_certificate[9], expected 29, is " + << last_msg_->corrections_certificate[9]; + EXPECT_EQ(last_msg_->corrections_certificate[10], 10) + << "incorrect value for corrections_certificate[10], expected 10, is " + << last_msg_->corrections_certificate[10]; + EXPECT_EQ(last_msg_->corrections_certificate[11], 11) + << "incorrect value for corrections_certificate[11], expected 11, is " + << last_msg_->corrections_certificate[11]; + EXPECT_EQ(last_msg_->corrections_certificate[12], 12) + << "incorrect value for corrections_certificate[12], expected 12, is " + << last_msg_->corrections_certificate[12]; + EXPECT_EQ(last_msg_->corrections_certificate[13], 13) + << "incorrect value for corrections_certificate[13], expected 13, is " + << last_msg_->corrections_certificate[13]; + EXPECT_EQ(last_msg_->corrections_certificate[14], 14) + << "incorrect value for corrections_certificate[14], expected 14, is " + << last_msg_->corrections_certificate[14]; + EXPECT_EQ(last_msg_->corrections_certificate[15], 15) + << "incorrect value for corrections_certificate[15], expected 15, is " + << last_msg_->corrections_certificate[15]; + EXPECT_EQ(last_msg_->corrections_certificate[16], 16) + << "incorrect value for corrections_certificate[16], expected 16, is " + << last_msg_->corrections_certificate[16]; + EXPECT_EQ(last_msg_->corrections_certificate[17], 17) + << "incorrect value for corrections_certificate[17], expected 17, is " + << last_msg_->corrections_certificate[17]; + EXPECT_EQ(last_msg_->corrections_certificate[18], 18) + << "incorrect value for corrections_certificate[18], expected 18, is " + << last_msg_->corrections_certificate[18]; + EXPECT_EQ(last_msg_->corrections_certificate[19], 19) + << "incorrect value for corrections_certificate[19], expected 19, is " + << last_msg_->corrections_certificate[19]; + EXPECT_EQ(last_msg_->expiration.day, 30) + << "incorrect value for expiration.day, expected 30, is " + << last_msg_->expiration.day; + EXPECT_EQ(last_msg_->expiration.hours, 12) + << "incorrect value for expiration.hours, expected 12, is " + << last_msg_->expiration.hours; + EXPECT_EQ(last_msg_->expiration.minutes, 34) + << "incorrect value for expiration.minutes, expected 34, is " + << last_msg_->expiration.minutes; + EXPECT_EQ(last_msg_->expiration.month, 3) + << "incorrect value for expiration.month, expected 3, is " + << last_msg_->expiration.month; + EXPECT_EQ(last_msg_->expiration.ns, 123456789) + << "incorrect value for expiration.ns, expected 123456789, is " + << last_msg_->expiration.ns; + EXPECT_EQ(last_msg_->expiration.seconds, 59) + << "incorrect value for expiration.seconds, expected 59, is " + << last_msg_->expiration.seconds; + EXPECT_EQ(last_msg_->expiration.year, 2024) + << "incorrect value for expiration.year, expected 2024, is " + << last_msg_->expiration.year; + EXPECT_EQ(last_msg_->intermediate_certificate[0], 10) + << "incorrect value for intermediate_certificate[0], expected 10, is " + << last_msg_->intermediate_certificate[0]; + EXPECT_EQ(last_msg_->intermediate_certificate[1], 11) + << "incorrect value for intermediate_certificate[1], expected 11, is " + << last_msg_->intermediate_certificate[1]; + EXPECT_EQ(last_msg_->intermediate_certificate[2], 12) + << "incorrect value for intermediate_certificate[2], expected 12, is " + << last_msg_->intermediate_certificate[2]; + EXPECT_EQ(last_msg_->intermediate_certificate[3], 13) + << "incorrect value for intermediate_certificate[3], expected 13, is " + << last_msg_->intermediate_certificate[3]; + EXPECT_EQ(last_msg_->intermediate_certificate[4], 14) + << "incorrect value for intermediate_certificate[4], expected 14, is " + << last_msg_->intermediate_certificate[4]; + EXPECT_EQ(last_msg_->intermediate_certificate[5], 15) + << "incorrect value for intermediate_certificate[5], expected 15, is " + << last_msg_->intermediate_certificate[5]; + EXPECT_EQ(last_msg_->intermediate_certificate[6], 16) + << "incorrect value for intermediate_certificate[6], expected 16, is " + << last_msg_->intermediate_certificate[6]; + EXPECT_EQ(last_msg_->intermediate_certificate[7], 17) + << "incorrect value for intermediate_certificate[7], expected 17, is " + << last_msg_->intermediate_certificate[7]; + EXPECT_EQ(last_msg_->intermediate_certificate[8], 18) + << "incorrect value for intermediate_certificate[8], expected 18, is " + << last_msg_->intermediate_certificate[8]; + EXPECT_EQ(last_msg_->intermediate_certificate[9], 19) + << "incorrect value for intermediate_certificate[9], expected 19, is " + << last_msg_->intermediate_certificate[9]; + EXPECT_EQ(last_msg_->intermediate_certificate[10], 0) + << "incorrect value for intermediate_certificate[10], expected 0, is " + << last_msg_->intermediate_certificate[10]; + EXPECT_EQ(last_msg_->intermediate_certificate[11], 1) + << "incorrect value for intermediate_certificate[11], expected 1, is " + << last_msg_->intermediate_certificate[11]; + EXPECT_EQ(last_msg_->intermediate_certificate[12], 2) + << "incorrect value for intermediate_certificate[12], expected 2, is " + << last_msg_->intermediate_certificate[12]; + EXPECT_EQ(last_msg_->intermediate_certificate[13], 3) + << "incorrect value for intermediate_certificate[13], expected 3, is " + << last_msg_->intermediate_certificate[13]; + EXPECT_EQ(last_msg_->intermediate_certificate[14], 4) + << "incorrect value for intermediate_certificate[14], expected 4, is " + << last_msg_->intermediate_certificate[14]; + EXPECT_EQ(last_msg_->intermediate_certificate[15], 5) + << "incorrect value for intermediate_certificate[15], expected 5, is " + << last_msg_->intermediate_certificate[15]; + EXPECT_EQ(last_msg_->intermediate_certificate[16], 6) + << "incorrect value for intermediate_certificate[16], expected 6, is " + << last_msg_->intermediate_certificate[16]; + EXPECT_EQ(last_msg_->intermediate_certificate[17], 7) + << "incorrect value for intermediate_certificate[17], expected 7, is " + << last_msg_->intermediate_certificate[17]; + EXPECT_EQ(last_msg_->intermediate_certificate[18], 8) + << "incorrect value for intermediate_certificate[18], expected 8, is " + << last_msg_->intermediate_certificate[18]; + EXPECT_EQ(last_msg_->intermediate_certificate[19], 9) + << "incorrect value for intermediate_certificate[19], expected 9, is " + << last_msg_->intermediate_certificate[19]; + EXPECT_EQ(last_msg_->root_certificate[0], 0) + << "incorrect value for root_certificate[0], expected 0, is " + << last_msg_->root_certificate[0]; + EXPECT_EQ(last_msg_->root_certificate[1], 1) + << "incorrect value for root_certificate[1], expected 1, is " + << last_msg_->root_certificate[1]; + EXPECT_EQ(last_msg_->root_certificate[2], 2) + << "incorrect value for root_certificate[2], expected 2, is " + << last_msg_->root_certificate[2]; + EXPECT_EQ(last_msg_->root_certificate[3], 3) + << "incorrect value for root_certificate[3], expected 3, is " + << last_msg_->root_certificate[3]; + EXPECT_EQ(last_msg_->root_certificate[4], 4) + << "incorrect value for root_certificate[4], expected 4, is " + << last_msg_->root_certificate[4]; + EXPECT_EQ(last_msg_->root_certificate[5], 5) + << "incorrect value for root_certificate[5], expected 5, is " + << last_msg_->root_certificate[5]; + EXPECT_EQ(last_msg_->root_certificate[6], 6) + << "incorrect value for root_certificate[6], expected 6, is " + << last_msg_->root_certificate[6]; + EXPECT_EQ(last_msg_->root_certificate[7], 7) + << "incorrect value for root_certificate[7], expected 7, is " + << last_msg_->root_certificate[7]; + EXPECT_EQ(last_msg_->root_certificate[8], 8) + << "incorrect value for root_certificate[8], expected 8, is " + << last_msg_->root_certificate[8]; + EXPECT_EQ(last_msg_->root_certificate[9], 9) + << "incorrect value for root_certificate[9], expected 9, is " + << last_msg_->root_certificate[9]; + EXPECT_EQ(last_msg_->root_certificate[10], 10) + << "incorrect value for root_certificate[10], expected 10, is " + << last_msg_->root_certificate[10]; + EXPECT_EQ(last_msg_->root_certificate[11], 11) + << "incorrect value for root_certificate[11], expected 11, is " + << last_msg_->root_certificate[11]; + EXPECT_EQ(last_msg_->root_certificate[12], 12) + << "incorrect value for root_certificate[12], expected 12, is " + << last_msg_->root_certificate[12]; + EXPECT_EQ(last_msg_->root_certificate[13], 13) + << "incorrect value for root_certificate[13], expected 13, is " + << last_msg_->root_certificate[13]; + EXPECT_EQ(last_msg_->root_certificate[14], 14) + << "incorrect value for root_certificate[14], expected 14, is " + << last_msg_->root_certificate[14]; + EXPECT_EQ(last_msg_->root_certificate[15], 15) + << "incorrect value for root_certificate[15], expected 15, is " + << last_msg_->root_certificate[15]; + EXPECT_EQ(last_msg_->root_certificate[16], 16) + << "incorrect value for root_certificate[16], expected 16, is " + << last_msg_->root_certificate[16]; + EXPECT_EQ(last_msg_->root_certificate[17], 17) + << "incorrect value for root_certificate[17], expected 17, is " + << last_msg_->root_certificate[17]; + EXPECT_EQ(last_msg_->root_certificate[18], 18) + << "incorrect value for root_certificate[18], expected 18, is " + << last_msg_->root_certificate[18]; + EXPECT_EQ(last_msg_->root_certificate[19], 19) + << "incorrect value for root_certificate[19], expected 19, is " + << last_msg_->root_certificate[19]; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 0) + << "incorrect value for signature[8], expected 0, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 1) + << "incorrect value for signature[9], expected 1, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 2) + << "incorrect value for signature[10], expected 2, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 3) + << "incorrect value for signature[11], expected 3, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 4) + << "incorrect value for signature[12], expected 4, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 5) + << "incorrect value for signature[13], expected 5, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 6) + << "incorrect value for signature[14], expected 6, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 7) + << "incorrect value for signature[15], expected 7, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 0) + << "incorrect value for signature[16], expected 0, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 1) + << "incorrect value for signature[17], expected 1, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 2) + << "incorrect value for signature[18], expected 2, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 3) + << "incorrect value for signature[19], expected 3, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 4) + << "incorrect value for signature[20], expected 4, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 5) + << "incorrect value for signature[21], expected 5, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 6) + << "incorrect value for signature[22], expected 6, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 7) + << "incorrect value for signature[23], expected 7, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 0) + << "incorrect value for signature[24], expected 0, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 1) + << "incorrect value for signature[25], expected 1, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 2) + << "incorrect value for signature[26], expected 2, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 3) + << "incorrect value for signature[27], expected 3, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 4) + << "incorrect value for signature[28], expected 4, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 5) + << "incorrect value for signature[29], expected 5, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 6) + << "incorrect value for signature[30], expected 6, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 7) + << "incorrect value for signature[31], expected 7, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 0) + << "incorrect value for signature[32], expected 0, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 1) + << "incorrect value for signature[33], expected 1, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 2) + << "incorrect value for signature[34], expected 2, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 3) + << "incorrect value for signature[35], expected 3, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 4) + << "incorrect value for signature[36], expected 4, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 5) + << "incorrect value for signature[37], expected 5, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 6) + << "incorrect value for signature[38], expected 6, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 7) + << "incorrect value for signature[39], expected 7, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 0) + << "incorrect value for signature[40], expected 0, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 1) + << "incorrect value for signature[41], expected 1, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 2) + << "incorrect value for signature[42], expected 2, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 3) + << "incorrect value for signature[43], expected 3, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 4) + << "incorrect value for signature[44], expected 4, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 5) + << "incorrect value for signature[45], expected 5, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 6) + << "incorrect value for signature[46], expected 6, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 7) + << "incorrect value for signature[47], expected 7, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 0) + << "incorrect value for signature[48], expected 0, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 1) + << "incorrect value for signature[49], expected 1, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 2) + << "incorrect value for signature[50], expected 2, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 3) + << "incorrect value for signature[51], expected 3, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 4) + << "incorrect value for signature[52], expected 4, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 5) + << "incorrect value for signature[53], expected 5, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 6) + << "incorrect value for signature[54], expected 6, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 7) + << "incorrect value for signature[55], expected 7, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 0) + << "incorrect value for signature[56], expected 0, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 1) + << "incorrect value for signature[57], expected 1, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 2) + << "incorrect value for signature[58], expected 2, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 3) + << "incorrect value for signature[59], expected 3, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 4) + << "incorrect value for signature[60], expected 4, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 5) + << "incorrect value for signature[61], expected 5, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 6) + << "incorrect value for signature[62], expected 6, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 7) + << "incorrect value for signature[63], expected 7, is " + << last_msg_->signature[63]; +} diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc index a776fa4983..fe30635809 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc @@ -78,12 +78,12 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0 TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { uint8_t encoded_frame[] = { - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, }; uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; @@ -115,368 +115,440 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { } test_msg->certificate_id[3] = 4; test_msg->flags = 0; - test_msg->n_signature_bytes = 72; test_msg->on_demand_counter = 2; - if (sizeof(test_msg->signature) == 0) { + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[0] = 0; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[0] = 0; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[1] = 1; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[1] = 1; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[2] = 2; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[2] = 2; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[3] = 3; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[3] = 3; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[4] = 4; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[4] = 4; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[5] = 5; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[5] = 5; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[6] = 6; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[6] = 6; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[7] = 7; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[7] = 7; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[8] = 8; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[8] = 8; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[9] = 9; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[9] = 9; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[10] = 10; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[10] = 10; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[11] = 11; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[11] = 11; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[12] = 12; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[12] = 12; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[13] = 13; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[13] = 13; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[14] = 14; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[14] = 14; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[15] = 15; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[15] = 15; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[16] = 16; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[16] = 16; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[17] = 17; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[17] = 17; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[18] = 18; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[18] = 18; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[19] = 19; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[19] = 19; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[20] = 20; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[20] = 20; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[21] = 21; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[21] = 21; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[22] = 22; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[22] = 22; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[23] = 23; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[23] = 23; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[24] = 24; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[24] = 24; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[25] = 25; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[25] = 25; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[26] = 26; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[26] = 26; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[27] = 27; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[27] = 27; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[28] = 28; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[28] = 28; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[29] = 29; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[29] = 29; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[30] = 30; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[30] = 30; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[31] = 31; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[31] = 31; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[32] = 32; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[32] = 32; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[33] = 33; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[33] = 33; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[34] = 34; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[34] = 34; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[35] = 35; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[35] = 35; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[36] = 36; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[36] = 36; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[37] = 37; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[37] = 37; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[38] = 38; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[38] = 38; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[39] = 39; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[39] = 39; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[40] = 40; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[40] = 40; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[41] = 41; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[41] = 41; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[42] = 42; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[42] = 42; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[43] = 43; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[43] = 43; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[44] = 44; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[44] = 44; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[45] = 45; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[45] = 45; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[46] = 46; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[46] = 46; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[47] = 47; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[47] = 47; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[48] = 48; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[48] = 48; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[49] = 49; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[49] = 49; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[50] = 50; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[50] = 50; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[51] = 51; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[51] = 51; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[52] = 52; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[52] = 52; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[53] = 53; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[53] = 53; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[54] = 54; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[54] = 54; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[55] = 55; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[55] = 55; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[56] = 56; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[56] = 56; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[57] = 57; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[57] = 57; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[58] = 58; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[58] = 58; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[59] = 59; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[59] = 59; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[60] = 60; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[60] = 60; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[61] = 61; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[61] = 61; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[62] = 62; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[62] = 62; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[63] = 63; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[63] = 63; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[64] = 64; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[64] = 64; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[65] = 65; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[65] = 65; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[66] = 66; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[66] = 66; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[67] = 67; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[67] = 67; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[68] = 68; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[68] = 68; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[69] = 69; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[69] = 69; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[70] = 70; - if (sizeof(test_msg->signature) == 0) { + test_msg->signature.data[70] = 70; + if (sizeof(test_msg->signature.data) == 0) { // Cope with variable length arrays - test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signature.data[0])); } - test_msg->signature[71] = 71; + test_msg->signature.data[71] = 71; + test_msg->signature.len = 72; if (sizeof(test_msg->signed_messages) == 0) { // Cope with variable length arrays test_msg_len = @@ -497,7 +569,7 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { test_msg->signed_messages[2] = 23; test_msg->stream_counter = 1; - EXPECT_EQ(send_message(0xC07, 66, test_msg_len, test_msg_storage), SBP_OK); + EXPECT_EQ(send_message(0xC08, 66, test_msg_len, test_msg_storage), SBP_OK); EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); @@ -523,228 +595,228 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { << last_msg_->certificate_id[3]; EXPECT_EQ(last_msg_->flags, 0) << "incorrect value for flags, expected 0, is " << last_msg_->flags; - EXPECT_EQ(last_msg_->n_signature_bytes, 72) - << "incorrect value for n_signature_bytes, expected 72, is " - << last_msg_->n_signature_bytes; EXPECT_EQ(last_msg_->on_demand_counter, 2) << "incorrect value for on_demand_counter, expected 2, is " << last_msg_->on_demand_counter; - EXPECT_EQ(last_msg_->signature[0], 0) - << "incorrect value for signature[0], expected 0, is " - << last_msg_->signature[0]; - EXPECT_EQ(last_msg_->signature[1], 1) - << "incorrect value for signature[1], expected 1, is " - << last_msg_->signature[1]; - EXPECT_EQ(last_msg_->signature[2], 2) - << "incorrect value for signature[2], expected 2, is " - << last_msg_->signature[2]; - EXPECT_EQ(last_msg_->signature[3], 3) - << "incorrect value for signature[3], expected 3, is " - << last_msg_->signature[3]; - EXPECT_EQ(last_msg_->signature[4], 4) - << "incorrect value for signature[4], expected 4, is " - << last_msg_->signature[4]; - EXPECT_EQ(last_msg_->signature[5], 5) - << "incorrect value for signature[5], expected 5, is " - << last_msg_->signature[5]; - EXPECT_EQ(last_msg_->signature[6], 6) - << "incorrect value for signature[6], expected 6, is " - << last_msg_->signature[6]; - EXPECT_EQ(last_msg_->signature[7], 7) - << "incorrect value for signature[7], expected 7, is " - << last_msg_->signature[7]; - EXPECT_EQ(last_msg_->signature[8], 8) - << "incorrect value for signature[8], expected 8, is " - << last_msg_->signature[8]; - EXPECT_EQ(last_msg_->signature[9], 9) - << "incorrect value for signature[9], expected 9, is " - << last_msg_->signature[9]; - EXPECT_EQ(last_msg_->signature[10], 10) - << "incorrect value for signature[10], expected 10, is " - << last_msg_->signature[10]; - EXPECT_EQ(last_msg_->signature[11], 11) - << "incorrect value for signature[11], expected 11, is " - << last_msg_->signature[11]; - EXPECT_EQ(last_msg_->signature[12], 12) - << "incorrect value for signature[12], expected 12, is " - << last_msg_->signature[12]; - EXPECT_EQ(last_msg_->signature[13], 13) - << "incorrect value for signature[13], expected 13, is " - << last_msg_->signature[13]; - EXPECT_EQ(last_msg_->signature[14], 14) - << "incorrect value for signature[14], expected 14, is " - << last_msg_->signature[14]; - EXPECT_EQ(last_msg_->signature[15], 15) - << "incorrect value for signature[15], expected 15, is " - << last_msg_->signature[15]; - EXPECT_EQ(last_msg_->signature[16], 16) - << "incorrect value for signature[16], expected 16, is " - << last_msg_->signature[16]; - EXPECT_EQ(last_msg_->signature[17], 17) - << "incorrect value for signature[17], expected 17, is " - << last_msg_->signature[17]; - EXPECT_EQ(last_msg_->signature[18], 18) - << "incorrect value for signature[18], expected 18, is " - << last_msg_->signature[18]; - EXPECT_EQ(last_msg_->signature[19], 19) - << "incorrect value for signature[19], expected 19, is " - << last_msg_->signature[19]; - EXPECT_EQ(last_msg_->signature[20], 20) - << "incorrect value for signature[20], expected 20, is " - << last_msg_->signature[20]; - EXPECT_EQ(last_msg_->signature[21], 21) - << "incorrect value for signature[21], expected 21, is " - << last_msg_->signature[21]; - EXPECT_EQ(last_msg_->signature[22], 22) - << "incorrect value for signature[22], expected 22, is " - << last_msg_->signature[22]; - EXPECT_EQ(last_msg_->signature[23], 23) - << "incorrect value for signature[23], expected 23, is " - << last_msg_->signature[23]; - EXPECT_EQ(last_msg_->signature[24], 24) - << "incorrect value for signature[24], expected 24, is " - << last_msg_->signature[24]; - EXPECT_EQ(last_msg_->signature[25], 25) - << "incorrect value for signature[25], expected 25, is " - << last_msg_->signature[25]; - EXPECT_EQ(last_msg_->signature[26], 26) - << "incorrect value for signature[26], expected 26, is " - << last_msg_->signature[26]; - EXPECT_EQ(last_msg_->signature[27], 27) - << "incorrect value for signature[27], expected 27, is " - << last_msg_->signature[27]; - EXPECT_EQ(last_msg_->signature[28], 28) - << "incorrect value for signature[28], expected 28, is " - << last_msg_->signature[28]; - EXPECT_EQ(last_msg_->signature[29], 29) - << "incorrect value for signature[29], expected 29, is " - << last_msg_->signature[29]; - EXPECT_EQ(last_msg_->signature[30], 30) - << "incorrect value for signature[30], expected 30, is " - << last_msg_->signature[30]; - EXPECT_EQ(last_msg_->signature[31], 31) - << "incorrect value for signature[31], expected 31, is " - << last_msg_->signature[31]; - EXPECT_EQ(last_msg_->signature[32], 32) - << "incorrect value for signature[32], expected 32, is " - << last_msg_->signature[32]; - EXPECT_EQ(last_msg_->signature[33], 33) - << "incorrect value for signature[33], expected 33, is " - << last_msg_->signature[33]; - EXPECT_EQ(last_msg_->signature[34], 34) - << "incorrect value for signature[34], expected 34, is " - << last_msg_->signature[34]; - EXPECT_EQ(last_msg_->signature[35], 35) - << "incorrect value for signature[35], expected 35, is " - << last_msg_->signature[35]; - EXPECT_EQ(last_msg_->signature[36], 36) - << "incorrect value for signature[36], expected 36, is " - << last_msg_->signature[36]; - EXPECT_EQ(last_msg_->signature[37], 37) - << "incorrect value for signature[37], expected 37, is " - << last_msg_->signature[37]; - EXPECT_EQ(last_msg_->signature[38], 38) - << "incorrect value for signature[38], expected 38, is " - << last_msg_->signature[38]; - EXPECT_EQ(last_msg_->signature[39], 39) - << "incorrect value for signature[39], expected 39, is " - << last_msg_->signature[39]; - EXPECT_EQ(last_msg_->signature[40], 40) - << "incorrect value for signature[40], expected 40, is " - << last_msg_->signature[40]; - EXPECT_EQ(last_msg_->signature[41], 41) - << "incorrect value for signature[41], expected 41, is " - << last_msg_->signature[41]; - EXPECT_EQ(last_msg_->signature[42], 42) - << "incorrect value for signature[42], expected 42, is " - << last_msg_->signature[42]; - EXPECT_EQ(last_msg_->signature[43], 43) - << "incorrect value for signature[43], expected 43, is " - << last_msg_->signature[43]; - EXPECT_EQ(last_msg_->signature[44], 44) - << "incorrect value for signature[44], expected 44, is " - << last_msg_->signature[44]; - EXPECT_EQ(last_msg_->signature[45], 45) - << "incorrect value for signature[45], expected 45, is " - << last_msg_->signature[45]; - EXPECT_EQ(last_msg_->signature[46], 46) - << "incorrect value for signature[46], expected 46, is " - << last_msg_->signature[46]; - EXPECT_EQ(last_msg_->signature[47], 47) - << "incorrect value for signature[47], expected 47, is " - << last_msg_->signature[47]; - EXPECT_EQ(last_msg_->signature[48], 48) - << "incorrect value for signature[48], expected 48, is " - << last_msg_->signature[48]; - EXPECT_EQ(last_msg_->signature[49], 49) - << "incorrect value for signature[49], expected 49, is " - << last_msg_->signature[49]; - EXPECT_EQ(last_msg_->signature[50], 50) - << "incorrect value for signature[50], expected 50, is " - << last_msg_->signature[50]; - EXPECT_EQ(last_msg_->signature[51], 51) - << "incorrect value for signature[51], expected 51, is " - << last_msg_->signature[51]; - EXPECT_EQ(last_msg_->signature[52], 52) - << "incorrect value for signature[52], expected 52, is " - << last_msg_->signature[52]; - EXPECT_EQ(last_msg_->signature[53], 53) - << "incorrect value for signature[53], expected 53, is " - << last_msg_->signature[53]; - EXPECT_EQ(last_msg_->signature[54], 54) - << "incorrect value for signature[54], expected 54, is " - << last_msg_->signature[54]; - EXPECT_EQ(last_msg_->signature[55], 55) - << "incorrect value for signature[55], expected 55, is " - << last_msg_->signature[55]; - EXPECT_EQ(last_msg_->signature[56], 56) - << "incorrect value for signature[56], expected 56, is " - << last_msg_->signature[56]; - EXPECT_EQ(last_msg_->signature[57], 57) - << "incorrect value for signature[57], expected 57, is " - << last_msg_->signature[57]; - EXPECT_EQ(last_msg_->signature[58], 58) - << "incorrect value for signature[58], expected 58, is " - << last_msg_->signature[58]; - EXPECT_EQ(last_msg_->signature[59], 59) - << "incorrect value for signature[59], expected 59, is " - << last_msg_->signature[59]; - EXPECT_EQ(last_msg_->signature[60], 60) - << "incorrect value for signature[60], expected 60, is " - << last_msg_->signature[60]; - EXPECT_EQ(last_msg_->signature[61], 61) - << "incorrect value for signature[61], expected 61, is " - << last_msg_->signature[61]; - EXPECT_EQ(last_msg_->signature[62], 62) - << "incorrect value for signature[62], expected 62, is " - << last_msg_->signature[62]; - EXPECT_EQ(last_msg_->signature[63], 63) - << "incorrect value for signature[63], expected 63, is " - << last_msg_->signature[63]; - EXPECT_EQ(last_msg_->signature[64], 64) - << "incorrect value for signature[64], expected 64, is " - << last_msg_->signature[64]; - EXPECT_EQ(last_msg_->signature[65], 65) - << "incorrect value for signature[65], expected 65, is " - << last_msg_->signature[65]; - EXPECT_EQ(last_msg_->signature[66], 66) - << "incorrect value for signature[66], expected 66, is " - << last_msg_->signature[66]; - EXPECT_EQ(last_msg_->signature[67], 67) - << "incorrect value for signature[67], expected 67, is " - << last_msg_->signature[67]; - EXPECT_EQ(last_msg_->signature[68], 68) - << "incorrect value for signature[68], expected 68, is " - << last_msg_->signature[68]; - EXPECT_EQ(last_msg_->signature[69], 69) - << "incorrect value for signature[69], expected 69, is " - << last_msg_->signature[69]; - EXPECT_EQ(last_msg_->signature[70], 70) - << "incorrect value for signature[70], expected 70, is " - << last_msg_->signature[70]; - EXPECT_EQ(last_msg_->signature[71], 71) - << "incorrect value for signature[71], expected 71, is " - << last_msg_->signature[71]; + EXPECT_EQ(last_msg_->signature.data[0], 0) + << "incorrect value for signature.data[0], expected 0, is " + << last_msg_->signature.data[0]; + EXPECT_EQ(last_msg_->signature.data[1], 1) + << "incorrect value for signature.data[1], expected 1, is " + << last_msg_->signature.data[1]; + EXPECT_EQ(last_msg_->signature.data[2], 2) + << "incorrect value for signature.data[2], expected 2, is " + << last_msg_->signature.data[2]; + EXPECT_EQ(last_msg_->signature.data[3], 3) + << "incorrect value for signature.data[3], expected 3, is " + << last_msg_->signature.data[3]; + EXPECT_EQ(last_msg_->signature.data[4], 4) + << "incorrect value for signature.data[4], expected 4, is " + << last_msg_->signature.data[4]; + EXPECT_EQ(last_msg_->signature.data[5], 5) + << "incorrect value for signature.data[5], expected 5, is " + << last_msg_->signature.data[5]; + EXPECT_EQ(last_msg_->signature.data[6], 6) + << "incorrect value for signature.data[6], expected 6, is " + << last_msg_->signature.data[6]; + EXPECT_EQ(last_msg_->signature.data[7], 7) + << "incorrect value for signature.data[7], expected 7, is " + << last_msg_->signature.data[7]; + EXPECT_EQ(last_msg_->signature.data[8], 8) + << "incorrect value for signature.data[8], expected 8, is " + << last_msg_->signature.data[8]; + EXPECT_EQ(last_msg_->signature.data[9], 9) + << "incorrect value for signature.data[9], expected 9, is " + << last_msg_->signature.data[9]; + EXPECT_EQ(last_msg_->signature.data[10], 10) + << "incorrect value for signature.data[10], expected 10, is " + << last_msg_->signature.data[10]; + EXPECT_EQ(last_msg_->signature.data[11], 11) + << "incorrect value for signature.data[11], expected 11, is " + << last_msg_->signature.data[11]; + EXPECT_EQ(last_msg_->signature.data[12], 12) + << "incorrect value for signature.data[12], expected 12, is " + << last_msg_->signature.data[12]; + EXPECT_EQ(last_msg_->signature.data[13], 13) + << "incorrect value for signature.data[13], expected 13, is " + << last_msg_->signature.data[13]; + EXPECT_EQ(last_msg_->signature.data[14], 14) + << "incorrect value for signature.data[14], expected 14, is " + << last_msg_->signature.data[14]; + EXPECT_EQ(last_msg_->signature.data[15], 15) + << "incorrect value for signature.data[15], expected 15, is " + << last_msg_->signature.data[15]; + EXPECT_EQ(last_msg_->signature.data[16], 16) + << "incorrect value for signature.data[16], expected 16, is " + << last_msg_->signature.data[16]; + EXPECT_EQ(last_msg_->signature.data[17], 17) + << "incorrect value for signature.data[17], expected 17, is " + << last_msg_->signature.data[17]; + EXPECT_EQ(last_msg_->signature.data[18], 18) + << "incorrect value for signature.data[18], expected 18, is " + << last_msg_->signature.data[18]; + EXPECT_EQ(last_msg_->signature.data[19], 19) + << "incorrect value for signature.data[19], expected 19, is " + << last_msg_->signature.data[19]; + EXPECT_EQ(last_msg_->signature.data[20], 20) + << "incorrect value for signature.data[20], expected 20, is " + << last_msg_->signature.data[20]; + EXPECT_EQ(last_msg_->signature.data[21], 21) + << "incorrect value for signature.data[21], expected 21, is " + << last_msg_->signature.data[21]; + EXPECT_EQ(last_msg_->signature.data[22], 22) + << "incorrect value for signature.data[22], expected 22, is " + << last_msg_->signature.data[22]; + EXPECT_EQ(last_msg_->signature.data[23], 23) + << "incorrect value for signature.data[23], expected 23, is " + << last_msg_->signature.data[23]; + EXPECT_EQ(last_msg_->signature.data[24], 24) + << "incorrect value for signature.data[24], expected 24, is " + << last_msg_->signature.data[24]; + EXPECT_EQ(last_msg_->signature.data[25], 25) + << "incorrect value for signature.data[25], expected 25, is " + << last_msg_->signature.data[25]; + EXPECT_EQ(last_msg_->signature.data[26], 26) + << "incorrect value for signature.data[26], expected 26, is " + << last_msg_->signature.data[26]; + EXPECT_EQ(last_msg_->signature.data[27], 27) + << "incorrect value for signature.data[27], expected 27, is " + << last_msg_->signature.data[27]; + EXPECT_EQ(last_msg_->signature.data[28], 28) + << "incorrect value for signature.data[28], expected 28, is " + << last_msg_->signature.data[28]; + EXPECT_EQ(last_msg_->signature.data[29], 29) + << "incorrect value for signature.data[29], expected 29, is " + << last_msg_->signature.data[29]; + EXPECT_EQ(last_msg_->signature.data[30], 30) + << "incorrect value for signature.data[30], expected 30, is " + << last_msg_->signature.data[30]; + EXPECT_EQ(last_msg_->signature.data[31], 31) + << "incorrect value for signature.data[31], expected 31, is " + << last_msg_->signature.data[31]; + EXPECT_EQ(last_msg_->signature.data[32], 32) + << "incorrect value for signature.data[32], expected 32, is " + << last_msg_->signature.data[32]; + EXPECT_EQ(last_msg_->signature.data[33], 33) + << "incorrect value for signature.data[33], expected 33, is " + << last_msg_->signature.data[33]; + EXPECT_EQ(last_msg_->signature.data[34], 34) + << "incorrect value for signature.data[34], expected 34, is " + << last_msg_->signature.data[34]; + EXPECT_EQ(last_msg_->signature.data[35], 35) + << "incorrect value for signature.data[35], expected 35, is " + << last_msg_->signature.data[35]; + EXPECT_EQ(last_msg_->signature.data[36], 36) + << "incorrect value for signature.data[36], expected 36, is " + << last_msg_->signature.data[36]; + EXPECT_EQ(last_msg_->signature.data[37], 37) + << "incorrect value for signature.data[37], expected 37, is " + << last_msg_->signature.data[37]; + EXPECT_EQ(last_msg_->signature.data[38], 38) + << "incorrect value for signature.data[38], expected 38, is " + << last_msg_->signature.data[38]; + EXPECT_EQ(last_msg_->signature.data[39], 39) + << "incorrect value for signature.data[39], expected 39, is " + << last_msg_->signature.data[39]; + EXPECT_EQ(last_msg_->signature.data[40], 40) + << "incorrect value for signature.data[40], expected 40, is " + << last_msg_->signature.data[40]; + EXPECT_EQ(last_msg_->signature.data[41], 41) + << "incorrect value for signature.data[41], expected 41, is " + << last_msg_->signature.data[41]; + EXPECT_EQ(last_msg_->signature.data[42], 42) + << "incorrect value for signature.data[42], expected 42, is " + << last_msg_->signature.data[42]; + EXPECT_EQ(last_msg_->signature.data[43], 43) + << "incorrect value for signature.data[43], expected 43, is " + << last_msg_->signature.data[43]; + EXPECT_EQ(last_msg_->signature.data[44], 44) + << "incorrect value for signature.data[44], expected 44, is " + << last_msg_->signature.data[44]; + EXPECT_EQ(last_msg_->signature.data[45], 45) + << "incorrect value for signature.data[45], expected 45, is " + << last_msg_->signature.data[45]; + EXPECT_EQ(last_msg_->signature.data[46], 46) + << "incorrect value for signature.data[46], expected 46, is " + << last_msg_->signature.data[46]; + EXPECT_EQ(last_msg_->signature.data[47], 47) + << "incorrect value for signature.data[47], expected 47, is " + << last_msg_->signature.data[47]; + EXPECT_EQ(last_msg_->signature.data[48], 48) + << "incorrect value for signature.data[48], expected 48, is " + << last_msg_->signature.data[48]; + EXPECT_EQ(last_msg_->signature.data[49], 49) + << "incorrect value for signature.data[49], expected 49, is " + << last_msg_->signature.data[49]; + EXPECT_EQ(last_msg_->signature.data[50], 50) + << "incorrect value for signature.data[50], expected 50, is " + << last_msg_->signature.data[50]; + EXPECT_EQ(last_msg_->signature.data[51], 51) + << "incorrect value for signature.data[51], expected 51, is " + << last_msg_->signature.data[51]; + EXPECT_EQ(last_msg_->signature.data[52], 52) + << "incorrect value for signature.data[52], expected 52, is " + << last_msg_->signature.data[52]; + EXPECT_EQ(last_msg_->signature.data[53], 53) + << "incorrect value for signature.data[53], expected 53, is " + << last_msg_->signature.data[53]; + EXPECT_EQ(last_msg_->signature.data[54], 54) + << "incorrect value for signature.data[54], expected 54, is " + << last_msg_->signature.data[54]; + EXPECT_EQ(last_msg_->signature.data[55], 55) + << "incorrect value for signature.data[55], expected 55, is " + << last_msg_->signature.data[55]; + EXPECT_EQ(last_msg_->signature.data[56], 56) + << "incorrect value for signature.data[56], expected 56, is " + << last_msg_->signature.data[56]; + EXPECT_EQ(last_msg_->signature.data[57], 57) + << "incorrect value for signature.data[57], expected 57, is " + << last_msg_->signature.data[57]; + EXPECT_EQ(last_msg_->signature.data[58], 58) + << "incorrect value for signature.data[58], expected 58, is " + << last_msg_->signature.data[58]; + EXPECT_EQ(last_msg_->signature.data[59], 59) + << "incorrect value for signature.data[59], expected 59, is " + << last_msg_->signature.data[59]; + EXPECT_EQ(last_msg_->signature.data[60], 60) + << "incorrect value for signature.data[60], expected 60, is " + << last_msg_->signature.data[60]; + EXPECT_EQ(last_msg_->signature.data[61], 61) + << "incorrect value for signature.data[61], expected 61, is " + << last_msg_->signature.data[61]; + EXPECT_EQ(last_msg_->signature.data[62], 62) + << "incorrect value for signature.data[62], expected 62, is " + << last_msg_->signature.data[62]; + EXPECT_EQ(last_msg_->signature.data[63], 63) + << "incorrect value for signature.data[63], expected 63, is " + << last_msg_->signature.data[63]; + EXPECT_EQ(last_msg_->signature.data[64], 64) + << "incorrect value for signature.data[64], expected 64, is " + << last_msg_->signature.data[64]; + EXPECT_EQ(last_msg_->signature.data[65], 65) + << "incorrect value for signature.data[65], expected 65, is " + << last_msg_->signature.data[65]; + EXPECT_EQ(last_msg_->signature.data[66], 66) + << "incorrect value for signature.data[66], expected 66, is " + << last_msg_->signature.data[66]; + EXPECT_EQ(last_msg_->signature.data[67], 67) + << "incorrect value for signature.data[67], expected 67, is " + << last_msg_->signature.data[67]; + EXPECT_EQ(last_msg_->signature.data[68], 68) + << "incorrect value for signature.data[68], expected 68, is " + << last_msg_->signature.data[68]; + EXPECT_EQ(last_msg_->signature.data[69], 69) + << "incorrect value for signature.data[69], expected 69, is " + << last_msg_->signature.data[69]; + EXPECT_EQ(last_msg_->signature.data[70], 70) + << "incorrect value for signature.data[70], expected 70, is " + << last_msg_->signature.data[70]; + EXPECT_EQ(last_msg_->signature.data[71], 71) + << "incorrect value for signature.data[71], expected 71, is " + << last_msg_->signature.data[71]; + EXPECT_EQ(last_msg_->signature.len, 72) + << "incorrect value for signature.len, expected 72, is " + << last_msg_->signature.len; EXPECT_EQ(last_msg_->signed_messages[0], 10) << "incorrect value for signed_messages[0], expected 10, is " << last_msg_->signed_messages[0]; diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc similarity index 99% rename from c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc rename to c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc index 1a3cc43ff2..b3a297cb12 100644 --- a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDep.cc +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepA.cc @@ -11,29 +11,29 @@ */ // This file was auto-generated from -// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by // generate.py. Do not modify by hand! #include #include #include #include -class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0 +class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0 : public ::testing::Test, public sbp::State, public sbp::IReader, public sbp::IWriter, - sbp::PayloadHandler { + sbp::PayloadHandler { public: - Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0() + Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0() : ::testing::Test(), sbp::State(), sbp::IReader(), sbp::IWriter(), - sbp::PayloadHandler(this), + sbp::PayloadHandler(this), last_msg_storage_(), last_msg_( - reinterpret_cast(last_msg_storage_)), + reinterpret_cast(last_msg_storage_)), last_msg_len_(), last_sender_id_(), n_callbacks_logged_(), @@ -60,7 +60,7 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0 protected: void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, - const msg_ecdsa_signature_dep_t &msg) override { + const msg_ecdsa_signature_dep_a_t &msg) override { memcpy(last_msg_storage_, &msg, message_length); last_msg_len_ = message_length; last_sender_id_ = sender_id; @@ -68,7 +68,7 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0 } uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; - msg_ecdsa_signature_dep_t *last_msg_; + msg_ecdsa_signature_dep_a_t *last_msg_; uint8_t last_msg_len_; uint16_t last_sender_id_; size_t n_callbacks_logged_; @@ -77,7 +77,7 @@ class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0 uint8_t dummy_buff_[1024]; }; -TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0, Test) { +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepA0, Test) { uint8_t encoded_frame[] = { 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, @@ -101,8 +101,8 @@ TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDep0, Test) { uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; uint8_t test_msg_len = 0; - msg_ecdsa_signature_dep_t *test_msg = - (msg_ecdsa_signature_dep_t *)test_msg_storage; + msg_ecdsa_signature_dep_a_t *test_msg = + (msg_ecdsa_signature_dep_a_t *)test_msg_storage; test_msg_len = (uint8_t)sizeof(*test_msg); if (sizeof(test_msg->certificate_id) == 0) { // Cope with variable length arrays diff --git a/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc new file mode 100644 index 0000000000..17ca262381 --- /dev/null +++ b/c/test/legacy/cpp/auto_check_sbp_signing_MsgEcdsaSignatureDepB.cc @@ -0,0 +1,762 @@ +/* + * Copyright (C) 2015-2021 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by +// generate.py. Do not modify by hand! + +#include +#include +#include +#include +class Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0 + : public ::testing::Test, + public sbp::State, + public sbp::IReader, + public sbp::IWriter, + sbp::PayloadHandler { + public: + Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0() + : ::testing::Test(), + sbp::State(), + sbp::IReader(), + sbp::IWriter(), + sbp::PayloadHandler(this), + last_msg_storage_(), + last_msg_( + reinterpret_cast(last_msg_storage_)), + last_msg_len_(), + last_sender_id_(), + n_callbacks_logged_(), + dummy_wr_(), + dummy_rd_(), + dummy_buff_() { + set_reader(this); + set_writer(this); + } + + s32 read(uint8_t *buf, const uint32_t n) override { + uint32_t real_n = n; + memcpy(buf, dummy_buff_ + dummy_rd_, real_n); + dummy_rd_ += real_n; + return (s32)real_n; + } + + s32 write(const uint8_t *buf, uint32_t n) override { + uint32_t real_n = n; + memcpy(dummy_buff_ + dummy_wr_, buf, real_n); + dummy_wr_ += real_n; + return (s32)real_n; + } + + protected: + void handle_sbp_msg(uint16_t sender_id, uint8_t message_length, + const msg_ecdsa_signature_dep_b_t &msg) override { + memcpy(last_msg_storage_, &msg, message_length); + last_msg_len_ = message_length; + last_sender_id_ = sender_id; + n_callbacks_logged_++; + } + + uint8_t last_msg_storage_[SBP_MAX_PAYLOAD_LEN]; + msg_ecdsa_signature_dep_b_t *last_msg_; + uint8_t last_msg_len_; + uint16_t last_sender_id_; + size_t n_callbacks_logged_; + uint32_t dummy_wr_; + uint32_t dummy_rd_; + uint8_t dummy_buff_[1024]; +}; + +TEST_F(Test_legacy_auto_check_sbp_signing_MsgEcdsaSignatureDepB0, Test) { + uint8_t encoded_frame[] = { + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + }; + + uint8_t test_msg_storage[SBP_MAX_PAYLOAD_LEN]{}; + uint8_t test_msg_len = 0; + msg_ecdsa_signature_dep_b_t *test_msg = + (msg_ecdsa_signature_dep_b_t *)test_msg_storage; + test_msg_len = (uint8_t)sizeof(*test_msg); + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[0] = 1; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[1] = 2; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[2] = 3; + if (sizeof(test_msg->certificate_id) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->certificate_id[0])); + } + test_msg->certificate_id[3] = 4; + test_msg->flags = 0; + test_msg->n_signature_bytes = 72; + test_msg->on_demand_counter = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[0] = 0; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[1] = 1; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[2] = 2; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[3] = 3; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[4] = 4; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[5] = 5; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[6] = 6; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[7] = 7; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[8] = 8; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[9] = 9; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[10] = 10; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[11] = 11; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[12] = 12; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[13] = 13; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[14] = 14; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[15] = 15; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[16] = 16; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[17] = 17; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[18] = 18; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[19] = 19; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[20] = 20; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[21] = 21; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[22] = 22; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[23] = 23; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[24] = 24; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[25] = 25; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[26] = 26; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[27] = 27; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[28] = 28; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[29] = 29; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[30] = 30; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[31] = 31; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[32] = 32; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[33] = 33; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[34] = 34; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[35] = 35; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[36] = 36; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[37] = 37; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[38] = 38; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[39] = 39; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[40] = 40; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[41] = 41; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[42] = 42; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[43] = 43; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[44] = 44; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[45] = 45; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[46] = 46; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[47] = 47; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[48] = 48; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[49] = 49; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[50] = 50; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[51] = 51; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[52] = 52; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[53] = 53; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[54] = 54; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[55] = 55; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[56] = 56; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[57] = 57; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[58] = 58; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[59] = 59; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[60] = 60; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[61] = 61; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[62] = 62; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[63] = 63; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[64] = 64; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[65] = 65; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[66] = 66; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[67] = 67; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[68] = 68; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[69] = 69; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[70] = 70; + if (sizeof(test_msg->signature) == 0) { + // Cope with variable length arrays + test_msg_len = (uint8_t)(test_msg_len + sizeof(test_msg->signature[0])); + } + test_msg->signature[71] = 71; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[0] = 10; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[1] = 21; + if (sizeof(test_msg->signed_messages) == 0) { + // Cope with variable length arrays + test_msg_len = + (uint8_t)(test_msg_len + sizeof(test_msg->signed_messages[0])); + } + test_msg->signed_messages[2] = 23; + test_msg->stream_counter = 1; + + EXPECT_EQ(send_message(0xC07, 66, test_msg_len, test_msg_storage), SBP_OK); + + EXPECT_EQ(dummy_wr_, sizeof(encoded_frame)); + EXPECT_EQ(memcmp(dummy_buff_, encoded_frame, sizeof(encoded_frame)), 0); + + while (dummy_rd_ < dummy_wr_) { + process(); + } + + EXPECT_EQ(n_callbacks_logged_, 1); + EXPECT_EQ(last_sender_id_, 66); + EXPECT_EQ(last_msg_len_, test_msg_len); + EXPECT_EQ(last_msg_->certificate_id[0], 1) + << "incorrect value for certificate_id[0], expected 1, is " + << last_msg_->certificate_id[0]; + EXPECT_EQ(last_msg_->certificate_id[1], 2) + << "incorrect value for certificate_id[1], expected 2, is " + << last_msg_->certificate_id[1]; + EXPECT_EQ(last_msg_->certificate_id[2], 3) + << "incorrect value for certificate_id[2], expected 3, is " + << last_msg_->certificate_id[2]; + EXPECT_EQ(last_msg_->certificate_id[3], 4) + << "incorrect value for certificate_id[3], expected 4, is " + << last_msg_->certificate_id[3]; + EXPECT_EQ(last_msg_->flags, 0) + << "incorrect value for flags, expected 0, is " << last_msg_->flags; + EXPECT_EQ(last_msg_->n_signature_bytes, 72) + << "incorrect value for n_signature_bytes, expected 72, is " + << last_msg_->n_signature_bytes; + EXPECT_EQ(last_msg_->on_demand_counter, 2) + << "incorrect value for on_demand_counter, expected 2, is " + << last_msg_->on_demand_counter; + EXPECT_EQ(last_msg_->signature[0], 0) + << "incorrect value for signature[0], expected 0, is " + << last_msg_->signature[0]; + EXPECT_EQ(last_msg_->signature[1], 1) + << "incorrect value for signature[1], expected 1, is " + << last_msg_->signature[1]; + EXPECT_EQ(last_msg_->signature[2], 2) + << "incorrect value for signature[2], expected 2, is " + << last_msg_->signature[2]; + EXPECT_EQ(last_msg_->signature[3], 3) + << "incorrect value for signature[3], expected 3, is " + << last_msg_->signature[3]; + EXPECT_EQ(last_msg_->signature[4], 4) + << "incorrect value for signature[4], expected 4, is " + << last_msg_->signature[4]; + EXPECT_EQ(last_msg_->signature[5], 5) + << "incorrect value for signature[5], expected 5, is " + << last_msg_->signature[5]; + EXPECT_EQ(last_msg_->signature[6], 6) + << "incorrect value for signature[6], expected 6, is " + << last_msg_->signature[6]; + EXPECT_EQ(last_msg_->signature[7], 7) + << "incorrect value for signature[7], expected 7, is " + << last_msg_->signature[7]; + EXPECT_EQ(last_msg_->signature[8], 8) + << "incorrect value for signature[8], expected 8, is " + << last_msg_->signature[8]; + EXPECT_EQ(last_msg_->signature[9], 9) + << "incorrect value for signature[9], expected 9, is " + << last_msg_->signature[9]; + EXPECT_EQ(last_msg_->signature[10], 10) + << "incorrect value for signature[10], expected 10, is " + << last_msg_->signature[10]; + EXPECT_EQ(last_msg_->signature[11], 11) + << "incorrect value for signature[11], expected 11, is " + << last_msg_->signature[11]; + EXPECT_EQ(last_msg_->signature[12], 12) + << "incorrect value for signature[12], expected 12, is " + << last_msg_->signature[12]; + EXPECT_EQ(last_msg_->signature[13], 13) + << "incorrect value for signature[13], expected 13, is " + << last_msg_->signature[13]; + EXPECT_EQ(last_msg_->signature[14], 14) + << "incorrect value for signature[14], expected 14, is " + << last_msg_->signature[14]; + EXPECT_EQ(last_msg_->signature[15], 15) + << "incorrect value for signature[15], expected 15, is " + << last_msg_->signature[15]; + EXPECT_EQ(last_msg_->signature[16], 16) + << "incorrect value for signature[16], expected 16, is " + << last_msg_->signature[16]; + EXPECT_EQ(last_msg_->signature[17], 17) + << "incorrect value for signature[17], expected 17, is " + << last_msg_->signature[17]; + EXPECT_EQ(last_msg_->signature[18], 18) + << "incorrect value for signature[18], expected 18, is " + << last_msg_->signature[18]; + EXPECT_EQ(last_msg_->signature[19], 19) + << "incorrect value for signature[19], expected 19, is " + << last_msg_->signature[19]; + EXPECT_EQ(last_msg_->signature[20], 20) + << "incorrect value for signature[20], expected 20, is " + << last_msg_->signature[20]; + EXPECT_EQ(last_msg_->signature[21], 21) + << "incorrect value for signature[21], expected 21, is " + << last_msg_->signature[21]; + EXPECT_EQ(last_msg_->signature[22], 22) + << "incorrect value for signature[22], expected 22, is " + << last_msg_->signature[22]; + EXPECT_EQ(last_msg_->signature[23], 23) + << "incorrect value for signature[23], expected 23, is " + << last_msg_->signature[23]; + EXPECT_EQ(last_msg_->signature[24], 24) + << "incorrect value for signature[24], expected 24, is " + << last_msg_->signature[24]; + EXPECT_EQ(last_msg_->signature[25], 25) + << "incorrect value for signature[25], expected 25, is " + << last_msg_->signature[25]; + EXPECT_EQ(last_msg_->signature[26], 26) + << "incorrect value for signature[26], expected 26, is " + << last_msg_->signature[26]; + EXPECT_EQ(last_msg_->signature[27], 27) + << "incorrect value for signature[27], expected 27, is " + << last_msg_->signature[27]; + EXPECT_EQ(last_msg_->signature[28], 28) + << "incorrect value for signature[28], expected 28, is " + << last_msg_->signature[28]; + EXPECT_EQ(last_msg_->signature[29], 29) + << "incorrect value for signature[29], expected 29, is " + << last_msg_->signature[29]; + EXPECT_EQ(last_msg_->signature[30], 30) + << "incorrect value for signature[30], expected 30, is " + << last_msg_->signature[30]; + EXPECT_EQ(last_msg_->signature[31], 31) + << "incorrect value for signature[31], expected 31, is " + << last_msg_->signature[31]; + EXPECT_EQ(last_msg_->signature[32], 32) + << "incorrect value for signature[32], expected 32, is " + << last_msg_->signature[32]; + EXPECT_EQ(last_msg_->signature[33], 33) + << "incorrect value for signature[33], expected 33, is " + << last_msg_->signature[33]; + EXPECT_EQ(last_msg_->signature[34], 34) + << "incorrect value for signature[34], expected 34, is " + << last_msg_->signature[34]; + EXPECT_EQ(last_msg_->signature[35], 35) + << "incorrect value for signature[35], expected 35, is " + << last_msg_->signature[35]; + EXPECT_EQ(last_msg_->signature[36], 36) + << "incorrect value for signature[36], expected 36, is " + << last_msg_->signature[36]; + EXPECT_EQ(last_msg_->signature[37], 37) + << "incorrect value for signature[37], expected 37, is " + << last_msg_->signature[37]; + EXPECT_EQ(last_msg_->signature[38], 38) + << "incorrect value for signature[38], expected 38, is " + << last_msg_->signature[38]; + EXPECT_EQ(last_msg_->signature[39], 39) + << "incorrect value for signature[39], expected 39, is " + << last_msg_->signature[39]; + EXPECT_EQ(last_msg_->signature[40], 40) + << "incorrect value for signature[40], expected 40, is " + << last_msg_->signature[40]; + EXPECT_EQ(last_msg_->signature[41], 41) + << "incorrect value for signature[41], expected 41, is " + << last_msg_->signature[41]; + EXPECT_EQ(last_msg_->signature[42], 42) + << "incorrect value for signature[42], expected 42, is " + << last_msg_->signature[42]; + EXPECT_EQ(last_msg_->signature[43], 43) + << "incorrect value for signature[43], expected 43, is " + << last_msg_->signature[43]; + EXPECT_EQ(last_msg_->signature[44], 44) + << "incorrect value for signature[44], expected 44, is " + << last_msg_->signature[44]; + EXPECT_EQ(last_msg_->signature[45], 45) + << "incorrect value for signature[45], expected 45, is " + << last_msg_->signature[45]; + EXPECT_EQ(last_msg_->signature[46], 46) + << "incorrect value for signature[46], expected 46, is " + << last_msg_->signature[46]; + EXPECT_EQ(last_msg_->signature[47], 47) + << "incorrect value for signature[47], expected 47, is " + << last_msg_->signature[47]; + EXPECT_EQ(last_msg_->signature[48], 48) + << "incorrect value for signature[48], expected 48, is " + << last_msg_->signature[48]; + EXPECT_EQ(last_msg_->signature[49], 49) + << "incorrect value for signature[49], expected 49, is " + << last_msg_->signature[49]; + EXPECT_EQ(last_msg_->signature[50], 50) + << "incorrect value for signature[50], expected 50, is " + << last_msg_->signature[50]; + EXPECT_EQ(last_msg_->signature[51], 51) + << "incorrect value for signature[51], expected 51, is " + << last_msg_->signature[51]; + EXPECT_EQ(last_msg_->signature[52], 52) + << "incorrect value for signature[52], expected 52, is " + << last_msg_->signature[52]; + EXPECT_EQ(last_msg_->signature[53], 53) + << "incorrect value for signature[53], expected 53, is " + << last_msg_->signature[53]; + EXPECT_EQ(last_msg_->signature[54], 54) + << "incorrect value for signature[54], expected 54, is " + << last_msg_->signature[54]; + EXPECT_EQ(last_msg_->signature[55], 55) + << "incorrect value for signature[55], expected 55, is " + << last_msg_->signature[55]; + EXPECT_EQ(last_msg_->signature[56], 56) + << "incorrect value for signature[56], expected 56, is " + << last_msg_->signature[56]; + EXPECT_EQ(last_msg_->signature[57], 57) + << "incorrect value for signature[57], expected 57, is " + << last_msg_->signature[57]; + EXPECT_EQ(last_msg_->signature[58], 58) + << "incorrect value for signature[58], expected 58, is " + << last_msg_->signature[58]; + EXPECT_EQ(last_msg_->signature[59], 59) + << "incorrect value for signature[59], expected 59, is " + << last_msg_->signature[59]; + EXPECT_EQ(last_msg_->signature[60], 60) + << "incorrect value for signature[60], expected 60, is " + << last_msg_->signature[60]; + EXPECT_EQ(last_msg_->signature[61], 61) + << "incorrect value for signature[61], expected 61, is " + << last_msg_->signature[61]; + EXPECT_EQ(last_msg_->signature[62], 62) + << "incorrect value for signature[62], expected 62, is " + << last_msg_->signature[62]; + EXPECT_EQ(last_msg_->signature[63], 63) + << "incorrect value for signature[63], expected 63, is " + << last_msg_->signature[63]; + EXPECT_EQ(last_msg_->signature[64], 64) + << "incorrect value for signature[64], expected 64, is " + << last_msg_->signature[64]; + EXPECT_EQ(last_msg_->signature[65], 65) + << "incorrect value for signature[65], expected 65, is " + << last_msg_->signature[65]; + EXPECT_EQ(last_msg_->signature[66], 66) + << "incorrect value for signature[66], expected 66, is " + << last_msg_->signature[66]; + EXPECT_EQ(last_msg_->signature[67], 67) + << "incorrect value for signature[67], expected 67, is " + << last_msg_->signature[67]; + EXPECT_EQ(last_msg_->signature[68], 68) + << "incorrect value for signature[68], expected 68, is " + << last_msg_->signature[68]; + EXPECT_EQ(last_msg_->signature[69], 69) + << "incorrect value for signature[69], expected 69, is " + << last_msg_->signature[69]; + EXPECT_EQ(last_msg_->signature[70], 70) + << "incorrect value for signature[70], expected 70, is " + << last_msg_->signature[70]; + EXPECT_EQ(last_msg_->signature[71], 71) + << "incorrect value for signature[71], expected 71, is " + << last_msg_->signature[71]; + EXPECT_EQ(last_msg_->signed_messages[0], 10) + << "incorrect value for signed_messages[0], expected 10, is " + << last_msg_->signed_messages[0]; + EXPECT_EQ(last_msg_->signed_messages[1], 21) + << "incorrect value for signed_messages[1], expected 21, is " + << last_msg_->signed_messages[1]; + EXPECT_EQ(last_msg_->signed_messages[2], 23) + << "incorrect value for signed_messages[2], expected 23, is " + << last_msg_->signed_messages[2]; + EXPECT_EQ(last_msg_->stream_counter, 1) + << "incorrect value for stream_counter, expected 1, is " + << last_msg_->stream_counter; +} diff --git a/haskell/src/SwiftNav/SBP/Msg.hs b/haskell/src/SwiftNav/SBP/Msg.hs index 4e87b7e08d..784c40d792 100644 --- a/haskell/src/SwiftNav/SBP/Msg.hs +++ b/haskell/src/SwiftNav/SBP/Msg.hs @@ -86,6 +86,7 @@ data SBPMsg = | SBPMsgBootloaderJumpToApp MsgBootloaderJumpToApp Msg | SBPMsgCellModemStatus MsgCellModemStatus Msg | SBPMsgCertificateChain MsgCertificateChain Msg + | SBPMsgCertificateChainDep MsgCertificateChainDep Msg | SBPMsgCommandOutput MsgCommandOutput Msg | SBPMsgCommandReq MsgCommandReq Msg | SBPMsgCommandResp MsgCommandResp Msg @@ -99,7 +100,8 @@ data SBPMsg = | SBPMsgDopsDepA MsgDopsDepA Msg | SBPMsgEcdsaCertificate MsgEcdsaCertificate Msg | SBPMsgEcdsaSignature MsgEcdsaSignature Msg - | SBPMsgEcdsaSignatureDep MsgEcdsaSignatureDep Msg + | SBPMsgEcdsaSignatureDepA MsgEcdsaSignatureDepA Msg + | SBPMsgEcdsaSignatureDepB MsgEcdsaSignatureDepB Msg | SBPMsgEd25519CertificateDep MsgEd25519CertificateDep Msg | SBPMsgEd25519SignatureDepA MsgEd25519SignatureDepA Msg | SBPMsgEd25519SignatureDepB MsgEd25519SignatureDepB Msg @@ -330,6 +332,7 @@ instance Binary SBPMsg where | _msgSBPType == msgBootloaderJumpToApp = SBPMsgBootloaderJumpToApp (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgCellModemStatus = SBPMsgCellModemStatus (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgCertificateChain = SBPMsgCertificateChain (decode (fromStrict (unBytes _msgSBPPayload))) m + | _msgSBPType == msgCertificateChainDep = SBPMsgCertificateChainDep (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgCommandOutput = SBPMsgCommandOutput (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgCommandReq = SBPMsgCommandReq (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgCommandResp = SBPMsgCommandResp (decode (fromStrict (unBytes _msgSBPPayload))) m @@ -343,7 +346,8 @@ instance Binary SBPMsg where | _msgSBPType == msgDopsDepA = SBPMsgDopsDepA (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgEcdsaCertificate = SBPMsgEcdsaCertificate (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgEcdsaSignature = SBPMsgEcdsaSignature (decode (fromStrict (unBytes _msgSBPPayload))) m - | _msgSBPType == msgEcdsaSignatureDep = SBPMsgEcdsaSignatureDep (decode (fromStrict (unBytes _msgSBPPayload))) m + | _msgSBPType == msgEcdsaSignatureDepA = SBPMsgEcdsaSignatureDepA (decode (fromStrict (unBytes _msgSBPPayload))) m + | _msgSBPType == msgEcdsaSignatureDepB = SBPMsgEcdsaSignatureDepB (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgEd25519CertificateDep = SBPMsgEd25519CertificateDep (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgEd25519SignatureDepA = SBPMsgEd25519SignatureDepA (decode (fromStrict (unBytes _msgSBPPayload))) m | _msgSBPType == msgEd25519SignatureDepB = SBPMsgEd25519SignatureDepB (decode (fromStrict (unBytes _msgSBPPayload))) m @@ -566,6 +570,7 @@ instance Binary SBPMsg where encoder (SBPMsgBootloaderJumpToApp _ m) = put m encoder (SBPMsgCellModemStatus _ m) = put m encoder (SBPMsgCertificateChain _ m) = put m + encoder (SBPMsgCertificateChainDep _ m) = put m encoder (SBPMsgCommandOutput _ m) = put m encoder (SBPMsgCommandReq _ m) = put m encoder (SBPMsgCommandResp _ m) = put m @@ -579,7 +584,8 @@ instance Binary SBPMsg where encoder (SBPMsgDopsDepA _ m) = put m encoder (SBPMsgEcdsaCertificate _ m) = put m encoder (SBPMsgEcdsaSignature _ m) = put m - encoder (SBPMsgEcdsaSignatureDep _ m) = put m + encoder (SBPMsgEcdsaSignatureDepA _ m) = put m + encoder (SBPMsgEcdsaSignatureDepB _ m) = put m encoder (SBPMsgEd25519CertificateDep _ m) = put m encoder (SBPMsgEd25519SignatureDepA _ m) = put m encoder (SBPMsgEd25519SignatureDepB _ m) = put m @@ -806,6 +812,7 @@ instance FromJSON SBPMsg where | msgType == msgBootloaderJumpToApp = SBPMsgBootloaderJumpToApp <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgCellModemStatus = SBPMsgCellModemStatus <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgCertificateChain = SBPMsgCertificateChain <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj + | msgType == msgCertificateChainDep = SBPMsgCertificateChainDep <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgCommandOutput = SBPMsgCommandOutput <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgCommandReq = SBPMsgCommandReq <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgCommandResp = SBPMsgCommandResp <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj @@ -819,7 +826,8 @@ instance FromJSON SBPMsg where | msgType == msgDopsDepA = SBPMsgDopsDepA <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgEcdsaCertificate = SBPMsgEcdsaCertificate <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgEcdsaSignature = SBPMsgEcdsaSignature <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj - | msgType == msgEcdsaSignatureDep = SBPMsgEcdsaSignatureDep <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj + | msgType == msgEcdsaSignatureDepA = SBPMsgEcdsaSignatureDepA <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj + | msgType == msgEcdsaSignatureDepB = SBPMsgEcdsaSignatureDepB <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgEd25519CertificateDep = SBPMsgEd25519CertificateDep <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgEd25519SignatureDepA = SBPMsgEd25519SignatureDepA <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj | msgType == msgEd25519SignatureDepB = SBPMsgEd25519SignatureDepB <$> pure (decode (fromStrict (unBytes payload))) <*> parseJSON obj @@ -1047,6 +1055,7 @@ instance ToJSON SBPMsg where toJSON (SBPMsgBootloaderJumpToApp n m) = toJSON n <<>> toJSON m toJSON (SBPMsgCellModemStatus n m) = toJSON n <<>> toJSON m toJSON (SBPMsgCertificateChain n m) = toJSON n <<>> toJSON m + toJSON (SBPMsgCertificateChainDep n m) = toJSON n <<>> toJSON m toJSON (SBPMsgCommandOutput n m) = toJSON n <<>> toJSON m toJSON (SBPMsgCommandReq n m) = toJSON n <<>> toJSON m toJSON (SBPMsgCommandResp n m) = toJSON n <<>> toJSON m @@ -1060,7 +1069,8 @@ instance ToJSON SBPMsg where toJSON (SBPMsgDopsDepA n m) = toJSON n <<>> toJSON m toJSON (SBPMsgEcdsaCertificate n m) = toJSON n <<>> toJSON m toJSON (SBPMsgEcdsaSignature n m) = toJSON n <<>> toJSON m - toJSON (SBPMsgEcdsaSignatureDep n m) = toJSON n <<>> toJSON m + toJSON (SBPMsgEcdsaSignatureDepA n m) = toJSON n <<>> toJSON m + toJSON (SBPMsgEcdsaSignatureDepB n m) = toJSON n <<>> toJSON m toJSON (SBPMsgEd25519CertificateDep n m) = toJSON n <<>> toJSON m toJSON (SBPMsgEd25519SignatureDepA n m) = toJSON n <<>> toJSON m toJSON (SBPMsgEd25519SignatureDepB n m) = toJSON n <<>> toJSON m @@ -1282,6 +1292,7 @@ instance HasMsg SBPMsg where msg f (SBPMsgBootloaderJumpToApp n m) = SBPMsgBootloaderJumpToApp n <$> f m msg f (SBPMsgCellModemStatus n m) = SBPMsgCellModemStatus n <$> f m msg f (SBPMsgCertificateChain n m) = SBPMsgCertificateChain n <$> f m + msg f (SBPMsgCertificateChainDep n m) = SBPMsgCertificateChainDep n <$> f m msg f (SBPMsgCommandOutput n m) = SBPMsgCommandOutput n <$> f m msg f (SBPMsgCommandReq n m) = SBPMsgCommandReq n <$> f m msg f (SBPMsgCommandResp n m) = SBPMsgCommandResp n <$> f m @@ -1295,7 +1306,8 @@ instance HasMsg SBPMsg where msg f (SBPMsgDopsDepA n m) = SBPMsgDopsDepA n <$> f m msg f (SBPMsgEcdsaCertificate n m) = SBPMsgEcdsaCertificate n <$> f m msg f (SBPMsgEcdsaSignature n m) = SBPMsgEcdsaSignature n <$> f m - msg f (SBPMsgEcdsaSignatureDep n m) = SBPMsgEcdsaSignatureDep n <$> f m + msg f (SBPMsgEcdsaSignatureDepA n m) = SBPMsgEcdsaSignatureDepA n <$> f m + msg f (SBPMsgEcdsaSignatureDepB n m) = SBPMsgEcdsaSignatureDepB n <$> f m msg f (SBPMsgEd25519CertificateDep n m) = SBPMsgEd25519CertificateDep n <$> f m msg f (SBPMsgEd25519SignatureDepA n m) = SBPMsgEd25519SignatureDepA n <$> f m msg f (SBPMsgEd25519SignatureDepB n m) = SBPMsgEd25519SignatureDepB n <$> f m diff --git a/haskell/src/SwiftNav/SBP/Signing.hs b/haskell/src/SwiftNav/SBP/Signing.hs index 4e3b92fae3..828ef9197d 100644 --- a/haskell/src/SwiftNav/SBP/Signing.hs +++ b/haskell/src/SwiftNav/SBP/Signing.hs @@ -75,6 +75,29 @@ instance Binary UtcTime where $(makeJSON "_utcTime_" ''UtcTime) $(makeLenses ''UtcTime) +data ECDSASignature = ECDSASignature + { _eCDSASignature_len :: !Word8 + -- ^ Number of bytes to use of the signature field. The DER encoded + -- signature has a maximum size of 72 bytes but can vary between 70 and 72 + -- bytes in length. + , _eCDSASignature_data :: ![Word8] + -- ^ DER encoded ECDSA signature for the messages using SHA-256 as the + -- digest algorithm. + } deriving ( Show, Read, Eq ) + +instance Binary ECDSASignature where + get = do + _eCDSASignature_len <- getWord8 + _eCDSASignature_data <- replicateM 72 getWord8 + pure ECDSASignature {..} + + put ECDSASignature {..} = do + putWord8 _eCDSASignature_len + mapM_ putWord8 _eCDSASignature_data + +$(makeJSON "_eCDSASignature_" ''ECDSASignature) +$(makeLenses ''ECDSASignature) + msgEcdsaCertificate :: Word16 msgEcdsaCertificate = 0x0C04 @@ -113,7 +136,7 @@ $(makeJSON "_msgEcdsaCertificate_" ''MsgEcdsaCertificate) $(makeLenses ''MsgEcdsaCertificate) msgCertificateChain :: Word16 -msgCertificateChain = 0x0C05 +msgCertificateChain = 0x0C09 data MsgCertificateChain = MsgCertificateChain { _msgCertificateChain_root_certificate :: ![Word8] @@ -125,10 +148,10 @@ data MsgCertificateChain = MsgCertificateChain , _msgCertificateChain_expiration :: !UtcTime -- ^ The certificate chain comprised of three fingerprints: root -- certificate, intermediate certificate and corrections certificate. - , _msgCertificateChain_signature :: ![Word8] - -- ^ An ECDSA signature (created by the root certificate) over the - -- concatenation of the SBP payload bytes preceding this field. That is, - -- the concatenation of `root_certificate`, `intermediate_certificate`, + , _msgCertificateChain_signature :: !ECDSASignature + -- ^ Signature (created by the root certificate) over the concatenation of + -- the SBP payload bytes preceding this field. That is, the concatenation + -- of `root_certificate`, `intermediate_certificate`, -- `corrections_certificate` and `expiration`. This certificate chain -- (allow list) can also be validated by fetching it from -- `http(s)://certs.swiftnav.com/chain`. @@ -140,7 +163,7 @@ instance Binary MsgCertificateChain where _msgCertificateChain_intermediate_certificate <- replicateM 20 getWord8 _msgCertificateChain_corrections_certificate <- replicateM 20 getWord8 _msgCertificateChain_expiration <- get - _msgCertificateChain_signature <- replicateM 64 getWord8 + _msgCertificateChain_signature <- get pure MsgCertificateChain {..} put MsgCertificateChain {..} = do @@ -148,16 +171,58 @@ instance Binary MsgCertificateChain where mapM_ putWord8 _msgCertificateChain_intermediate_certificate mapM_ putWord8 _msgCertificateChain_corrections_certificate put _msgCertificateChain_expiration - mapM_ putWord8 _msgCertificateChain_signature + put _msgCertificateChain_signature $(makeSBP 'msgCertificateChain ''MsgCertificateChain) $(makeJSON "_msgCertificateChain_" ''MsgCertificateChain) $(makeLenses ''MsgCertificateChain) +msgCertificateChainDep :: Word16 +msgCertificateChainDep = 0x0C05 + +data MsgCertificateChainDep = MsgCertificateChainDep + { _msgCertificateChainDep_root_certificate :: ![Word8] + -- ^ SHA-1 fingerprint of the root certificate + , _msgCertificateChainDep_intermediate_certificate :: ![Word8] + -- ^ SHA-1 fingerprint of the intermediate certificate + , _msgCertificateChainDep_corrections_certificate :: ![Word8] + -- ^ SHA-1 fingerprint of the corrections certificate + , _msgCertificateChainDep_expiration :: !UtcTime + -- ^ The certificate chain comprised of three fingerprints: root + -- certificate, intermediate certificate and corrections certificate. + , _msgCertificateChainDep_signature :: ![Word8] + -- ^ An ECDSA signature (created by the root certificate) over the + -- concatenation of the SBP payload bytes preceding this field. That is, + -- the concatenation of `root_certificate`, `intermediate_certificate`, + -- `corrections_certificate` and `expiration`. This certificate chain + -- (allow list) can also be validated by fetching it from + -- `http(s)://certs.swiftnav.com/chain`. + } deriving ( Show, Read, Eq ) + +instance Binary MsgCertificateChainDep where + get = do + _msgCertificateChainDep_root_certificate <- replicateM 20 getWord8 + _msgCertificateChainDep_intermediate_certificate <- replicateM 20 getWord8 + _msgCertificateChainDep_corrections_certificate <- replicateM 20 getWord8 + _msgCertificateChainDep_expiration <- get + _msgCertificateChainDep_signature <- replicateM 64 getWord8 + pure MsgCertificateChainDep {..} + + put MsgCertificateChainDep {..} = do + mapM_ putWord8 _msgCertificateChainDep_root_certificate + mapM_ putWord8 _msgCertificateChainDep_intermediate_certificate + mapM_ putWord8 _msgCertificateChainDep_corrections_certificate + put _msgCertificateChainDep_expiration + mapM_ putWord8 _msgCertificateChainDep_signature + +$(makeSBP 'msgCertificateChainDep ''MsgCertificateChainDep) +$(makeJSON "_msgCertificateChainDep_" ''MsgCertificateChainDep) +$(makeLenses ''MsgCertificateChainDep) + msgEcdsaSignature :: Word16 -msgEcdsaSignature = 0x0C07 +msgEcdsaSignature = 0x0C08 --- | SBP class for message MSG_ECDSA_SIGNATURE (0x0C07). +-- | SBP class for message MSG_ECDSA_SIGNATURE (0x0C08). -- -- An ECDSA-256 signature using SHA-256 as the message digest algorithm. data MsgEcdsaSignature = MsgEcdsaSignature @@ -176,13 +241,8 @@ data MsgEcdsaSignature = MsgEcdsaSignature -- counter may not initially be zero. , _msgEcdsaSignature_certificate_id :: ![Word8] -- ^ The last 4 bytes of the certificate's SHA-1 fingerprint - , _msgEcdsaSignature_n_signature_bytes :: !Word8 - -- ^ Number of bytes to use of the signature field. The DER encoded - -- signature has a maximum size of 72 bytes but can vary between 70 and 72 - -- bytes in length. - , _msgEcdsaSignature_signature :: ![Word8] - -- ^ DER encoded ECDSA signature for the messages using SHA-256 as the - -- digest algorithm. + , _msgEcdsaSignature_signature :: !ECDSASignature + -- ^ Signature over the frames of this message group. , _msgEcdsaSignature_signed_messages :: ![Word8] -- ^ CRCs of the messages covered by this signature. For Skylark, which -- delivers SBP messages wrapped in Swift's proprietary RTCM message, @@ -197,8 +257,7 @@ instance Binary MsgEcdsaSignature where _msgEcdsaSignature_stream_counter <- getWord8 _msgEcdsaSignature_on_demand_counter <- getWord8 _msgEcdsaSignature_certificate_id <- replicateM 4 getWord8 - _msgEcdsaSignature_n_signature_bytes <- getWord8 - _msgEcdsaSignature_signature <- replicateM 72 getWord8 + _msgEcdsaSignature_signature <- get _msgEcdsaSignature_signed_messages <- whileM (not <$> isEmpty) getWord8 pure MsgEcdsaSignature {..} @@ -207,39 +266,99 @@ instance Binary MsgEcdsaSignature where putWord8 _msgEcdsaSignature_stream_counter putWord8 _msgEcdsaSignature_on_demand_counter mapM_ putWord8 _msgEcdsaSignature_certificate_id - putWord8 _msgEcdsaSignature_n_signature_bytes - mapM_ putWord8 _msgEcdsaSignature_signature + put _msgEcdsaSignature_signature mapM_ putWord8 _msgEcdsaSignature_signed_messages $(makeSBP 'msgEcdsaSignature ''MsgEcdsaSignature) $(makeJSON "_msgEcdsaSignature_" ''MsgEcdsaSignature) $(makeLenses ''MsgEcdsaSignature) -msgEcdsaSignatureDep :: Word16 -msgEcdsaSignatureDep = 0x0C06 +msgEcdsaSignatureDepB :: Word16 +msgEcdsaSignatureDepB = 0x0C07 + +-- | SBP class for message MSG_ECDSA_SIGNATURE_DEP_B (0x0C07). +-- +-- An ECDSA-256 signature using SHA-256 as the message digest algorithm. +data MsgEcdsaSignatureDepB = MsgEcdsaSignatureDepB + { _msgEcdsaSignatureDepB_flags :: !Word8 + -- ^ Describes the format of the `signed\_messages` field below. + , _msgEcdsaSignatureDepB_stream_counter :: !Word8 + -- ^ Signature message counter. Zero indexed and incremented with each + -- signature message. The counter will not increment if this message was + -- in response to an on demand request. The counter will roll over after + -- 256 messages. Upon connection, the value of the counter may not + -- initially be zero. + , _msgEcdsaSignatureDepB_on_demand_counter :: !Word8 + -- ^ On demand message counter. Zero indexed and incremented with each + -- signature message sent in response to an on demand message. The counter + -- will roll over after 256 messages. Upon connection, the value of the + -- counter may not initially be zero. + , _msgEcdsaSignatureDepB_certificate_id :: ![Word8] + -- ^ The last 4 bytes of the certificate's SHA-1 fingerprint + , _msgEcdsaSignatureDepB_n_signature_bytes :: !Word8 + -- ^ Number of bytes to use of the signature field. The DER encoded + -- signature has a maximum size of 72 bytes but can vary between 70 and 72 + -- bytes in length. + , _msgEcdsaSignatureDepB_signature :: ![Word8] + -- ^ DER encoded ECDSA signature for the messages using SHA-256 as the + -- digest algorithm. + , _msgEcdsaSignatureDepB_signed_messages :: ![Word8] + -- ^ CRCs of the messages covered by this signature. For Skylark, which + -- delivers SBP messages wrapped in Swift's proprietary RTCM message, + -- these are the 24-bit CRCs from the RTCM message framing. For SBP only + -- streams, this will be 16-bit CRCs from the SBP framing. See the + -- `flags` field to determine the type of CRCs covered. + } deriving ( Show, Read, Eq ) --- | SBP class for message MSG_ECDSA_SIGNATURE_DEP (0x0C06). +instance Binary MsgEcdsaSignatureDepB where + get = do + _msgEcdsaSignatureDepB_flags <- getWord8 + _msgEcdsaSignatureDepB_stream_counter <- getWord8 + _msgEcdsaSignatureDepB_on_demand_counter <- getWord8 + _msgEcdsaSignatureDepB_certificate_id <- replicateM 4 getWord8 + _msgEcdsaSignatureDepB_n_signature_bytes <- getWord8 + _msgEcdsaSignatureDepB_signature <- replicateM 72 getWord8 + _msgEcdsaSignatureDepB_signed_messages <- whileM (not <$> isEmpty) getWord8 + pure MsgEcdsaSignatureDepB {..} + + put MsgEcdsaSignatureDepB {..} = do + putWord8 _msgEcdsaSignatureDepB_flags + putWord8 _msgEcdsaSignatureDepB_stream_counter + putWord8 _msgEcdsaSignatureDepB_on_demand_counter + mapM_ putWord8 _msgEcdsaSignatureDepB_certificate_id + putWord8 _msgEcdsaSignatureDepB_n_signature_bytes + mapM_ putWord8 _msgEcdsaSignatureDepB_signature + mapM_ putWord8 _msgEcdsaSignatureDepB_signed_messages + +$(makeSBP 'msgEcdsaSignatureDepB ''MsgEcdsaSignatureDepB) +$(makeJSON "_msgEcdsaSignatureDepB_" ''MsgEcdsaSignatureDepB) +$(makeLenses ''MsgEcdsaSignatureDepB) + +msgEcdsaSignatureDepA :: Word16 +msgEcdsaSignatureDepA = 0x0C06 + +-- | SBP class for message MSG_ECDSA_SIGNATURE_DEP_A (0x0C06). -- -- An ECDSA-256 signature using SHA-256 as the message digest algorithm. -data MsgEcdsaSignatureDep = MsgEcdsaSignatureDep - { _msgEcdsaSignatureDep_flags :: !Word8 +data MsgEcdsaSignatureDepA = MsgEcdsaSignatureDepA + { _msgEcdsaSignatureDepA_flags :: !Word8 -- ^ Describes the format of the `signed\_messages` field below. - , _msgEcdsaSignatureDep_stream_counter :: !Word8 + , _msgEcdsaSignatureDepA_stream_counter :: !Word8 -- ^ Signature message counter. Zero indexed and incremented with each -- signature message. The counter will not increment if this message was -- in response to an on demand request. The counter will roll over after -- 256 messages. Upon connection, the value of the counter may not -- initially be zero. - , _msgEcdsaSignatureDep_on_demand_counter :: !Word8 + , _msgEcdsaSignatureDepA_on_demand_counter :: !Word8 -- ^ On demand message counter. Zero indexed and incremented with each -- signature message sent in response to an on demand message. The counter -- will roll over after 256 messages. Upon connection, the value of the -- counter may not initially be zero. - , _msgEcdsaSignatureDep_certificate_id :: ![Word8] + , _msgEcdsaSignatureDepA_certificate_id :: ![Word8] -- ^ The last 4 bytes of the certificate's SHA-1 fingerprint - , _msgEcdsaSignatureDep_signature :: ![Word8] + , _msgEcdsaSignatureDepA_signature :: ![Word8] -- ^ ECDSA signature for the messages using SHA-256 as the digest algorithm. - , _msgEcdsaSignatureDep_signed_messages :: ![Word8] + , _msgEcdsaSignatureDepA_signed_messages :: ![Word8] -- ^ CRCs of the messages covered by this signature. For Skylark, which -- delivers SBP messages wrapped in Swift's proprietary RTCM message, -- these are the 24-bit CRCs from the RTCM message framing. For SBP only @@ -247,27 +366,27 @@ data MsgEcdsaSignatureDep = MsgEcdsaSignatureDep -- `flags` field to determine the type of CRCs covered. } deriving ( Show, Read, Eq ) -instance Binary MsgEcdsaSignatureDep where +instance Binary MsgEcdsaSignatureDepA where get = do - _msgEcdsaSignatureDep_flags <- getWord8 - _msgEcdsaSignatureDep_stream_counter <- getWord8 - _msgEcdsaSignatureDep_on_demand_counter <- getWord8 - _msgEcdsaSignatureDep_certificate_id <- replicateM 4 getWord8 - _msgEcdsaSignatureDep_signature <- replicateM 64 getWord8 - _msgEcdsaSignatureDep_signed_messages <- whileM (not <$> isEmpty) getWord8 - pure MsgEcdsaSignatureDep {..} - - put MsgEcdsaSignatureDep {..} = do - putWord8 _msgEcdsaSignatureDep_flags - putWord8 _msgEcdsaSignatureDep_stream_counter - putWord8 _msgEcdsaSignatureDep_on_demand_counter - mapM_ putWord8 _msgEcdsaSignatureDep_certificate_id - mapM_ putWord8 _msgEcdsaSignatureDep_signature - mapM_ putWord8 _msgEcdsaSignatureDep_signed_messages - -$(makeSBP 'msgEcdsaSignatureDep ''MsgEcdsaSignatureDep) -$(makeJSON "_msgEcdsaSignatureDep_" ''MsgEcdsaSignatureDep) -$(makeLenses ''MsgEcdsaSignatureDep) + _msgEcdsaSignatureDepA_flags <- getWord8 + _msgEcdsaSignatureDepA_stream_counter <- getWord8 + _msgEcdsaSignatureDepA_on_demand_counter <- getWord8 + _msgEcdsaSignatureDepA_certificate_id <- replicateM 4 getWord8 + _msgEcdsaSignatureDepA_signature <- replicateM 64 getWord8 + _msgEcdsaSignatureDepA_signed_messages <- whileM (not <$> isEmpty) getWord8 + pure MsgEcdsaSignatureDepA {..} + + put MsgEcdsaSignatureDepA {..} = do + putWord8 _msgEcdsaSignatureDepA_flags + putWord8 _msgEcdsaSignatureDepA_stream_counter + putWord8 _msgEcdsaSignatureDepA_on_demand_counter + mapM_ putWord8 _msgEcdsaSignatureDepA_certificate_id + mapM_ putWord8 _msgEcdsaSignatureDepA_signature + mapM_ putWord8 _msgEcdsaSignatureDepA_signed_messages + +$(makeSBP 'msgEcdsaSignatureDepA ''MsgEcdsaSignatureDepA) +$(makeJSON "_msgEcdsaSignatureDepA_" ''MsgEcdsaSignatureDepA) +$(makeLenses ''MsgEcdsaSignatureDepA) msgEd25519CertificateDep :: Word16 msgEd25519CertificateDep = 0x0C02 diff --git a/java/src/com/swiftnav/sbp/client/MessageTable.java b/java/src/com/swiftnav/sbp/client/MessageTable.java index 500aa8cd7e..e710975fc4 100644 --- a/java/src/com/swiftnav/sbp/client/MessageTable.java +++ b/java/src/com/swiftnav/sbp/client/MessageTable.java @@ -190,9 +190,11 @@ import com.swiftnav.sbp.settings.MsgSettingsWrite; import com.swiftnav.sbp.settings.MsgSettingsWriteResp; import com.swiftnav.sbp.signing.MsgCertificateChain; +import com.swiftnav.sbp.signing.MsgCertificateChainDep; import com.swiftnav.sbp.signing.MsgEcdsaCertificate; import com.swiftnav.sbp.signing.MsgEcdsaSignature; -import com.swiftnav.sbp.signing.MsgEcdsaSignatureDep; +import com.swiftnav.sbp.signing.MsgEcdsaSignatureDepA; +import com.swiftnav.sbp.signing.MsgEcdsaSignatureDepB; import com.swiftnav.sbp.signing.MsgEd25519CertificateDep; import com.swiftnav.sbp.signing.MsgEd25519SignatureDepA; import com.swiftnav.sbp.signing.MsgEd25519SignatureDepB; @@ -604,10 +606,14 @@ static SBPMessage dispatch(SBPMessage msg) throws SBPBinaryException { return new MsgEcdsaCertificate(msg); case MsgCertificateChain.TYPE: return new MsgCertificateChain(msg); + case MsgCertificateChainDep.TYPE: + return new MsgCertificateChainDep(msg); case MsgEcdsaSignature.TYPE: return new MsgEcdsaSignature(msg); - case MsgEcdsaSignatureDep.TYPE: - return new MsgEcdsaSignatureDep(msg); + case MsgEcdsaSignatureDepB.TYPE: + return new MsgEcdsaSignatureDepB(msg); + case MsgEcdsaSignatureDepA.TYPE: + return new MsgEcdsaSignatureDepA(msg); case MsgEd25519CertificateDep.TYPE: return new MsgEd25519CertificateDep(msg); case MsgEd25519SignatureDepA.TYPE: diff --git a/java/src/com/swiftnav/sbp/signing/ECDSASignature.java b/java/src/com/swiftnav/sbp/signing/ECDSASignature.java new file mode 100644 index 0000000000..f95a29eb08 --- /dev/null +++ b/java/src/com/swiftnav/sbp/signing/ECDSASignature.java @@ -0,0 +1,58 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.signing; + +// This file was auto-generated from yaml/swiftnav/sbp/signing.yaml by generate.py. +// Do not modify by hand! + + +import com.swiftnav.sbp.SBPBinaryException; +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.SBPStruct; +import org.json.JSONArray; +import org.json.JSONObject; + +public class ECDSASignature extends SBPStruct { + + /** + * Number of bytes to use of the signature field. The DER encoded signature has a maximum size + * of 72 bytes but can vary between 70 and 72 bytes in length. + */ + public int len; + + /** DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. */ + public int[] data; + + public ECDSASignature() {} + + @Override + public ECDSASignature parse(SBPMessage.Parser parser) throws SBPBinaryException { + /* Parse fields from binary */ + len = parser.getU8(); + data = parser.getArrayofU8(72); + return this; + } + + @Override + public void build(SBPMessage.Builder builder) { + /* Build fields into binary */ + builder.putU8(len); + builder.putArrayofU8(data, 72); + } + + @Override + public JSONObject toJSON() { + JSONObject obj = new JSONObject(); + obj.put("len", len); + obj.put("data", new JSONArray(data)); + return obj; + } +} diff --git a/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java b/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java index e3662a8401..a8abee15d0 100644 --- a/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java +++ b/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java @@ -20,7 +20,7 @@ import org.json.JSONObject; public class MsgCertificateChain extends SBPMessage { - public static final int TYPE = 0x0C05; + public static final int TYPE = 0x0C09; /** SHA-1 fingerprint of the root certificate */ public int[] root_certificate; @@ -38,13 +38,13 @@ public class MsgCertificateChain extends SBPMessage { public UtcTime expiration; /** - * An ECDSA signature (created by the root certificate) over the concatenation of the SBP - * payload bytes preceding this field. That is, the concatenation of `root_certificate`, + * Signature (created by the root certificate) over the concatenation of the SBP payload bytes + * preceding this field. That is, the concatenation of `root_certificate`, * `intermediate_certificate`, `corrections_certificate` and `expiration`. This certificate * chain (allow list) can also be validated by fetching it from * `http(s)://certs.swiftnav.com/chain`. */ - public int[] signature; + public ECDSASignature signature; public MsgCertificateChain(int sender) { super(sender, TYPE); @@ -58,7 +58,7 @@ public MsgCertificateChain(SBPMessage msg) throws SBPBinaryException { super(msg); if (msg.type != TYPE) throw new SBPBinaryException( - "Type mismatch for MsgCertificateChain, expected 3077, actual " + msg.type); + "Type mismatch for MsgCertificateChain, expected 3081, actual " + msg.type); } @Override @@ -68,7 +68,7 @@ protected void parse(Parser parser) throws SBPBinaryException { intermediate_certificate = parser.getArrayofU8(20); corrections_certificate = parser.getArrayofU8(20); expiration = new UtcTime().parse(parser); - signature = parser.getArrayofU8(64); + signature = new ECDSASignature().parse(parser); } @Override @@ -77,7 +77,7 @@ protected void build(Builder builder) { builder.putArrayofU8(intermediate_certificate, 20); builder.putArrayofU8(corrections_certificate, 20); expiration.build(builder); - builder.putArrayofU8(signature, 64); + signature.build(builder); } @Override @@ -87,7 +87,7 @@ public JSONObject toJSON() { obj.put("intermediate_certificate", new JSONArray(intermediate_certificate)); obj.put("corrections_certificate", new JSONArray(corrections_certificate)); obj.put("expiration", expiration.toJSON()); - obj.put("signature", new JSONArray(signature)); + obj.put("signature", signature.toJSON()); return obj; } diff --git a/java/src/com/swiftnav/sbp/signing/MsgCertificateChainDep.java b/java/src/com/swiftnav/sbp/signing/MsgCertificateChainDep.java new file mode 100644 index 0000000000..cbcb4e5fc2 --- /dev/null +++ b/java/src/com/swiftnav/sbp/signing/MsgCertificateChainDep.java @@ -0,0 +1,98 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.signing; + +// This file was auto-generated from yaml/swiftnav/sbp/signing.yaml by generate.py. +// Do not modify by hand! + + +import com.swiftnav.sbp.SBPBinaryException; +import com.swiftnav.sbp.SBPMessage; +import org.json.JSONArray; +import org.json.JSONObject; + +public class MsgCertificateChainDep extends SBPMessage { + public static final int TYPE = 0x0C05; + + /** SHA-1 fingerprint of the root certificate */ + public int[] root_certificate; + + /** SHA-1 fingerprint of the intermediate certificate */ + public int[] intermediate_certificate; + + /** SHA-1 fingerprint of the corrections certificate */ + public int[] corrections_certificate; + + /** + * The certificate chain comprised of three fingerprints: root certificate, intermediate + * certificate and corrections certificate. + */ + public UtcTime expiration; + + /** + * An ECDSA signature (created by the root certificate) over the concatenation of the SBP + * payload bytes preceding this field. That is, the concatenation of `root_certificate`, + * `intermediate_certificate`, `corrections_certificate` and `expiration`. This certificate + * chain (allow list) can also be validated by fetching it from + * `http(s)://certs.swiftnav.com/chain`. + */ + public int[] signature; + + public MsgCertificateChainDep(int sender) { + super(sender, TYPE); + } + + public MsgCertificateChainDep() { + super(TYPE); + } + + public MsgCertificateChainDep(SBPMessage msg) throws SBPBinaryException { + super(msg); + if (msg.type != TYPE) + throw new SBPBinaryException( + "Type mismatch for MsgCertificateChainDep, expected 3077, actual " + msg.type); + } + + @Override + protected void parse(Parser parser) throws SBPBinaryException { + /* Parse fields from binary */ + root_certificate = parser.getArrayofU8(20); + intermediate_certificate = parser.getArrayofU8(20); + corrections_certificate = parser.getArrayofU8(20); + expiration = new UtcTime().parse(parser); + signature = parser.getArrayofU8(64); + } + + @Override + protected void build(Builder builder) { + builder.putArrayofU8(root_certificate, 20); + builder.putArrayofU8(intermediate_certificate, 20); + builder.putArrayofU8(corrections_certificate, 20); + expiration.build(builder); + builder.putArrayofU8(signature, 64); + } + + @Override + public JSONObject toJSON() { + JSONObject obj = super.toJSON(); + obj.put("root_certificate", new JSONArray(root_certificate)); + obj.put("intermediate_certificate", new JSONArray(intermediate_certificate)); + obj.put("corrections_certificate", new JSONArray(corrections_certificate)); + obj.put("expiration", expiration.toJSON()); + obj.put("signature", new JSONArray(signature)); + return obj; + } + + @Override + public String getFriendlyName() { + return "CERTIFICATE CHAIN DEP"; + } +} diff --git a/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignature.java b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignature.java index 2fe36b54ad..293254fdb6 100644 --- a/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignature.java +++ b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignature.java @@ -20,7 +20,7 @@ import org.json.JSONObject; /** - * SBP class for message MSG_ECDSA_SIGNATURE (0x0C07). + * SBP class for message MSG_ECDSA_SIGNATURE (0x0C08). * *

You can have MSG_ECDSA_SIGNATURE inherent its fields directly from an inherited SBP object, or * construct it inline using a dict of its fields. @@ -28,7 +28,7 @@ *

An ECDSA-256 signature using SHA-256 as the message digest algorithm. */ public class MsgEcdsaSignature extends SBPMessage { - public static final int TYPE = 0x0C07; + public static final int TYPE = 0x0C08; /** Describes the format of the `signed\_messages` field below. */ public int flags; @@ -51,14 +51,8 @@ public class MsgEcdsaSignature extends SBPMessage { /** The last 4 bytes of the certificate's SHA-1 fingerprint */ public int[] certificate_id; - /** - * Number of bytes to use of the signature field. The DER encoded signature has a maximum size - * of 72 bytes but can vary between 70 and 72 bytes in length. - */ - public int n_signature_bytes; - - /** DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. */ - public int[] signature; + /** Signature over the frames of this message group. */ + public ECDSASignature signature; /** * CRCs of the messages covered by this signature. For Skylark, which delivers SBP messages @@ -80,7 +74,7 @@ public MsgEcdsaSignature(SBPMessage msg) throws SBPBinaryException { super(msg); if (msg.type != TYPE) throw new SBPBinaryException( - "Type mismatch for MsgEcdsaSignature, expected 3079, actual " + msg.type); + "Type mismatch for MsgEcdsaSignature, expected 3080, actual " + msg.type); } @Override @@ -90,8 +84,7 @@ protected void parse(Parser parser) throws SBPBinaryException { stream_counter = parser.getU8(); on_demand_counter = parser.getU8(); certificate_id = parser.getArrayofU8(4); - n_signature_bytes = parser.getU8(); - signature = parser.getArrayofU8(72); + signature = new ECDSASignature().parse(parser); signed_messages = parser.getArrayofU8(); } @@ -101,8 +94,7 @@ protected void build(Builder builder) { builder.putU8(stream_counter); builder.putU8(on_demand_counter); builder.putArrayofU8(certificate_id, 4); - builder.putU8(n_signature_bytes); - builder.putArrayofU8(signature, 72); + signature.build(builder); builder.putArrayofU8(signed_messages); } @@ -113,8 +105,7 @@ public JSONObject toJSON() { obj.put("stream_counter", stream_counter); obj.put("on_demand_counter", on_demand_counter); obj.put("certificate_id", new JSONArray(certificate_id)); - obj.put("n_signature_bytes", n_signature_bytes); - obj.put("signature", new JSONArray(signature)); + obj.put("signature", signature.toJSON()); obj.put("signed_messages", new JSONArray(signed_messages)); return obj; } diff --git a/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDep.java b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepA.java similarity index 87% rename from java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDep.java rename to java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepA.java index e9deb9c9e3..2be1121ea3 100644 --- a/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDep.java +++ b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepA.java @@ -20,14 +20,14 @@ import org.json.JSONObject; /** - * SBP class for message MSG_ECDSA_SIGNATURE_DEP (0x0C06). + * SBP class for message MSG_ECDSA_SIGNATURE_DEP_A (0x0C06). * - *

You can have MSG_ECDSA_SIGNATURE_DEP inherent its fields directly from an inherited SBP + *

You can have MSG_ECDSA_SIGNATURE_DEP_A inherent its fields directly from an inherited SBP * object, or construct it inline using a dict of its fields. * *

An ECDSA-256 signature using SHA-256 as the message digest algorithm. */ -public class MsgEcdsaSignatureDep extends SBPMessage { +public class MsgEcdsaSignatureDepA extends SBPMessage { public static final int TYPE = 0x0C06; /** Describes the format of the `signed\_messages` field below. */ @@ -62,19 +62,19 @@ public class MsgEcdsaSignatureDep extends SBPMessage { */ public int[] signed_messages; - public MsgEcdsaSignatureDep(int sender) { + public MsgEcdsaSignatureDepA(int sender) { super(sender, TYPE); } - public MsgEcdsaSignatureDep() { + public MsgEcdsaSignatureDepA() { super(TYPE); } - public MsgEcdsaSignatureDep(SBPMessage msg) throws SBPBinaryException { + public MsgEcdsaSignatureDepA(SBPMessage msg) throws SBPBinaryException { super(msg); if (msg.type != TYPE) throw new SBPBinaryException( - "Type mismatch for MsgEcdsaSignatureDep, expected 3078, actual " + msg.type); + "Type mismatch for MsgEcdsaSignatureDepA, expected 3078, actual " + msg.type); } @Override @@ -112,6 +112,6 @@ public JSONObject toJSON() { @Override public String getFriendlyName() { - return "ECDSA SIGNATURE DEP"; + return "ECDSA SIGNATURE DEP A"; } } diff --git a/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepB.java b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepB.java new file mode 100644 index 0000000000..4df651226e --- /dev/null +++ b/java/src/com/swiftnav/sbp/signing/MsgEcdsaSignatureDepB.java @@ -0,0 +1,126 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.signing; + +// This file was auto-generated from yaml/swiftnav/sbp/signing.yaml by generate.py. +// Do not modify by hand! + + +import com.swiftnav.sbp.SBPBinaryException; +import com.swiftnav.sbp.SBPMessage; +import org.json.JSONArray; +import org.json.JSONObject; + +/** + * SBP class for message MSG_ECDSA_SIGNATURE_DEP_B (0x0C07). + * + *

You can have MSG_ECDSA_SIGNATURE_DEP_B inherent its fields directly from an inherited SBP + * object, or construct it inline using a dict of its fields. + * + *

An ECDSA-256 signature using SHA-256 as the message digest algorithm. + */ +public class MsgEcdsaSignatureDepB extends SBPMessage { + public static final int TYPE = 0x0C07; + + /** Describes the format of the `signed\_messages` field below. */ + public int flags; + + /** + * Signature message counter. Zero indexed and incremented with each signature message. The + * counter will not increment if this message was in response to an on demand request. The + * counter will roll over after 256 messages. Upon connection, the value of the counter may not + * initially be zero. + */ + public int stream_counter; + + /** + * On demand message counter. Zero indexed and incremented with each signature message sent in + * response to an on demand message. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. + */ + public int on_demand_counter; + + /** The last 4 bytes of the certificate's SHA-1 fingerprint */ + public int[] certificate_id; + + /** + * Number of bytes to use of the signature field. The DER encoded signature has a maximum size + * of 72 bytes but can vary between 70 and 72 bytes in length. + */ + public int n_signature_bytes; + + /** DER encoded ECDSA signature for the messages using SHA-256 as the digest algorithm. */ + public int[] signature; + + /** + * CRCs of the messages covered by this signature. For Skylark, which delivers SBP messages + * wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs from the RTCM message + * framing. For SBP only streams, this will be 16-bit CRCs from the SBP framing. See the `flags` + * field to determine the type of CRCs covered. + */ + public int[] signed_messages; + + public MsgEcdsaSignatureDepB(int sender) { + super(sender, TYPE); + } + + public MsgEcdsaSignatureDepB() { + super(TYPE); + } + + public MsgEcdsaSignatureDepB(SBPMessage msg) throws SBPBinaryException { + super(msg); + if (msg.type != TYPE) + throw new SBPBinaryException( + "Type mismatch for MsgEcdsaSignatureDepB, expected 3079, actual " + msg.type); + } + + @Override + protected void parse(Parser parser) throws SBPBinaryException { + /* Parse fields from binary */ + flags = parser.getU8(); + stream_counter = parser.getU8(); + on_demand_counter = parser.getU8(); + certificate_id = parser.getArrayofU8(4); + n_signature_bytes = parser.getU8(); + signature = parser.getArrayofU8(72); + signed_messages = parser.getArrayofU8(); + } + + @Override + protected void build(Builder builder) { + builder.putU8(flags); + builder.putU8(stream_counter); + builder.putU8(on_demand_counter); + builder.putArrayofU8(certificate_id, 4); + builder.putU8(n_signature_bytes); + builder.putArrayofU8(signature, 72); + builder.putArrayofU8(signed_messages); + } + + @Override + public JSONObject toJSON() { + JSONObject obj = super.toJSON(); + obj.put("flags", flags); + obj.put("stream_counter", stream_counter); + obj.put("on_demand_counter", on_demand_counter); + obj.put("certificate_id", new JSONArray(certificate_id)); + obj.put("n_signature_bytes", n_signature_bytes); + obj.put("signature", new JSONArray(signature)); + obj.put("signed_messages", new JSONArray(signed_messages)); + return obj; + } + + @Override + public String getFriendlyName() { + return "ECDSA SIGNATURE DEP B"; + } +} diff --git a/java/test/auto_check_sbp_signing_MsgCertificateChainDepTest.java b/java/test/auto_check_sbp_signing_MsgCertificateChainDepTest.java new file mode 100644 index 0000000000..07d224dec2 --- /dev/null +++ b/java/test/auto_check_sbp_signing_MsgCertificateChainDepTest.java @@ -0,0 +1,1489 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.test; + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not +// modify by hand! + + +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.signing.MsgCertificateChainDep; +import java.math.BigInteger; +import org.json.JSONObject; +import org.junit.Test; + +public class auto_check_sbp_signing_MsgCertificateChainDepTest { + + public static boolean debug = false; + private static final double DELTA = 1e-15; + + @Test + public void test1() throws Throwable { + if (debug) + System.out.format("%n%s%n", "auto_check_sbp_signing_MsgCertificateChainDepTest.test1"); + byte[] payload = + new byte[] { + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 8, + (byte) 9, + (byte) 10, + (byte) 11, + (byte) 12, + (byte) 13, + (byte) 14, + (byte) 15, + (byte) 16, + (byte) 17, + (byte) 18, + (byte) 19, + (byte) 10, + (byte) 11, + (byte) 12, + (byte) 13, + (byte) 14, + (byte) 15, + (byte) 16, + (byte) 17, + (byte) 18, + (byte) 19, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 8, + (byte) 9, + (byte) 20, + (byte) 21, + (byte) 22, + (byte) 23, + (byte) 24, + (byte) 25, + (byte) 26, + (byte) 27, + (byte) 28, + (byte) 29, + (byte) 10, + (byte) 11, + (byte) 12, + (byte) 13, + (byte) 14, + (byte) 15, + (byte) 16, + (byte) 17, + (byte) 18, + (byte) 19, + (byte) 232, + (byte) 7, + (byte) 3, + (byte) 30, + (byte) 12, + (byte) 34, + (byte) 59, + (byte) 21, + (byte) 205, + (byte) 91, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + }; + SBPMessage sbp = new SBPMessage(0x42, 0xC05, payload); + MsgCertificateChainDep msg = new MsgCertificateChainDep(sbp); + JSONObject json = msg.toJSON(); + Number value; + Number expected; + value = msg.corrections_certificate[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[0] + "' != '" + 20 + "'", + value.equals(BigInteger.valueOf(20L))); + } else { + value = value.longValue(); + expected = 20L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[1] + "' != '" + 21 + "'", + value.equals(BigInteger.valueOf(21L))); + } else { + value = value.longValue(); + expected = 21L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[2] + "' != '" + 22 + "'", + value.equals(BigInteger.valueOf(22L))); + } else { + value = value.longValue(); + expected = 22L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[3] + "' != '" + 23 + "'", + value.equals(BigInteger.valueOf(23L))); + } else { + value = value.longValue(); + expected = 23L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[4] + "' != '" + 24 + "'", + value.equals(BigInteger.valueOf(24L))); + } else { + value = value.longValue(); + expected = 24L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[5] + "' != '" + 25 + "'", + value.equals(BigInteger.valueOf(25L))); + } else { + value = value.longValue(); + expected = 25L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[6] + "' != '" + 26 + "'", + value.equals(BigInteger.valueOf(26L))); + } else { + value = value.longValue(); + expected = 26L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[7] + "' != '" + 27 + "'", + value.equals(BigInteger.valueOf(27L))); + } else { + value = value.longValue(); + expected = 27L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[8] + "' != '" + 28 + "'", + value.equals(BigInteger.valueOf(28L))); + } else { + value = value.longValue(); + expected = 28L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[9] + "' != '" + 29 + "'", + value.equals(BigInteger.valueOf(29L))); + } else { + value = value.longValue(); + expected = 29L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[10] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[11] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); + } else { + value = value.longValue(); + expected = 11L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[12] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[13] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); + } else { + value = value.longValue(); + expected = 13L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[14] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); + } else { + value = value.longValue(); + expected = 14L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[15] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); + } else { + value = value.longValue(); + expected = 15L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[16] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); + } else { + value = value.longValue(); + expected = 16L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[17] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); + } else { + value = value.longValue(); + expected = 17L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[18] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); + } else { + value = value.longValue(); + expected = 18L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.corrections_certificate[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.corrections_certificate[19] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); + } else { + value = value.longValue(); + expected = 19L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.day; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.day + "' != '" + 30 + "'", + value.equals(BigInteger.valueOf(30L))); + } else { + value = value.longValue(); + expected = 30L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.hours; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.hours + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.minutes; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.minutes + "' != '" + 34 + "'", + value.equals(BigInteger.valueOf(34L))); + } else { + value = value.longValue(); + expected = 34L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.month; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.month + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.ns; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.ns + "' != '" + 123456789 + "'", + value.equals(BigInteger.valueOf(123456789L))); + } else { + value = value.longValue(); + expected = 123456789L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.seconds; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.seconds + "' != '" + 59 + "'", + value.equals(BigInteger.valueOf(59L))); + } else { + value = value.longValue(); + expected = 59L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.expiration.year; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.expiration.year + "' != '" + 2024 + "'", + value.equals(BigInteger.valueOf(2024L))); + } else { + value = value.longValue(); + expected = 2024L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[0] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[1] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); + } else { + value = value.longValue(); + expected = 11L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[2] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[3] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); + } else { + value = value.longValue(); + expected = 13L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[4] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); + } else { + value = value.longValue(); + expected = 14L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[5] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); + } else { + value = value.longValue(); + expected = 15L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[6] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); + } else { + value = value.longValue(); + expected = 16L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[7] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); + } else { + value = value.longValue(); + expected = 17L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[8] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); + } else { + value = value.longValue(); + expected = 18L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[9] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); + } else { + value = value.longValue(); + expected = 19L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[10] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[11] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[12] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[13] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[14] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[15] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[16] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[17] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[18] + "' != '" + 8 + "'", + value.equals(BigInteger.valueOf(8L))); + } else { + value = value.longValue(); + expected = 8L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.intermediate_certificate[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.intermediate_certificate[19] + "' != '" + 9 + "'", + value.equals(BigInteger.valueOf(9L))); + } else { + value = value.longValue(); + expected = 9L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[0] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[1] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[2] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[3] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[4] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[5] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[6] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[7] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[8] + "' != '" + 8 + "'", + value.equals(BigInteger.valueOf(8L))); + } else { + value = value.longValue(); + expected = 8L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[9] + "' != '" + 9 + "'", + value.equals(BigInteger.valueOf(9L))); + } else { + value = value.longValue(); + expected = 9L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[10] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[11] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); + } else { + value = value.longValue(); + expected = 11L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[12] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[13] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); + } else { + value = value.longValue(); + expected = 13L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[14] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); + } else { + value = value.longValue(); + expected = 14L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[15] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); + } else { + value = value.longValue(); + expected = 15L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[16] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); + } else { + value = value.longValue(); + expected = 16L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[17] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); + } else { + value = value.longValue(); + expected = 17L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[18] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); + } else { + value = value.longValue(); + expected = 18L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.root_certificate[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.root_certificate[19] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); + } else { + value = value.longValue(); + expected = 19L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[0] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[1] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[2] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[3] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[4] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[5] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[6] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[7] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[8] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[9] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[10] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[11] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[12] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[13] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[14] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[15] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[16] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[17] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[18] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[19] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[20]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[20] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[21]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[21] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[22]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[22] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[23]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[23] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[24]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[24] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[25]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[25] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[26]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[26] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[27]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[27] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[28]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[28] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[29]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[29] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[30]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[30] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[31]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[31] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[32]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[32] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[33]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[33] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[34]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[34] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[35]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[35] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[36]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[36] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[37]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[37] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[38]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[38] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[39]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[39] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[40]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[40] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[41]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[41] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[42]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[42] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[43]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[43] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[44]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[44] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[45]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[45] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[46]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[46] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[47]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[47] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[48]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[48] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[49]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[49] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[50]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[50] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[51]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[51] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[52]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[52] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[53]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[53] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[54]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[54] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[55]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[55] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[56]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[56] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[57]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[57] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[58]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[58] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[59]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[59] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[60]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[60] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[61]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[61] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[62]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[62] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[63]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[63] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + + org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); + } +} diff --git a/java/test/auto_check_sbp_signing_MsgCertificateChainTest.java b/java/test/auto_check_sbp_signing_MsgCertificateChainTest.java index 8406dc6c55..6df2fc54c3 100644 --- a/java/test/auto_check_sbp_signing_MsgCertificateChainTest.java +++ b/java/test/auto_check_sbp_signing_MsgCertificateChainTest.java @@ -103,6 +103,7 @@ public void test1() throws Throwable { (byte) 205, (byte) 91, (byte) 7, + (byte) 72, (byte) 0, (byte) 1, (byte) 2, @@ -111,64 +112,72 @@ public void test1() throws Throwable { (byte) 5, (byte) 6, (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, + (byte) 8, + (byte) 9, + (byte) 10, + (byte) 11, + (byte) 12, + (byte) 13, + (byte) 14, + (byte) 15, + (byte) 16, + (byte) 17, + (byte) 18, + (byte) 19, + (byte) 20, + (byte) 21, + (byte) 22, + (byte) 23, + (byte) 24, + (byte) 25, + (byte) 26, + (byte) 27, + (byte) 28, + (byte) 29, + (byte) 30, + (byte) 31, + (byte) 32, + (byte) 33, + (byte) 34, + (byte) 35, + (byte) 36, + (byte) 37, + (byte) 38, + (byte) 39, + (byte) 40, + (byte) 41, + (byte) 42, + (byte) 43, + (byte) 44, + (byte) 45, + (byte) 46, + (byte) 47, + (byte) 48, + (byte) 49, + (byte) 50, + (byte) 51, + (byte) 52, + (byte) 53, + (byte) 54, + (byte) 55, + (byte) 56, + (byte) 57, + (byte) 58, + (byte) 59, + (byte) 60, + (byte) 61, + (byte) 62, + (byte) 63, + (byte) 64, + (byte) 65, + (byte) 66, + (byte) 67, + (byte) 68, + (byte) 69, + (byte) 70, + (byte) 71, }; - SBPMessage sbp = new SBPMessage(0x42, 0xC05, payload); + SBPMessage sbp = new SBPMessage(0x42, 0xC09, payload); MsgCertificateChain msg = new MsgCertificateChain(sbp); JSONObject json = msg.toJSON(); Number value; @@ -843,644 +852,734 @@ public void test1() throws Throwable { expected = 19L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[0]; + value = msg.signature.data[0]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[0] + "' != '" + 0 + "'", + "'" + msg.signature.data[0] + "' != '" + 0 + "'", value.equals(BigInteger.valueOf(0L))); } else { value = value.longValue(); expected = 0L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[1]; + value = msg.signature.data[1]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[1] + "' != '" + 1 + "'", + "'" + msg.signature.data[1] + "' != '" + 1 + "'", value.equals(BigInteger.valueOf(1L))); } else { value = value.longValue(); expected = 1L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[2]; + value = msg.signature.data[2]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[2] + "' != '" + 2 + "'", + "'" + msg.signature.data[2] + "' != '" + 2 + "'", value.equals(BigInteger.valueOf(2L))); } else { value = value.longValue(); expected = 2L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[3]; + value = msg.signature.data[3]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[3] + "' != '" + 3 + "'", + "'" + msg.signature.data[3] + "' != '" + 3 + "'", value.equals(BigInteger.valueOf(3L))); } else { value = value.longValue(); expected = 3L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[4]; + value = msg.signature.data[4]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[4] + "' != '" + 4 + "'", + "'" + msg.signature.data[4] + "' != '" + 4 + "'", value.equals(BigInteger.valueOf(4L))); } else { value = value.longValue(); expected = 4L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[5]; + value = msg.signature.data[5]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[5] + "' != '" + 5 + "'", + "'" + msg.signature.data[5] + "' != '" + 5 + "'", value.equals(BigInteger.valueOf(5L))); } else { value = value.longValue(); expected = 5L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[6]; + value = msg.signature.data[6]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[6] + "' != '" + 6 + "'", + "'" + msg.signature.data[6] + "' != '" + 6 + "'", value.equals(BigInteger.valueOf(6L))); } else { value = value.longValue(); expected = 6L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[7]; + value = msg.signature.data[7]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[7] + "' != '" + 7 + "'", + "'" + msg.signature.data[7] + "' != '" + 7 + "'", value.equals(BigInteger.valueOf(7L))); } else { value = value.longValue(); expected = 7L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[8]; + value = msg.signature.data[8]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[8] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[8] + "' != '" + 8 + "'", + value.equals(BigInteger.valueOf(8L))); } else { value = value.longValue(); - expected = 0L; + expected = 8L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[9]; + value = msg.signature.data[9]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[9] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[9] + "' != '" + 9 + "'", + value.equals(BigInteger.valueOf(9L))); } else { value = value.longValue(); - expected = 1L; + expected = 9L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[10]; + value = msg.signature.data[10]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[10] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[10] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); } else { value = value.longValue(); - expected = 2L; + expected = 10L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[11]; + value = msg.signature.data[11]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[11] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[11] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); } else { value = value.longValue(); - expected = 3L; + expected = 11L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[12]; + value = msg.signature.data[12]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[12] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[12] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); } else { value = value.longValue(); - expected = 4L; + expected = 12L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[13]; + value = msg.signature.data[13]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[13] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[13] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); } else { value = value.longValue(); - expected = 5L; + expected = 13L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[14]; + value = msg.signature.data[14]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[14] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[14] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); } else { value = value.longValue(); - expected = 6L; + expected = 14L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[15]; + value = msg.signature.data[15]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[15] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[15] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); } else { value = value.longValue(); - expected = 7L; + expected = 15L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[16]; + value = msg.signature.data[16]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[16] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[16] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); } else { value = value.longValue(); - expected = 0L; + expected = 16L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[17]; + value = msg.signature.data[17]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[17] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[17] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); } else { value = value.longValue(); - expected = 1L; + expected = 17L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[18]; + value = msg.signature.data[18]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[18] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[18] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); } else { value = value.longValue(); - expected = 2L; + expected = 18L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[19]; + value = msg.signature.data[19]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[19] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[19] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); } else { value = value.longValue(); - expected = 3L; + expected = 19L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[20]; + value = msg.signature.data[20]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[20] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[20] + "' != '" + 20 + "'", + value.equals(BigInteger.valueOf(20L))); } else { value = value.longValue(); - expected = 4L; + expected = 20L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[21]; + value = msg.signature.data[21]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[21] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[21] + "' != '" + 21 + "'", + value.equals(BigInteger.valueOf(21L))); } else { value = value.longValue(); - expected = 5L; + expected = 21L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[22]; + value = msg.signature.data[22]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[22] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[22] + "' != '" + 22 + "'", + value.equals(BigInteger.valueOf(22L))); } else { value = value.longValue(); - expected = 6L; + expected = 22L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[23]; + value = msg.signature.data[23]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[23] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[23] + "' != '" + 23 + "'", + value.equals(BigInteger.valueOf(23L))); } else { value = value.longValue(); - expected = 7L; + expected = 23L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[24]; + value = msg.signature.data[24]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[24] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[24] + "' != '" + 24 + "'", + value.equals(BigInteger.valueOf(24L))); } else { value = value.longValue(); - expected = 0L; + expected = 24L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[25]; + value = msg.signature.data[25]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[25] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[25] + "' != '" + 25 + "'", + value.equals(BigInteger.valueOf(25L))); } else { value = value.longValue(); - expected = 1L; + expected = 25L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[26]; + value = msg.signature.data[26]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[26] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[26] + "' != '" + 26 + "'", + value.equals(BigInteger.valueOf(26L))); } else { value = value.longValue(); - expected = 2L; + expected = 26L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[27]; + value = msg.signature.data[27]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[27] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[27] + "' != '" + 27 + "'", + value.equals(BigInteger.valueOf(27L))); } else { value = value.longValue(); - expected = 3L; + expected = 27L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[28]; + value = msg.signature.data[28]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[28] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[28] + "' != '" + 28 + "'", + value.equals(BigInteger.valueOf(28L))); } else { value = value.longValue(); - expected = 4L; + expected = 28L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[29]; + value = msg.signature.data[29]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[29] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[29] + "' != '" + 29 + "'", + value.equals(BigInteger.valueOf(29L))); } else { value = value.longValue(); - expected = 5L; + expected = 29L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[30]; + value = msg.signature.data[30]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[30] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[30] + "' != '" + 30 + "'", + value.equals(BigInteger.valueOf(30L))); } else { value = value.longValue(); - expected = 6L; + expected = 30L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[31]; + value = msg.signature.data[31]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[31] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[31] + "' != '" + 31 + "'", + value.equals(BigInteger.valueOf(31L))); } else { value = value.longValue(); - expected = 7L; + expected = 31L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[32]; + value = msg.signature.data[32]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[32] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[32] + "' != '" + 32 + "'", + value.equals(BigInteger.valueOf(32L))); } else { value = value.longValue(); - expected = 0L; + expected = 32L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[33]; + value = msg.signature.data[33]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[33] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[33] + "' != '" + 33 + "'", + value.equals(BigInteger.valueOf(33L))); } else { value = value.longValue(); - expected = 1L; + expected = 33L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[34]; + value = msg.signature.data[34]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[34] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[34] + "' != '" + 34 + "'", + value.equals(BigInteger.valueOf(34L))); } else { value = value.longValue(); - expected = 2L; + expected = 34L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[35]; + value = msg.signature.data[35]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[35] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[35] + "' != '" + 35 + "'", + value.equals(BigInteger.valueOf(35L))); } else { value = value.longValue(); - expected = 3L; + expected = 35L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[36]; + value = msg.signature.data[36]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[36] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[36] + "' != '" + 36 + "'", + value.equals(BigInteger.valueOf(36L))); } else { value = value.longValue(); - expected = 4L; + expected = 36L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[37]; + value = msg.signature.data[37]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[37] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[37] + "' != '" + 37 + "'", + value.equals(BigInteger.valueOf(37L))); } else { value = value.longValue(); - expected = 5L; + expected = 37L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[38]; + value = msg.signature.data[38]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[38] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[38] + "' != '" + 38 + "'", + value.equals(BigInteger.valueOf(38L))); } else { value = value.longValue(); - expected = 6L; + expected = 38L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[39]; + value = msg.signature.data[39]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[39] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[39] + "' != '" + 39 + "'", + value.equals(BigInteger.valueOf(39L))); } else { value = value.longValue(); - expected = 7L; + expected = 39L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[40]; + value = msg.signature.data[40]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[40] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[40] + "' != '" + 40 + "'", + value.equals(BigInteger.valueOf(40L))); } else { value = value.longValue(); - expected = 0L; + expected = 40L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[41]; + value = msg.signature.data[41]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[41] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[41] + "' != '" + 41 + "'", + value.equals(BigInteger.valueOf(41L))); } else { value = value.longValue(); - expected = 1L; + expected = 41L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[42]; + value = msg.signature.data[42]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[42] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[42] + "' != '" + 42 + "'", + value.equals(BigInteger.valueOf(42L))); } else { value = value.longValue(); - expected = 2L; + expected = 42L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[43]; + value = msg.signature.data[43]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[43] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[43] + "' != '" + 43 + "'", + value.equals(BigInteger.valueOf(43L))); } else { value = value.longValue(); - expected = 3L; + expected = 43L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[44]; + value = msg.signature.data[44]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[44] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[44] + "' != '" + 44 + "'", + value.equals(BigInteger.valueOf(44L))); } else { value = value.longValue(); - expected = 4L; + expected = 44L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[45]; + value = msg.signature.data[45]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[45] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[45] + "' != '" + 45 + "'", + value.equals(BigInteger.valueOf(45L))); } else { value = value.longValue(); - expected = 5L; + expected = 45L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[46]; + value = msg.signature.data[46]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[46] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[46] + "' != '" + 46 + "'", + value.equals(BigInteger.valueOf(46L))); } else { value = value.longValue(); - expected = 6L; + expected = 46L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[47]; + value = msg.signature.data[47]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[47] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[47] + "' != '" + 47 + "'", + value.equals(BigInteger.valueOf(47L))); } else { value = value.longValue(); - expected = 7L; + expected = 47L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[48]; + value = msg.signature.data[48]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[48] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[48] + "' != '" + 48 + "'", + value.equals(BigInteger.valueOf(48L))); } else { value = value.longValue(); - expected = 0L; + expected = 48L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[49]; + value = msg.signature.data[49]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[49] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[49] + "' != '" + 49 + "'", + value.equals(BigInteger.valueOf(49L))); } else { value = value.longValue(); - expected = 1L; + expected = 49L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[50]; + value = msg.signature.data[50]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[50] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[50] + "' != '" + 50 + "'", + value.equals(BigInteger.valueOf(50L))); } else { value = value.longValue(); - expected = 2L; + expected = 50L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[51]; + value = msg.signature.data[51]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[51] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[51] + "' != '" + 51 + "'", + value.equals(BigInteger.valueOf(51L))); } else { value = value.longValue(); - expected = 3L; + expected = 51L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[52]; + value = msg.signature.data[52]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[52] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[52] + "' != '" + 52 + "'", + value.equals(BigInteger.valueOf(52L))); } else { value = value.longValue(); - expected = 4L; + expected = 52L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[53]; + value = msg.signature.data[53]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[53] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[53] + "' != '" + 53 + "'", + value.equals(BigInteger.valueOf(53L))); } else { value = value.longValue(); - expected = 5L; + expected = 53L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[54]; + value = msg.signature.data[54]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[54] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[54] + "' != '" + 54 + "'", + value.equals(BigInteger.valueOf(54L))); } else { value = value.longValue(); - expected = 6L; + expected = 54L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[55]; + value = msg.signature.data[55]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[55] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[55] + "' != '" + 55 + "'", + value.equals(BigInteger.valueOf(55L))); } else { value = value.longValue(); - expected = 7L; + expected = 55L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[56]; + value = msg.signature.data[56]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[56] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); + "'" + msg.signature.data[56] + "' != '" + 56 + "'", + value.equals(BigInteger.valueOf(56L))); } else { value = value.longValue(); - expected = 0L; + expected = 56L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[57]; + value = msg.signature.data[57]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[57] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); + "'" + msg.signature.data[57] + "' != '" + 57 + "'", + value.equals(BigInteger.valueOf(57L))); } else { value = value.longValue(); - expected = 1L; + expected = 57L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[58]; + value = msg.signature.data[58]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[58] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); + "'" + msg.signature.data[58] + "' != '" + 58 + "'", + value.equals(BigInteger.valueOf(58L))); } else { value = value.longValue(); - expected = 2L; + expected = 58L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[59]; + value = msg.signature.data[59]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[59] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); + "'" + msg.signature.data[59] + "' != '" + 59 + "'", + value.equals(BigInteger.valueOf(59L))); } else { value = value.longValue(); - expected = 3L; + expected = 59L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[60]; + value = msg.signature.data[60]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[60] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); + "'" + msg.signature.data[60] + "' != '" + 60 + "'", + value.equals(BigInteger.valueOf(60L))); } else { value = value.longValue(); - expected = 4L; + expected = 60L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[61]; + value = msg.signature.data[61]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[61] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); + "'" + msg.signature.data[61] + "' != '" + 61 + "'", + value.equals(BigInteger.valueOf(61L))); } else { value = value.longValue(); - expected = 5L; + expected = 61L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[62]; + value = msg.signature.data[62]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[62] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); + "'" + msg.signature.data[62] + "' != '" + 62 + "'", + value.equals(BigInteger.valueOf(62L))); } else { value = value.longValue(); - expected = 6L; + expected = 62L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[63]; + value = msg.signature.data[63]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[63] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); + "'" + msg.signature.data[63] + "' != '" + 63 + "'", + value.equals(BigInteger.valueOf(63L))); } else { value = value.longValue(); - expected = 7L; + expected = 63L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[64]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[64] + "' != '" + 64 + "'", + value.equals(BigInteger.valueOf(64L))); + } else { + value = value.longValue(); + expected = 64L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[65]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[65] + "' != '" + 65 + "'", + value.equals(BigInteger.valueOf(65L))); + } else { + value = value.longValue(); + expected = 65L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[66]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[66] + "' != '" + 66 + "'", + value.equals(BigInteger.valueOf(66L))); + } else { + value = value.longValue(); + expected = 66L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[67]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[67] + "' != '" + 67 + "'", + value.equals(BigInteger.valueOf(67L))); + } else { + value = value.longValue(); + expected = 67L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[68]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[68] + "' != '" + 68 + "'", + value.equals(BigInteger.valueOf(68L))); + } else { + value = value.longValue(); + expected = 68L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[69]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[69] + "' != '" + 69 + "'", + value.equals(BigInteger.valueOf(69L))); + } else { + value = value.longValue(); + expected = 69L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[70]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[70] + "' != '" + 70 + "'", + value.equals(BigInteger.valueOf(70L))); + } else { + value = value.longValue(); + expected = 70L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.data[71]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.data[71] + "' != '" + 71 + "'", + value.equals(BigInteger.valueOf(71L))); + } else { + value = value.longValue(); + expected = 71L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature.len; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.len + "' != '" + 72 + "'", + value.equals(BigInteger.valueOf(72L))); + } else { + value = value.longValue(); + expected = 72L; org.junit.Assert.assertEquals(value, expected); } diff --git a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepATest.java b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepATest.java new file mode 100644 index 0000000000..22f1c1b3b0 --- /dev/null +++ b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepATest.java @@ -0,0 +1,2848 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.test; + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not +// modify by hand! + + +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.signing.MsgEcdsaSignatureDepA; +import java.math.BigInteger; +import org.json.JSONObject; +import org.junit.Test; + +public class auto_check_sbp_signing_MsgEcdsaSignatureDepATest { + + public static boolean debug = false; + private static final double DELTA = 1e-15; + + @Test + public void test1() throws Throwable { + if (debug) + System.out.format("%n%s%n", "auto_check_sbp_signing_MsgEcdsaSignatureDepATest.test1"); + byte[] payload = + new byte[] { + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 0, + (byte) 1, + (byte) 2, + (byte) 3, + (byte) 4, + (byte) 5, + (byte) 6, + (byte) 7, + (byte) 10, + (byte) 21, + (byte) 23, + (byte) 63, + (byte) 140, + (byte) 37, + (byte) 130, + (byte) 106, + (byte) 28, + (byte) 40, + (byte) 165, + (byte) 179, + (byte) 73, + (byte) 178, + (byte) 60, + (byte) 126, + (byte) 114, + (byte) 78, + (byte) 113, + (byte) 27, + (byte) 95, + (byte) 3, + (byte) 62, + (byte) 104, + (byte) 145, + (byte) 96, + (byte) 19, + (byte) 92, + (byte) 123, + (byte) 14, + (byte) 90, + (byte) 153, + (byte) 183, + (byte) 9, + (byte) 72, + (byte) 81, + (byte) 118, + (byte) 112, + (byte) 124, + (byte) 16, + (byte) 182, + (byte) 76, + (byte) 146, + (byte) 115, + (byte) 58, + (byte) 144, + (byte) 17, + (byte) 105, + (byte) 66, + (byte) 31, + (byte) 135, + (byte) 54, + (byte) 100, + (byte) 84, + (byte) 181, + (byte) 103, + (byte) 11, + (byte) 88, + (byte) 133, + (byte) 155, + (byte) 167, + (byte) 173, + (byte) 143, + (byte) 86, + (byte) 158, + (byte) 20, + (byte) 168, + (byte) 132, + (byte) 141, + (byte) 102, + (byte) 50, + (byte) 48, + (byte) 71, + (byte) 147, + (byte) 53, + (byte) 87, + (byte) 1, + (byte) 108, + (byte) 138, + (byte) 36, + (byte) 134, + (byte) 139, + (byte) 163, + (byte) 82, + (byte) 43, + (byte) 52, + (byte) 150, + (byte) 12, + (byte) 30, + (byte) 110, + (byte) 156, + (byte) 107, + (byte) 120, + (byte) 91, + (byte) 122, + (byte) 69, + (byte) 164, + (byte) 170, + (byte) 116, + (byte) 25, + (byte) 94, + (byte) 5, + (byte) 22, + (byte) 24, + (byte) 162, + (byte) 175, + (byte) 38, + (byte) 157, + (byte) 98, + (byte) 44, + (byte) 160, + (byte) 47, + (byte) 97, + (byte) 142, + (byte) 8, + (byte) 74, + (byte) 13, + (byte) 177, + (byte) 15, + (byte) 128, + (byte) 26, + (byte) 131, + (byte) 154, + (byte) 65, + (byte) 169, + (byte) 55, + (byte) 136, + (byte) 125, + (byte) 171, + (byte) 161, + (byte) 29, + (byte) 129, + (byte) 151, + (byte) 68, + (byte) 166, + (byte) 51, + (byte) 70, + (byte) 45, + (byte) 56, + (byte) 79, + (byte) 149, + (byte) 99, + (byte) 42, + (byte) 101, + (byte) 152, + (byte) 39, + (byte) 89, + (byte) 180, + (byte) 64, + (byte) 49, + (byte) 6, + (byte) 80, + (byte) 172, + (byte) 32, + (byte) 109, + (byte) 2, + (byte) 119, + (byte) 93, + (byte) 176, + (byte) 0, + (byte) 33, + (byte) 57, + (byte) 34, + (byte) 18, + (byte) 85, + (byte) 121, + (byte) 137, + (byte) 83, + (byte) 111, + (byte) 59, + (byte) 7, + (byte) 77, + (byte) 4, + (byte) 117, + (byte) 159, + (byte) 148, + (byte) 35, + (byte) 61, + (byte) 41, + (byte) 67, + (byte) 46, + (byte) 127, + (byte) 75, + (byte) 174, + }; + SBPMessage sbp = new SBPMessage(0x42, 0xC06, payload); + MsgEcdsaSignatureDepA msg = new MsgEcdsaSignatureDepA(sbp); + JSONObject json = msg.toJSON(); + Number value; + Number expected; + value = msg.certificate_id[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[0] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[1] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[2] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[3] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.flags; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.flags + "' != '" + 0 + "'", value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.on_demand_counter; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.on_demand_counter + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[0] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[1] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[2] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[3] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[4] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[5] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[6] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[7] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[8] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[9] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[10] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[11] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[12] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[13] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[14] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[15] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[16] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[17] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[18] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[19] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[20]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[20] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[21]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[21] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[22]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[22] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[23]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[23] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[24]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[24] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[25]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[25] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[26]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[26] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[27]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[27] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[28]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[28] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[29]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[29] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[30]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[30] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[31]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[31] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[32]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[32] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[33]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[33] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[34]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[34] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[35]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[35] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[36]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[36] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[37]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[37] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[38]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[38] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[39]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[39] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[40]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[40] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[41]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[41] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[42]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[42] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[43]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[43] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[44]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[44] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[45]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[45] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[46]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[46] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[47]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[47] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[48]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[48] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[49]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[49] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[50]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[50] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[51]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[51] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[52]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[52] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[53]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[53] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[54]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[54] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[55]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[55] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[56]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[56] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[57]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[57] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[58]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[58] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[59]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[59] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[60]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[60] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[61]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[61] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[62]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[62] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[63]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[63] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[0] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[1] + "' != '" + 21 + "'", + value.equals(BigInteger.valueOf(21L))); + } else { + value = value.longValue(); + expected = 21L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[2] + "' != '" + 23 + "'", + value.equals(BigInteger.valueOf(23L))); + } else { + value = value.longValue(); + expected = 23L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[3] + "' != '" + 63 + "'", + value.equals(BigInteger.valueOf(63L))); + } else { + value = value.longValue(); + expected = 63L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[4] + "' != '" + 140 + "'", + value.equals(BigInteger.valueOf(140L))); + } else { + value = value.longValue(); + expected = 140L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[5] + "' != '" + 37 + "'", + value.equals(BigInteger.valueOf(37L))); + } else { + value = value.longValue(); + expected = 37L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[6] + "' != '" + 130 + "'", + value.equals(BigInteger.valueOf(130L))); + } else { + value = value.longValue(); + expected = 130L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[7] + "' != '" + 106 + "'", + value.equals(BigInteger.valueOf(106L))); + } else { + value = value.longValue(); + expected = 106L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[8] + "' != '" + 28 + "'", + value.equals(BigInteger.valueOf(28L))); + } else { + value = value.longValue(); + expected = 28L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[9] + "' != '" + 40 + "'", + value.equals(BigInteger.valueOf(40L))); + } else { + value = value.longValue(); + expected = 40L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[10] + "' != '" + 165 + "'", + value.equals(BigInteger.valueOf(165L))); + } else { + value = value.longValue(); + expected = 165L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[11] + "' != '" + 179 + "'", + value.equals(BigInteger.valueOf(179L))); + } else { + value = value.longValue(); + expected = 179L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[12] + "' != '" + 73 + "'", + value.equals(BigInteger.valueOf(73L))); + } else { + value = value.longValue(); + expected = 73L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[13] + "' != '" + 178 + "'", + value.equals(BigInteger.valueOf(178L))); + } else { + value = value.longValue(); + expected = 178L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[14] + "' != '" + 60 + "'", + value.equals(BigInteger.valueOf(60L))); + } else { + value = value.longValue(); + expected = 60L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[15] + "' != '" + 126 + "'", + value.equals(BigInteger.valueOf(126L))); + } else { + value = value.longValue(); + expected = 126L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[16] + "' != '" + 114 + "'", + value.equals(BigInteger.valueOf(114L))); + } else { + value = value.longValue(); + expected = 114L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[17] + "' != '" + 78 + "'", + value.equals(BigInteger.valueOf(78L))); + } else { + value = value.longValue(); + expected = 78L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[18] + "' != '" + 113 + "'", + value.equals(BigInteger.valueOf(113L))); + } else { + value = value.longValue(); + expected = 113L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[19] + "' != '" + 27 + "'", + value.equals(BigInteger.valueOf(27L))); + } else { + value = value.longValue(); + expected = 27L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[20]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[20] + "' != '" + 95 + "'", + value.equals(BigInteger.valueOf(95L))); + } else { + value = value.longValue(); + expected = 95L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[21]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[21] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[22]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[22] + "' != '" + 62 + "'", + value.equals(BigInteger.valueOf(62L))); + } else { + value = value.longValue(); + expected = 62L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[23]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[23] + "' != '" + 104 + "'", + value.equals(BigInteger.valueOf(104L))); + } else { + value = value.longValue(); + expected = 104L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[24]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[24] + "' != '" + 145 + "'", + value.equals(BigInteger.valueOf(145L))); + } else { + value = value.longValue(); + expected = 145L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[25]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[25] + "' != '" + 96 + "'", + value.equals(BigInteger.valueOf(96L))); + } else { + value = value.longValue(); + expected = 96L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[26]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[26] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); + } else { + value = value.longValue(); + expected = 19L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[27]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[27] + "' != '" + 92 + "'", + value.equals(BigInteger.valueOf(92L))); + } else { + value = value.longValue(); + expected = 92L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[28]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[28] + "' != '" + 123 + "'", + value.equals(BigInteger.valueOf(123L))); + } else { + value = value.longValue(); + expected = 123L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[29]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[29] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); + } else { + value = value.longValue(); + expected = 14L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[30]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[30] + "' != '" + 90 + "'", + value.equals(BigInteger.valueOf(90L))); + } else { + value = value.longValue(); + expected = 90L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[31]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[31] + "' != '" + 153 + "'", + value.equals(BigInteger.valueOf(153L))); + } else { + value = value.longValue(); + expected = 153L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[32]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[32] + "' != '" + 183 + "'", + value.equals(BigInteger.valueOf(183L))); + } else { + value = value.longValue(); + expected = 183L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[33]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[33] + "' != '" + 9 + "'", + value.equals(BigInteger.valueOf(9L))); + } else { + value = value.longValue(); + expected = 9L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[34]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[34] + "' != '" + 72 + "'", + value.equals(BigInteger.valueOf(72L))); + } else { + value = value.longValue(); + expected = 72L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[35]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[35] + "' != '" + 81 + "'", + value.equals(BigInteger.valueOf(81L))); + } else { + value = value.longValue(); + expected = 81L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[36]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[36] + "' != '" + 118 + "'", + value.equals(BigInteger.valueOf(118L))); + } else { + value = value.longValue(); + expected = 118L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[37]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[37] + "' != '" + 112 + "'", + value.equals(BigInteger.valueOf(112L))); + } else { + value = value.longValue(); + expected = 112L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[38]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[38] + "' != '" + 124 + "'", + value.equals(BigInteger.valueOf(124L))); + } else { + value = value.longValue(); + expected = 124L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[39]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[39] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); + } else { + value = value.longValue(); + expected = 16L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[40]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[40] + "' != '" + 182 + "'", + value.equals(BigInteger.valueOf(182L))); + } else { + value = value.longValue(); + expected = 182L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[41]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[41] + "' != '" + 76 + "'", + value.equals(BigInteger.valueOf(76L))); + } else { + value = value.longValue(); + expected = 76L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[42]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[42] + "' != '" + 146 + "'", + value.equals(BigInteger.valueOf(146L))); + } else { + value = value.longValue(); + expected = 146L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[43]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[43] + "' != '" + 115 + "'", + value.equals(BigInteger.valueOf(115L))); + } else { + value = value.longValue(); + expected = 115L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[44]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[44] + "' != '" + 58 + "'", + value.equals(BigInteger.valueOf(58L))); + } else { + value = value.longValue(); + expected = 58L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[45]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[45] + "' != '" + 144 + "'", + value.equals(BigInteger.valueOf(144L))); + } else { + value = value.longValue(); + expected = 144L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[46]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[46] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); + } else { + value = value.longValue(); + expected = 17L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[47]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[47] + "' != '" + 105 + "'", + value.equals(BigInteger.valueOf(105L))); + } else { + value = value.longValue(); + expected = 105L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[48]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[48] + "' != '" + 66 + "'", + value.equals(BigInteger.valueOf(66L))); + } else { + value = value.longValue(); + expected = 66L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[49]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[49] + "' != '" + 31 + "'", + value.equals(BigInteger.valueOf(31L))); + } else { + value = value.longValue(); + expected = 31L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[50]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[50] + "' != '" + 135 + "'", + value.equals(BigInteger.valueOf(135L))); + } else { + value = value.longValue(); + expected = 135L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[51]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[51] + "' != '" + 54 + "'", + value.equals(BigInteger.valueOf(54L))); + } else { + value = value.longValue(); + expected = 54L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[52]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[52] + "' != '" + 100 + "'", + value.equals(BigInteger.valueOf(100L))); + } else { + value = value.longValue(); + expected = 100L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[53]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[53] + "' != '" + 84 + "'", + value.equals(BigInteger.valueOf(84L))); + } else { + value = value.longValue(); + expected = 84L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[54]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[54] + "' != '" + 181 + "'", + value.equals(BigInteger.valueOf(181L))); + } else { + value = value.longValue(); + expected = 181L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[55]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[55] + "' != '" + 103 + "'", + value.equals(BigInteger.valueOf(103L))); + } else { + value = value.longValue(); + expected = 103L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[56]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[56] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); + } else { + value = value.longValue(); + expected = 11L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[57]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[57] + "' != '" + 88 + "'", + value.equals(BigInteger.valueOf(88L))); + } else { + value = value.longValue(); + expected = 88L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[58]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[58] + "' != '" + 133 + "'", + value.equals(BigInteger.valueOf(133L))); + } else { + value = value.longValue(); + expected = 133L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[59]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[59] + "' != '" + 155 + "'", + value.equals(BigInteger.valueOf(155L))); + } else { + value = value.longValue(); + expected = 155L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[60]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[60] + "' != '" + 167 + "'", + value.equals(BigInteger.valueOf(167L))); + } else { + value = value.longValue(); + expected = 167L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[61]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[61] + "' != '" + 173 + "'", + value.equals(BigInteger.valueOf(173L))); + } else { + value = value.longValue(); + expected = 173L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[62]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[62] + "' != '" + 143 + "'", + value.equals(BigInteger.valueOf(143L))); + } else { + value = value.longValue(); + expected = 143L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[63]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[63] + "' != '" + 86 + "'", + value.equals(BigInteger.valueOf(86L))); + } else { + value = value.longValue(); + expected = 86L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[64]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[64] + "' != '" + 158 + "'", + value.equals(BigInteger.valueOf(158L))); + } else { + value = value.longValue(); + expected = 158L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[65]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[65] + "' != '" + 20 + "'", + value.equals(BigInteger.valueOf(20L))); + } else { + value = value.longValue(); + expected = 20L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[66]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[66] + "' != '" + 168 + "'", + value.equals(BigInteger.valueOf(168L))); + } else { + value = value.longValue(); + expected = 168L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[67]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[67] + "' != '" + 132 + "'", + value.equals(BigInteger.valueOf(132L))); + } else { + value = value.longValue(); + expected = 132L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[68]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[68] + "' != '" + 141 + "'", + value.equals(BigInteger.valueOf(141L))); + } else { + value = value.longValue(); + expected = 141L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[69]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[69] + "' != '" + 102 + "'", + value.equals(BigInteger.valueOf(102L))); + } else { + value = value.longValue(); + expected = 102L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[70]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[70] + "' != '" + 50 + "'", + value.equals(BigInteger.valueOf(50L))); + } else { + value = value.longValue(); + expected = 50L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[71]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[71] + "' != '" + 48 + "'", + value.equals(BigInteger.valueOf(48L))); + } else { + value = value.longValue(); + expected = 48L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[72]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[72] + "' != '" + 71 + "'", + value.equals(BigInteger.valueOf(71L))); + } else { + value = value.longValue(); + expected = 71L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[73]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[73] + "' != '" + 147 + "'", + value.equals(BigInteger.valueOf(147L))); + } else { + value = value.longValue(); + expected = 147L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[74]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[74] + "' != '" + 53 + "'", + value.equals(BigInteger.valueOf(53L))); + } else { + value = value.longValue(); + expected = 53L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[75]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[75] + "' != '" + 87 + "'", + value.equals(BigInteger.valueOf(87L))); + } else { + value = value.longValue(); + expected = 87L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[76]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[76] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[77]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[77] + "' != '" + 108 + "'", + value.equals(BigInteger.valueOf(108L))); + } else { + value = value.longValue(); + expected = 108L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[78]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[78] + "' != '" + 138 + "'", + value.equals(BigInteger.valueOf(138L))); + } else { + value = value.longValue(); + expected = 138L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[79]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[79] + "' != '" + 36 + "'", + value.equals(BigInteger.valueOf(36L))); + } else { + value = value.longValue(); + expected = 36L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[80]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[80] + "' != '" + 134 + "'", + value.equals(BigInteger.valueOf(134L))); + } else { + value = value.longValue(); + expected = 134L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[81]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[81] + "' != '" + 139 + "'", + value.equals(BigInteger.valueOf(139L))); + } else { + value = value.longValue(); + expected = 139L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[82]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[82] + "' != '" + 163 + "'", + value.equals(BigInteger.valueOf(163L))); + } else { + value = value.longValue(); + expected = 163L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[83]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[83] + "' != '" + 82 + "'", + value.equals(BigInteger.valueOf(82L))); + } else { + value = value.longValue(); + expected = 82L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[84]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[84] + "' != '" + 43 + "'", + value.equals(BigInteger.valueOf(43L))); + } else { + value = value.longValue(); + expected = 43L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[85]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[85] + "' != '" + 52 + "'", + value.equals(BigInteger.valueOf(52L))); + } else { + value = value.longValue(); + expected = 52L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[86]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[86] + "' != '" + 150 + "'", + value.equals(BigInteger.valueOf(150L))); + } else { + value = value.longValue(); + expected = 150L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[87]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[87] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[88]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[88] + "' != '" + 30 + "'", + value.equals(BigInteger.valueOf(30L))); + } else { + value = value.longValue(); + expected = 30L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[89]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[89] + "' != '" + 110 + "'", + value.equals(BigInteger.valueOf(110L))); + } else { + value = value.longValue(); + expected = 110L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[90]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[90] + "' != '" + 156 + "'", + value.equals(BigInteger.valueOf(156L))); + } else { + value = value.longValue(); + expected = 156L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[91]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[91] + "' != '" + 107 + "'", + value.equals(BigInteger.valueOf(107L))); + } else { + value = value.longValue(); + expected = 107L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[92]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[92] + "' != '" + 120 + "'", + value.equals(BigInteger.valueOf(120L))); + } else { + value = value.longValue(); + expected = 120L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[93]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[93] + "' != '" + 91 + "'", + value.equals(BigInteger.valueOf(91L))); + } else { + value = value.longValue(); + expected = 91L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[94]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[94] + "' != '" + 122 + "'", + value.equals(BigInteger.valueOf(122L))); + } else { + value = value.longValue(); + expected = 122L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[95]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[95] + "' != '" + 69 + "'", + value.equals(BigInteger.valueOf(69L))); + } else { + value = value.longValue(); + expected = 69L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[96]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[96] + "' != '" + 164 + "'", + value.equals(BigInteger.valueOf(164L))); + } else { + value = value.longValue(); + expected = 164L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[97]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[97] + "' != '" + 170 + "'", + value.equals(BigInteger.valueOf(170L))); + } else { + value = value.longValue(); + expected = 170L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[98]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[98] + "' != '" + 116 + "'", + value.equals(BigInteger.valueOf(116L))); + } else { + value = value.longValue(); + expected = 116L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[99]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[99] + "' != '" + 25 + "'", + value.equals(BigInteger.valueOf(25L))); + } else { + value = value.longValue(); + expected = 25L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[100]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[100] + "' != '" + 94 + "'", + value.equals(BigInteger.valueOf(94L))); + } else { + value = value.longValue(); + expected = 94L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[101]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[101] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[102]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[102] + "' != '" + 22 + "'", + value.equals(BigInteger.valueOf(22L))); + } else { + value = value.longValue(); + expected = 22L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[103]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[103] + "' != '" + 24 + "'", + value.equals(BigInteger.valueOf(24L))); + } else { + value = value.longValue(); + expected = 24L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[104]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[104] + "' != '" + 162 + "'", + value.equals(BigInteger.valueOf(162L))); + } else { + value = value.longValue(); + expected = 162L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[105]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[105] + "' != '" + 175 + "'", + value.equals(BigInteger.valueOf(175L))); + } else { + value = value.longValue(); + expected = 175L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[106]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[106] + "' != '" + 38 + "'", + value.equals(BigInteger.valueOf(38L))); + } else { + value = value.longValue(); + expected = 38L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[107]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[107] + "' != '" + 157 + "'", + value.equals(BigInteger.valueOf(157L))); + } else { + value = value.longValue(); + expected = 157L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[108]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[108] + "' != '" + 98 + "'", + value.equals(BigInteger.valueOf(98L))); + } else { + value = value.longValue(); + expected = 98L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[109]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[109] + "' != '" + 44 + "'", + value.equals(BigInteger.valueOf(44L))); + } else { + value = value.longValue(); + expected = 44L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[110]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[110] + "' != '" + 160 + "'", + value.equals(BigInteger.valueOf(160L))); + } else { + value = value.longValue(); + expected = 160L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[111]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[111] + "' != '" + 47 + "'", + value.equals(BigInteger.valueOf(47L))); + } else { + value = value.longValue(); + expected = 47L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[112]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[112] + "' != '" + 97 + "'", + value.equals(BigInteger.valueOf(97L))); + } else { + value = value.longValue(); + expected = 97L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[113]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[113] + "' != '" + 142 + "'", + value.equals(BigInteger.valueOf(142L))); + } else { + value = value.longValue(); + expected = 142L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[114]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[114] + "' != '" + 8 + "'", + value.equals(BigInteger.valueOf(8L))); + } else { + value = value.longValue(); + expected = 8L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[115]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[115] + "' != '" + 74 + "'", + value.equals(BigInteger.valueOf(74L))); + } else { + value = value.longValue(); + expected = 74L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[116]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[116] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); + } else { + value = value.longValue(); + expected = 13L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[117]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[117] + "' != '" + 177 + "'", + value.equals(BigInteger.valueOf(177L))); + } else { + value = value.longValue(); + expected = 177L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[118]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[118] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); + } else { + value = value.longValue(); + expected = 15L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[119]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[119] + "' != '" + 128 + "'", + value.equals(BigInteger.valueOf(128L))); + } else { + value = value.longValue(); + expected = 128L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[120]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[120] + "' != '" + 26 + "'", + value.equals(BigInteger.valueOf(26L))); + } else { + value = value.longValue(); + expected = 26L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[121]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[121] + "' != '" + 131 + "'", + value.equals(BigInteger.valueOf(131L))); + } else { + value = value.longValue(); + expected = 131L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[122]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[122] + "' != '" + 154 + "'", + value.equals(BigInteger.valueOf(154L))); + } else { + value = value.longValue(); + expected = 154L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[123]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[123] + "' != '" + 65 + "'", + value.equals(BigInteger.valueOf(65L))); + } else { + value = value.longValue(); + expected = 65L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[124]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[124] + "' != '" + 169 + "'", + value.equals(BigInteger.valueOf(169L))); + } else { + value = value.longValue(); + expected = 169L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[125]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[125] + "' != '" + 55 + "'", + value.equals(BigInteger.valueOf(55L))); + } else { + value = value.longValue(); + expected = 55L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[126]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[126] + "' != '" + 136 + "'", + value.equals(BigInteger.valueOf(136L))); + } else { + value = value.longValue(); + expected = 136L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[127]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[127] + "' != '" + 125 + "'", + value.equals(BigInteger.valueOf(125L))); + } else { + value = value.longValue(); + expected = 125L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[128]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[128] + "' != '" + 171 + "'", + value.equals(BigInteger.valueOf(171L))); + } else { + value = value.longValue(); + expected = 171L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[129]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[129] + "' != '" + 161 + "'", + value.equals(BigInteger.valueOf(161L))); + } else { + value = value.longValue(); + expected = 161L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[130]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[130] + "' != '" + 29 + "'", + value.equals(BigInteger.valueOf(29L))); + } else { + value = value.longValue(); + expected = 29L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[131]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[131] + "' != '" + 129 + "'", + value.equals(BigInteger.valueOf(129L))); + } else { + value = value.longValue(); + expected = 129L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[132]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[132] + "' != '" + 151 + "'", + value.equals(BigInteger.valueOf(151L))); + } else { + value = value.longValue(); + expected = 151L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[133]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[133] + "' != '" + 68 + "'", + value.equals(BigInteger.valueOf(68L))); + } else { + value = value.longValue(); + expected = 68L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[134]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[134] + "' != '" + 166 + "'", + value.equals(BigInteger.valueOf(166L))); + } else { + value = value.longValue(); + expected = 166L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[135]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[135] + "' != '" + 51 + "'", + value.equals(BigInteger.valueOf(51L))); + } else { + value = value.longValue(); + expected = 51L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[136]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[136] + "' != '" + 70 + "'", + value.equals(BigInteger.valueOf(70L))); + } else { + value = value.longValue(); + expected = 70L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[137]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[137] + "' != '" + 45 + "'", + value.equals(BigInteger.valueOf(45L))); + } else { + value = value.longValue(); + expected = 45L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[138]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[138] + "' != '" + 56 + "'", + value.equals(BigInteger.valueOf(56L))); + } else { + value = value.longValue(); + expected = 56L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[139]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[139] + "' != '" + 79 + "'", + value.equals(BigInteger.valueOf(79L))); + } else { + value = value.longValue(); + expected = 79L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[140]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[140] + "' != '" + 149 + "'", + value.equals(BigInteger.valueOf(149L))); + } else { + value = value.longValue(); + expected = 149L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[141]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[141] + "' != '" + 99 + "'", + value.equals(BigInteger.valueOf(99L))); + } else { + value = value.longValue(); + expected = 99L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[142]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[142] + "' != '" + 42 + "'", + value.equals(BigInteger.valueOf(42L))); + } else { + value = value.longValue(); + expected = 42L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[143]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[143] + "' != '" + 101 + "'", + value.equals(BigInteger.valueOf(101L))); + } else { + value = value.longValue(); + expected = 101L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[144]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[144] + "' != '" + 152 + "'", + value.equals(BigInteger.valueOf(152L))); + } else { + value = value.longValue(); + expected = 152L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[145]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[145] + "' != '" + 39 + "'", + value.equals(BigInteger.valueOf(39L))); + } else { + value = value.longValue(); + expected = 39L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[146]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[146] + "' != '" + 89 + "'", + value.equals(BigInteger.valueOf(89L))); + } else { + value = value.longValue(); + expected = 89L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[147]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[147] + "' != '" + 180 + "'", + value.equals(BigInteger.valueOf(180L))); + } else { + value = value.longValue(); + expected = 180L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[148]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[148] + "' != '" + 64 + "'", + value.equals(BigInteger.valueOf(64L))); + } else { + value = value.longValue(); + expected = 64L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[149]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[149] + "' != '" + 49 + "'", + value.equals(BigInteger.valueOf(49L))); + } else { + value = value.longValue(); + expected = 49L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[150]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[150] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[151]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[151] + "' != '" + 80 + "'", + value.equals(BigInteger.valueOf(80L))); + } else { + value = value.longValue(); + expected = 80L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[152]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[152] + "' != '" + 172 + "'", + value.equals(BigInteger.valueOf(172L))); + } else { + value = value.longValue(); + expected = 172L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[153]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[153] + "' != '" + 32 + "'", + value.equals(BigInteger.valueOf(32L))); + } else { + value = value.longValue(); + expected = 32L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[154]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[154] + "' != '" + 109 + "'", + value.equals(BigInteger.valueOf(109L))); + } else { + value = value.longValue(); + expected = 109L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[155]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[155] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[156]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[156] + "' != '" + 119 + "'", + value.equals(BigInteger.valueOf(119L))); + } else { + value = value.longValue(); + expected = 119L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[157]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[157] + "' != '" + 93 + "'", + value.equals(BigInteger.valueOf(93L))); + } else { + value = value.longValue(); + expected = 93L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[158]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[158] + "' != '" + 176 + "'", + value.equals(BigInteger.valueOf(176L))); + } else { + value = value.longValue(); + expected = 176L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[159]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[159] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[160]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[160] + "' != '" + 33 + "'", + value.equals(BigInteger.valueOf(33L))); + } else { + value = value.longValue(); + expected = 33L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[161]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[161] + "' != '" + 57 + "'", + value.equals(BigInteger.valueOf(57L))); + } else { + value = value.longValue(); + expected = 57L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[162]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[162] + "' != '" + 34 + "'", + value.equals(BigInteger.valueOf(34L))); + } else { + value = value.longValue(); + expected = 34L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[163]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[163] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); + } else { + value = value.longValue(); + expected = 18L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[164]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[164] + "' != '" + 85 + "'", + value.equals(BigInteger.valueOf(85L))); + } else { + value = value.longValue(); + expected = 85L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[165]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[165] + "' != '" + 121 + "'", + value.equals(BigInteger.valueOf(121L))); + } else { + value = value.longValue(); + expected = 121L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[166]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[166] + "' != '" + 137 + "'", + value.equals(BigInteger.valueOf(137L))); + } else { + value = value.longValue(); + expected = 137L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[167]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[167] + "' != '" + 83 + "'", + value.equals(BigInteger.valueOf(83L))); + } else { + value = value.longValue(); + expected = 83L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[168]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[168] + "' != '" + 111 + "'", + value.equals(BigInteger.valueOf(111L))); + } else { + value = value.longValue(); + expected = 111L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[169]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[169] + "' != '" + 59 + "'", + value.equals(BigInteger.valueOf(59L))); + } else { + value = value.longValue(); + expected = 59L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[170]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[170] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[171]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[171] + "' != '" + 77 + "'", + value.equals(BigInteger.valueOf(77L))); + } else { + value = value.longValue(); + expected = 77L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[172]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[172] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[173]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[173] + "' != '" + 117 + "'", + value.equals(BigInteger.valueOf(117L))); + } else { + value = value.longValue(); + expected = 117L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[174]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[174] + "' != '" + 159 + "'", + value.equals(BigInteger.valueOf(159L))); + } else { + value = value.longValue(); + expected = 159L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[175]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[175] + "' != '" + 148 + "'", + value.equals(BigInteger.valueOf(148L))); + } else { + value = value.longValue(); + expected = 148L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[176]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[176] + "' != '" + 35 + "'", + value.equals(BigInteger.valueOf(35L))); + } else { + value = value.longValue(); + expected = 35L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[177]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[177] + "' != '" + 61 + "'", + value.equals(BigInteger.valueOf(61L))); + } else { + value = value.longValue(); + expected = 61L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[178]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[178] + "' != '" + 41 + "'", + value.equals(BigInteger.valueOf(41L))); + } else { + value = value.longValue(); + expected = 41L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[179]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[179] + "' != '" + 67 + "'", + value.equals(BigInteger.valueOf(67L))); + } else { + value = value.longValue(); + expected = 67L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[180]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[180] + "' != '" + 46 + "'", + value.equals(BigInteger.valueOf(46L))); + } else { + value = value.longValue(); + expected = 46L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[181]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[181] + "' != '" + 127 + "'", + value.equals(BigInteger.valueOf(127L))); + } else { + value = value.longValue(); + expected = 127L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[182]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[182] + "' != '" + 75 + "'", + value.equals(BigInteger.valueOf(75L))); + } else { + value = value.longValue(); + expected = 75L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[183]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[183] + "' != '" + 174 + "'", + value.equals(BigInteger.valueOf(174L))); + } else { + value = value.longValue(); + expected = 174L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.stream_counter; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.stream_counter + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + + org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); + } +} diff --git a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepBTest.java b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepBTest.java new file mode 100644 index 0000000000..1a5af4ed8a --- /dev/null +++ b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepBTest.java @@ -0,0 +1,885 @@ +/* Copyright (C) 2015-2022 Swift Navigation Inc. + * Contact: https://support.swiftnav.com + * + * This source is subject to the license found in the file 'LICENSE' which must + * be be distributed together with this source. All other rights reserved. + * + * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + */ +package com.swiftnav.sbp.test; + +// This file was auto-generated from +// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not +// modify by hand! + + +import com.swiftnav.sbp.SBPMessage; +import com.swiftnav.sbp.signing.MsgEcdsaSignatureDepB; +import java.math.BigInteger; +import org.json.JSONObject; +import org.junit.Test; + +public class auto_check_sbp_signing_MsgEcdsaSignatureDepBTest { + + public static boolean debug = false; + private static final double DELTA = 1e-15; + + @Test + public void test1() throws Throwable { + if (debug) + System.out.format("%n%s%n", "auto_check_sbp_signing_MsgEcdsaSignatureDepBTest.test1"); + byte[] payload = + new byte[] { + (byte) 0, (byte) 1, (byte) 2, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 72, + (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, + (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) 12, (byte) 13, (byte) 14, + (byte) 15, (byte) 16, (byte) 17, (byte) 18, (byte) 19, (byte) 20, (byte) 21, + (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 27, (byte) 28, + (byte) 29, (byte) 30, (byte) 31, (byte) 32, (byte) 33, (byte) 34, (byte) 35, + (byte) 36, (byte) 37, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, + (byte) 43, (byte) 44, (byte) 45, (byte) 46, (byte) 47, (byte) 48, (byte) 49, + (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, + (byte) 57, (byte) 58, (byte) 59, (byte) 60, (byte) 61, (byte) 62, (byte) 63, + (byte) 64, (byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, + (byte) 71, (byte) 10, (byte) 21, (byte) 23, + }; + SBPMessage sbp = new SBPMessage(0x42, 0xC07, payload); + MsgEcdsaSignatureDepB msg = new MsgEcdsaSignatureDepB(sbp); + JSONObject json = msg.toJSON(); + Number value; + Number expected; + value = msg.certificate_id[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[0] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[1] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[2] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.certificate_id[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.certificate_id[3] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.flags; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.flags + "' != '" + 0 + "'", value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.n_signature_bytes; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.n_signature_bytes + "' != '" + 72 + "'", + value.equals(BigInteger.valueOf(72L))); + } else { + value = value.longValue(); + expected = 72L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.on_demand_counter; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.on_demand_counter + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[0] + "' != '" + 0 + "'", + value.equals(BigInteger.valueOf(0L))); + } else { + value = value.longValue(); + expected = 0L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[1] + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[2] + "' != '" + 2 + "'", + value.equals(BigInteger.valueOf(2L))); + } else { + value = value.longValue(); + expected = 2L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[3]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[3] + "' != '" + 3 + "'", + value.equals(BigInteger.valueOf(3L))); + } else { + value = value.longValue(); + expected = 3L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[4]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[4] + "' != '" + 4 + "'", + value.equals(BigInteger.valueOf(4L))); + } else { + value = value.longValue(); + expected = 4L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[5]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[5] + "' != '" + 5 + "'", + value.equals(BigInteger.valueOf(5L))); + } else { + value = value.longValue(); + expected = 5L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[6]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[6] + "' != '" + 6 + "'", + value.equals(BigInteger.valueOf(6L))); + } else { + value = value.longValue(); + expected = 6L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[7]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[7] + "' != '" + 7 + "'", + value.equals(BigInteger.valueOf(7L))); + } else { + value = value.longValue(); + expected = 7L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[8]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[8] + "' != '" + 8 + "'", + value.equals(BigInteger.valueOf(8L))); + } else { + value = value.longValue(); + expected = 8L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[9]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[9] + "' != '" + 9 + "'", + value.equals(BigInteger.valueOf(9L))); + } else { + value = value.longValue(); + expected = 9L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[10]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[10] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[11]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[11] + "' != '" + 11 + "'", + value.equals(BigInteger.valueOf(11L))); + } else { + value = value.longValue(); + expected = 11L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[12]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[12] + "' != '" + 12 + "'", + value.equals(BigInteger.valueOf(12L))); + } else { + value = value.longValue(); + expected = 12L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[13]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[13] + "' != '" + 13 + "'", + value.equals(BigInteger.valueOf(13L))); + } else { + value = value.longValue(); + expected = 13L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[14]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[14] + "' != '" + 14 + "'", + value.equals(BigInteger.valueOf(14L))); + } else { + value = value.longValue(); + expected = 14L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[15]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[15] + "' != '" + 15 + "'", + value.equals(BigInteger.valueOf(15L))); + } else { + value = value.longValue(); + expected = 15L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[16]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[16] + "' != '" + 16 + "'", + value.equals(BigInteger.valueOf(16L))); + } else { + value = value.longValue(); + expected = 16L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[17]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[17] + "' != '" + 17 + "'", + value.equals(BigInteger.valueOf(17L))); + } else { + value = value.longValue(); + expected = 17L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[18]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[18] + "' != '" + 18 + "'", + value.equals(BigInteger.valueOf(18L))); + } else { + value = value.longValue(); + expected = 18L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[19]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[19] + "' != '" + 19 + "'", + value.equals(BigInteger.valueOf(19L))); + } else { + value = value.longValue(); + expected = 19L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[20]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[20] + "' != '" + 20 + "'", + value.equals(BigInteger.valueOf(20L))); + } else { + value = value.longValue(); + expected = 20L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[21]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[21] + "' != '" + 21 + "'", + value.equals(BigInteger.valueOf(21L))); + } else { + value = value.longValue(); + expected = 21L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[22]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[22] + "' != '" + 22 + "'", + value.equals(BigInteger.valueOf(22L))); + } else { + value = value.longValue(); + expected = 22L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[23]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[23] + "' != '" + 23 + "'", + value.equals(BigInteger.valueOf(23L))); + } else { + value = value.longValue(); + expected = 23L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[24]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[24] + "' != '" + 24 + "'", + value.equals(BigInteger.valueOf(24L))); + } else { + value = value.longValue(); + expected = 24L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[25]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[25] + "' != '" + 25 + "'", + value.equals(BigInteger.valueOf(25L))); + } else { + value = value.longValue(); + expected = 25L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[26]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[26] + "' != '" + 26 + "'", + value.equals(BigInteger.valueOf(26L))); + } else { + value = value.longValue(); + expected = 26L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[27]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[27] + "' != '" + 27 + "'", + value.equals(BigInteger.valueOf(27L))); + } else { + value = value.longValue(); + expected = 27L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[28]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[28] + "' != '" + 28 + "'", + value.equals(BigInteger.valueOf(28L))); + } else { + value = value.longValue(); + expected = 28L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[29]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[29] + "' != '" + 29 + "'", + value.equals(BigInteger.valueOf(29L))); + } else { + value = value.longValue(); + expected = 29L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[30]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[30] + "' != '" + 30 + "'", + value.equals(BigInteger.valueOf(30L))); + } else { + value = value.longValue(); + expected = 30L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[31]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[31] + "' != '" + 31 + "'", + value.equals(BigInteger.valueOf(31L))); + } else { + value = value.longValue(); + expected = 31L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[32]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[32] + "' != '" + 32 + "'", + value.equals(BigInteger.valueOf(32L))); + } else { + value = value.longValue(); + expected = 32L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[33]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[33] + "' != '" + 33 + "'", + value.equals(BigInteger.valueOf(33L))); + } else { + value = value.longValue(); + expected = 33L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[34]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[34] + "' != '" + 34 + "'", + value.equals(BigInteger.valueOf(34L))); + } else { + value = value.longValue(); + expected = 34L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[35]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[35] + "' != '" + 35 + "'", + value.equals(BigInteger.valueOf(35L))); + } else { + value = value.longValue(); + expected = 35L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[36]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[36] + "' != '" + 36 + "'", + value.equals(BigInteger.valueOf(36L))); + } else { + value = value.longValue(); + expected = 36L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[37]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[37] + "' != '" + 37 + "'", + value.equals(BigInteger.valueOf(37L))); + } else { + value = value.longValue(); + expected = 37L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[38]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[38] + "' != '" + 38 + "'", + value.equals(BigInteger.valueOf(38L))); + } else { + value = value.longValue(); + expected = 38L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[39]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[39] + "' != '" + 39 + "'", + value.equals(BigInteger.valueOf(39L))); + } else { + value = value.longValue(); + expected = 39L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[40]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[40] + "' != '" + 40 + "'", + value.equals(BigInteger.valueOf(40L))); + } else { + value = value.longValue(); + expected = 40L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[41]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[41] + "' != '" + 41 + "'", + value.equals(BigInteger.valueOf(41L))); + } else { + value = value.longValue(); + expected = 41L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[42]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[42] + "' != '" + 42 + "'", + value.equals(BigInteger.valueOf(42L))); + } else { + value = value.longValue(); + expected = 42L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[43]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[43] + "' != '" + 43 + "'", + value.equals(BigInteger.valueOf(43L))); + } else { + value = value.longValue(); + expected = 43L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[44]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[44] + "' != '" + 44 + "'", + value.equals(BigInteger.valueOf(44L))); + } else { + value = value.longValue(); + expected = 44L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[45]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[45] + "' != '" + 45 + "'", + value.equals(BigInteger.valueOf(45L))); + } else { + value = value.longValue(); + expected = 45L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[46]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[46] + "' != '" + 46 + "'", + value.equals(BigInteger.valueOf(46L))); + } else { + value = value.longValue(); + expected = 46L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[47]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[47] + "' != '" + 47 + "'", + value.equals(BigInteger.valueOf(47L))); + } else { + value = value.longValue(); + expected = 47L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[48]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[48] + "' != '" + 48 + "'", + value.equals(BigInteger.valueOf(48L))); + } else { + value = value.longValue(); + expected = 48L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[49]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[49] + "' != '" + 49 + "'", + value.equals(BigInteger.valueOf(49L))); + } else { + value = value.longValue(); + expected = 49L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[50]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[50] + "' != '" + 50 + "'", + value.equals(BigInteger.valueOf(50L))); + } else { + value = value.longValue(); + expected = 50L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[51]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[51] + "' != '" + 51 + "'", + value.equals(BigInteger.valueOf(51L))); + } else { + value = value.longValue(); + expected = 51L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[52]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[52] + "' != '" + 52 + "'", + value.equals(BigInteger.valueOf(52L))); + } else { + value = value.longValue(); + expected = 52L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[53]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[53] + "' != '" + 53 + "'", + value.equals(BigInteger.valueOf(53L))); + } else { + value = value.longValue(); + expected = 53L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[54]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[54] + "' != '" + 54 + "'", + value.equals(BigInteger.valueOf(54L))); + } else { + value = value.longValue(); + expected = 54L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[55]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[55] + "' != '" + 55 + "'", + value.equals(BigInteger.valueOf(55L))); + } else { + value = value.longValue(); + expected = 55L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[56]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[56] + "' != '" + 56 + "'", + value.equals(BigInteger.valueOf(56L))); + } else { + value = value.longValue(); + expected = 56L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[57]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[57] + "' != '" + 57 + "'", + value.equals(BigInteger.valueOf(57L))); + } else { + value = value.longValue(); + expected = 57L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[58]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[58] + "' != '" + 58 + "'", + value.equals(BigInteger.valueOf(58L))); + } else { + value = value.longValue(); + expected = 58L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[59]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[59] + "' != '" + 59 + "'", + value.equals(BigInteger.valueOf(59L))); + } else { + value = value.longValue(); + expected = 59L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[60]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[60] + "' != '" + 60 + "'", + value.equals(BigInteger.valueOf(60L))); + } else { + value = value.longValue(); + expected = 60L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[61]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[61] + "' != '" + 61 + "'", + value.equals(BigInteger.valueOf(61L))); + } else { + value = value.longValue(); + expected = 61L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[62]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[62] + "' != '" + 62 + "'", + value.equals(BigInteger.valueOf(62L))); + } else { + value = value.longValue(); + expected = 62L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[63]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[63] + "' != '" + 63 + "'", + value.equals(BigInteger.valueOf(63L))); + } else { + value = value.longValue(); + expected = 63L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[64]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[64] + "' != '" + 64 + "'", + value.equals(BigInteger.valueOf(64L))); + } else { + value = value.longValue(); + expected = 64L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[65]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[65] + "' != '" + 65 + "'", + value.equals(BigInteger.valueOf(65L))); + } else { + value = value.longValue(); + expected = 65L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[66]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[66] + "' != '" + 66 + "'", + value.equals(BigInteger.valueOf(66L))); + } else { + value = value.longValue(); + expected = 66L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[67]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[67] + "' != '" + 67 + "'", + value.equals(BigInteger.valueOf(67L))); + } else { + value = value.longValue(); + expected = 67L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[68]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[68] + "' != '" + 68 + "'", + value.equals(BigInteger.valueOf(68L))); + } else { + value = value.longValue(); + expected = 68L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[69]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[69] + "' != '" + 69 + "'", + value.equals(BigInteger.valueOf(69L))); + } else { + value = value.longValue(); + expected = 69L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[70]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[70] + "' != '" + 70 + "'", + value.equals(BigInteger.valueOf(70L))); + } else { + value = value.longValue(); + expected = 70L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signature[71]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature[71] + "' != '" + 71 + "'", + value.equals(BigInteger.valueOf(71L))); + } else { + value = value.longValue(); + expected = 71L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[0]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[0] + "' != '" + 10 + "'", + value.equals(BigInteger.valueOf(10L))); + } else { + value = value.longValue(); + expected = 10L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[1]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[1] + "' != '" + 21 + "'", + value.equals(BigInteger.valueOf(21L))); + } else { + value = value.longValue(); + expected = 21L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.signed_messages[2]; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signed_messages[2] + "' != '" + 23 + "'", + value.equals(BigInteger.valueOf(23L))); + } else { + value = value.longValue(); + expected = 23L; + org.junit.Assert.assertEquals(value, expected); + } + value = msg.stream_counter; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.stream_counter + "' != '" + 1 + "'", + value.equals(BigInteger.valueOf(1L))); + } else { + value = value.longValue(); + expected = 1L; + org.junit.Assert.assertEquals(value, expected); + } + + org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); + } +} diff --git a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureTest.java b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureTest.java index 12d8262e4b..75068a8133 100644 --- a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureTest.java +++ b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureTest.java @@ -45,7 +45,7 @@ public void test1() throws Throwable { (byte) 64, (byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 10, (byte) 21, (byte) 23, }; - SBPMessage sbp = new SBPMessage(0x42, 0xC07, payload); + SBPMessage sbp = new SBPMessage(0x42, 0xC08, payload); MsgEcdsaSignature msg = new MsgEcdsaSignature(sbp); JSONObject json = msg.toJSON(); Number value; @@ -99,16 +99,6 @@ public void test1() throws Throwable { expected = 0L; org.junit.Assert.assertEquals(value, expected); } - value = msg.n_signature_bytes; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.n_signature_bytes + "' != '" + 72 + "'", - value.equals(BigInteger.valueOf(72L))); - } else { - value = value.longValue(); - expected = 72L; - org.junit.Assert.assertEquals(value, expected); - } value = msg.on_demand_counter; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( @@ -119,726 +109,736 @@ public void test1() throws Throwable { expected = 2L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[0]; + value = msg.signature.data[0]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[0] + "' != '" + 0 + "'", + "'" + msg.signature.data[0] + "' != '" + 0 + "'", value.equals(BigInteger.valueOf(0L))); } else { value = value.longValue(); expected = 0L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[1]; + value = msg.signature.data[1]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[1] + "' != '" + 1 + "'", + "'" + msg.signature.data[1] + "' != '" + 1 + "'", value.equals(BigInteger.valueOf(1L))); } else { value = value.longValue(); expected = 1L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[2]; + value = msg.signature.data[2]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[2] + "' != '" + 2 + "'", + "'" + msg.signature.data[2] + "' != '" + 2 + "'", value.equals(BigInteger.valueOf(2L))); } else { value = value.longValue(); expected = 2L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[3]; + value = msg.signature.data[3]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[3] + "' != '" + 3 + "'", + "'" + msg.signature.data[3] + "' != '" + 3 + "'", value.equals(BigInteger.valueOf(3L))); } else { value = value.longValue(); expected = 3L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[4]; + value = msg.signature.data[4]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[4] + "' != '" + 4 + "'", + "'" + msg.signature.data[4] + "' != '" + 4 + "'", value.equals(BigInteger.valueOf(4L))); } else { value = value.longValue(); expected = 4L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[5]; + value = msg.signature.data[5]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[5] + "' != '" + 5 + "'", + "'" + msg.signature.data[5] + "' != '" + 5 + "'", value.equals(BigInteger.valueOf(5L))); } else { value = value.longValue(); expected = 5L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[6]; + value = msg.signature.data[6]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[6] + "' != '" + 6 + "'", + "'" + msg.signature.data[6] + "' != '" + 6 + "'", value.equals(BigInteger.valueOf(6L))); } else { value = value.longValue(); expected = 6L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[7]; + value = msg.signature.data[7]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[7] + "' != '" + 7 + "'", + "'" + msg.signature.data[7] + "' != '" + 7 + "'", value.equals(BigInteger.valueOf(7L))); } else { value = value.longValue(); expected = 7L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[8]; + value = msg.signature.data[8]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[8] + "' != '" + 8 + "'", + "'" + msg.signature.data[8] + "' != '" + 8 + "'", value.equals(BigInteger.valueOf(8L))); } else { value = value.longValue(); expected = 8L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[9]; + value = msg.signature.data[9]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[9] + "' != '" + 9 + "'", + "'" + msg.signature.data[9] + "' != '" + 9 + "'", value.equals(BigInteger.valueOf(9L))); } else { value = value.longValue(); expected = 9L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[10]; + value = msg.signature.data[10]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[10] + "' != '" + 10 + "'", + "'" + msg.signature.data[10] + "' != '" + 10 + "'", value.equals(BigInteger.valueOf(10L))); } else { value = value.longValue(); expected = 10L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[11]; + value = msg.signature.data[11]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[11] + "' != '" + 11 + "'", + "'" + msg.signature.data[11] + "' != '" + 11 + "'", value.equals(BigInteger.valueOf(11L))); } else { value = value.longValue(); expected = 11L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[12]; + value = msg.signature.data[12]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[12] + "' != '" + 12 + "'", + "'" + msg.signature.data[12] + "' != '" + 12 + "'", value.equals(BigInteger.valueOf(12L))); } else { value = value.longValue(); expected = 12L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[13]; + value = msg.signature.data[13]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[13] + "' != '" + 13 + "'", + "'" + msg.signature.data[13] + "' != '" + 13 + "'", value.equals(BigInteger.valueOf(13L))); } else { value = value.longValue(); expected = 13L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[14]; + value = msg.signature.data[14]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[14] + "' != '" + 14 + "'", + "'" + msg.signature.data[14] + "' != '" + 14 + "'", value.equals(BigInteger.valueOf(14L))); } else { value = value.longValue(); expected = 14L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[15]; + value = msg.signature.data[15]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[15] + "' != '" + 15 + "'", + "'" + msg.signature.data[15] + "' != '" + 15 + "'", value.equals(BigInteger.valueOf(15L))); } else { value = value.longValue(); expected = 15L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[16]; + value = msg.signature.data[16]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[16] + "' != '" + 16 + "'", + "'" + msg.signature.data[16] + "' != '" + 16 + "'", value.equals(BigInteger.valueOf(16L))); } else { value = value.longValue(); expected = 16L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[17]; + value = msg.signature.data[17]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[17] + "' != '" + 17 + "'", + "'" + msg.signature.data[17] + "' != '" + 17 + "'", value.equals(BigInteger.valueOf(17L))); } else { value = value.longValue(); expected = 17L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[18]; + value = msg.signature.data[18]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[18] + "' != '" + 18 + "'", + "'" + msg.signature.data[18] + "' != '" + 18 + "'", value.equals(BigInteger.valueOf(18L))); } else { value = value.longValue(); expected = 18L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[19]; + value = msg.signature.data[19]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[19] + "' != '" + 19 + "'", + "'" + msg.signature.data[19] + "' != '" + 19 + "'", value.equals(BigInteger.valueOf(19L))); } else { value = value.longValue(); expected = 19L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[20]; + value = msg.signature.data[20]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[20] + "' != '" + 20 + "'", + "'" + msg.signature.data[20] + "' != '" + 20 + "'", value.equals(BigInteger.valueOf(20L))); } else { value = value.longValue(); expected = 20L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[21]; + value = msg.signature.data[21]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[21] + "' != '" + 21 + "'", + "'" + msg.signature.data[21] + "' != '" + 21 + "'", value.equals(BigInteger.valueOf(21L))); } else { value = value.longValue(); expected = 21L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[22]; + value = msg.signature.data[22]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[22] + "' != '" + 22 + "'", + "'" + msg.signature.data[22] + "' != '" + 22 + "'", value.equals(BigInteger.valueOf(22L))); } else { value = value.longValue(); expected = 22L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[23]; + value = msg.signature.data[23]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[23] + "' != '" + 23 + "'", + "'" + msg.signature.data[23] + "' != '" + 23 + "'", value.equals(BigInteger.valueOf(23L))); } else { value = value.longValue(); expected = 23L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[24]; + value = msg.signature.data[24]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[24] + "' != '" + 24 + "'", + "'" + msg.signature.data[24] + "' != '" + 24 + "'", value.equals(BigInteger.valueOf(24L))); } else { value = value.longValue(); expected = 24L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[25]; + value = msg.signature.data[25]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[25] + "' != '" + 25 + "'", + "'" + msg.signature.data[25] + "' != '" + 25 + "'", value.equals(BigInteger.valueOf(25L))); } else { value = value.longValue(); expected = 25L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[26]; + value = msg.signature.data[26]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[26] + "' != '" + 26 + "'", + "'" + msg.signature.data[26] + "' != '" + 26 + "'", value.equals(BigInteger.valueOf(26L))); } else { value = value.longValue(); expected = 26L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[27]; + value = msg.signature.data[27]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[27] + "' != '" + 27 + "'", + "'" + msg.signature.data[27] + "' != '" + 27 + "'", value.equals(BigInteger.valueOf(27L))); } else { value = value.longValue(); expected = 27L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[28]; + value = msg.signature.data[28]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[28] + "' != '" + 28 + "'", + "'" + msg.signature.data[28] + "' != '" + 28 + "'", value.equals(BigInteger.valueOf(28L))); } else { value = value.longValue(); expected = 28L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[29]; + value = msg.signature.data[29]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[29] + "' != '" + 29 + "'", + "'" + msg.signature.data[29] + "' != '" + 29 + "'", value.equals(BigInteger.valueOf(29L))); } else { value = value.longValue(); expected = 29L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[30]; + value = msg.signature.data[30]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[30] + "' != '" + 30 + "'", + "'" + msg.signature.data[30] + "' != '" + 30 + "'", value.equals(BigInteger.valueOf(30L))); } else { value = value.longValue(); expected = 30L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[31]; + value = msg.signature.data[31]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[31] + "' != '" + 31 + "'", + "'" + msg.signature.data[31] + "' != '" + 31 + "'", value.equals(BigInteger.valueOf(31L))); } else { value = value.longValue(); expected = 31L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[32]; + value = msg.signature.data[32]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[32] + "' != '" + 32 + "'", + "'" + msg.signature.data[32] + "' != '" + 32 + "'", value.equals(BigInteger.valueOf(32L))); } else { value = value.longValue(); expected = 32L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[33]; + value = msg.signature.data[33]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[33] + "' != '" + 33 + "'", + "'" + msg.signature.data[33] + "' != '" + 33 + "'", value.equals(BigInteger.valueOf(33L))); } else { value = value.longValue(); expected = 33L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[34]; + value = msg.signature.data[34]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[34] + "' != '" + 34 + "'", + "'" + msg.signature.data[34] + "' != '" + 34 + "'", value.equals(BigInteger.valueOf(34L))); } else { value = value.longValue(); expected = 34L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[35]; + value = msg.signature.data[35]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[35] + "' != '" + 35 + "'", + "'" + msg.signature.data[35] + "' != '" + 35 + "'", value.equals(BigInteger.valueOf(35L))); } else { value = value.longValue(); expected = 35L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[36]; + value = msg.signature.data[36]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[36] + "' != '" + 36 + "'", + "'" + msg.signature.data[36] + "' != '" + 36 + "'", value.equals(BigInteger.valueOf(36L))); } else { value = value.longValue(); expected = 36L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[37]; + value = msg.signature.data[37]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[37] + "' != '" + 37 + "'", + "'" + msg.signature.data[37] + "' != '" + 37 + "'", value.equals(BigInteger.valueOf(37L))); } else { value = value.longValue(); expected = 37L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[38]; + value = msg.signature.data[38]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[38] + "' != '" + 38 + "'", + "'" + msg.signature.data[38] + "' != '" + 38 + "'", value.equals(BigInteger.valueOf(38L))); } else { value = value.longValue(); expected = 38L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[39]; + value = msg.signature.data[39]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[39] + "' != '" + 39 + "'", + "'" + msg.signature.data[39] + "' != '" + 39 + "'", value.equals(BigInteger.valueOf(39L))); } else { value = value.longValue(); expected = 39L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[40]; + value = msg.signature.data[40]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[40] + "' != '" + 40 + "'", + "'" + msg.signature.data[40] + "' != '" + 40 + "'", value.equals(BigInteger.valueOf(40L))); } else { value = value.longValue(); expected = 40L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[41]; + value = msg.signature.data[41]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[41] + "' != '" + 41 + "'", + "'" + msg.signature.data[41] + "' != '" + 41 + "'", value.equals(BigInteger.valueOf(41L))); } else { value = value.longValue(); expected = 41L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[42]; + value = msg.signature.data[42]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[42] + "' != '" + 42 + "'", + "'" + msg.signature.data[42] + "' != '" + 42 + "'", value.equals(BigInteger.valueOf(42L))); } else { value = value.longValue(); expected = 42L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[43]; + value = msg.signature.data[43]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[43] + "' != '" + 43 + "'", + "'" + msg.signature.data[43] + "' != '" + 43 + "'", value.equals(BigInteger.valueOf(43L))); } else { value = value.longValue(); expected = 43L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[44]; + value = msg.signature.data[44]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[44] + "' != '" + 44 + "'", + "'" + msg.signature.data[44] + "' != '" + 44 + "'", value.equals(BigInteger.valueOf(44L))); } else { value = value.longValue(); expected = 44L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[45]; + value = msg.signature.data[45]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[45] + "' != '" + 45 + "'", + "'" + msg.signature.data[45] + "' != '" + 45 + "'", value.equals(BigInteger.valueOf(45L))); } else { value = value.longValue(); expected = 45L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[46]; + value = msg.signature.data[46]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[46] + "' != '" + 46 + "'", + "'" + msg.signature.data[46] + "' != '" + 46 + "'", value.equals(BigInteger.valueOf(46L))); } else { value = value.longValue(); expected = 46L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[47]; + value = msg.signature.data[47]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[47] + "' != '" + 47 + "'", + "'" + msg.signature.data[47] + "' != '" + 47 + "'", value.equals(BigInteger.valueOf(47L))); } else { value = value.longValue(); expected = 47L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[48]; + value = msg.signature.data[48]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[48] + "' != '" + 48 + "'", + "'" + msg.signature.data[48] + "' != '" + 48 + "'", value.equals(BigInteger.valueOf(48L))); } else { value = value.longValue(); expected = 48L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[49]; + value = msg.signature.data[49]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[49] + "' != '" + 49 + "'", + "'" + msg.signature.data[49] + "' != '" + 49 + "'", value.equals(BigInteger.valueOf(49L))); } else { value = value.longValue(); expected = 49L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[50]; + value = msg.signature.data[50]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[50] + "' != '" + 50 + "'", + "'" + msg.signature.data[50] + "' != '" + 50 + "'", value.equals(BigInteger.valueOf(50L))); } else { value = value.longValue(); expected = 50L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[51]; + value = msg.signature.data[51]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[51] + "' != '" + 51 + "'", + "'" + msg.signature.data[51] + "' != '" + 51 + "'", value.equals(BigInteger.valueOf(51L))); } else { value = value.longValue(); expected = 51L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[52]; + value = msg.signature.data[52]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[52] + "' != '" + 52 + "'", + "'" + msg.signature.data[52] + "' != '" + 52 + "'", value.equals(BigInteger.valueOf(52L))); } else { value = value.longValue(); expected = 52L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[53]; + value = msg.signature.data[53]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[53] + "' != '" + 53 + "'", + "'" + msg.signature.data[53] + "' != '" + 53 + "'", value.equals(BigInteger.valueOf(53L))); } else { value = value.longValue(); expected = 53L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[54]; + value = msg.signature.data[54]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[54] + "' != '" + 54 + "'", + "'" + msg.signature.data[54] + "' != '" + 54 + "'", value.equals(BigInteger.valueOf(54L))); } else { value = value.longValue(); expected = 54L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[55]; + value = msg.signature.data[55]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[55] + "' != '" + 55 + "'", + "'" + msg.signature.data[55] + "' != '" + 55 + "'", value.equals(BigInteger.valueOf(55L))); } else { value = value.longValue(); expected = 55L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[56]; + value = msg.signature.data[56]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[56] + "' != '" + 56 + "'", + "'" + msg.signature.data[56] + "' != '" + 56 + "'", value.equals(BigInteger.valueOf(56L))); } else { value = value.longValue(); expected = 56L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[57]; + value = msg.signature.data[57]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[57] + "' != '" + 57 + "'", + "'" + msg.signature.data[57] + "' != '" + 57 + "'", value.equals(BigInteger.valueOf(57L))); } else { value = value.longValue(); expected = 57L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[58]; + value = msg.signature.data[58]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[58] + "' != '" + 58 + "'", + "'" + msg.signature.data[58] + "' != '" + 58 + "'", value.equals(BigInteger.valueOf(58L))); } else { value = value.longValue(); expected = 58L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[59]; + value = msg.signature.data[59]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[59] + "' != '" + 59 + "'", + "'" + msg.signature.data[59] + "' != '" + 59 + "'", value.equals(BigInteger.valueOf(59L))); } else { value = value.longValue(); expected = 59L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[60]; + value = msg.signature.data[60]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[60] + "' != '" + 60 + "'", + "'" + msg.signature.data[60] + "' != '" + 60 + "'", value.equals(BigInteger.valueOf(60L))); } else { value = value.longValue(); expected = 60L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[61]; + value = msg.signature.data[61]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[61] + "' != '" + 61 + "'", + "'" + msg.signature.data[61] + "' != '" + 61 + "'", value.equals(BigInteger.valueOf(61L))); } else { value = value.longValue(); expected = 61L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[62]; + value = msg.signature.data[62]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[62] + "' != '" + 62 + "'", + "'" + msg.signature.data[62] + "' != '" + 62 + "'", value.equals(BigInteger.valueOf(62L))); } else { value = value.longValue(); expected = 62L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[63]; + value = msg.signature.data[63]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[63] + "' != '" + 63 + "'", + "'" + msg.signature.data[63] + "' != '" + 63 + "'", value.equals(BigInteger.valueOf(63L))); } else { value = value.longValue(); expected = 63L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[64]; + value = msg.signature.data[64]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[64] + "' != '" + 64 + "'", + "'" + msg.signature.data[64] + "' != '" + 64 + "'", value.equals(BigInteger.valueOf(64L))); } else { value = value.longValue(); expected = 64L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[65]; + value = msg.signature.data[65]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[65] + "' != '" + 65 + "'", + "'" + msg.signature.data[65] + "' != '" + 65 + "'", value.equals(BigInteger.valueOf(65L))); } else { value = value.longValue(); expected = 65L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[66]; + value = msg.signature.data[66]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[66] + "' != '" + 66 + "'", + "'" + msg.signature.data[66] + "' != '" + 66 + "'", value.equals(BigInteger.valueOf(66L))); } else { value = value.longValue(); expected = 66L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[67]; + value = msg.signature.data[67]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[67] + "' != '" + 67 + "'", + "'" + msg.signature.data[67] + "' != '" + 67 + "'", value.equals(BigInteger.valueOf(67L))); } else { value = value.longValue(); expected = 67L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[68]; + value = msg.signature.data[68]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[68] + "' != '" + 68 + "'", + "'" + msg.signature.data[68] + "' != '" + 68 + "'", value.equals(BigInteger.valueOf(68L))); } else { value = value.longValue(); expected = 68L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[69]; + value = msg.signature.data[69]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[69] + "' != '" + 69 + "'", + "'" + msg.signature.data[69] + "' != '" + 69 + "'", value.equals(BigInteger.valueOf(69L))); } else { value = value.longValue(); expected = 69L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[70]; + value = msg.signature.data[70]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[70] + "' != '" + 70 + "'", + "'" + msg.signature.data[70] + "' != '" + 70 + "'", value.equals(BigInteger.valueOf(70L))); } else { value = value.longValue(); expected = 70L; org.junit.Assert.assertEquals(value, expected); } - value = msg.signature[71]; + value = msg.signature.data[71]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( - "'" + msg.signature[71] + "' != '" + 71 + "'", + "'" + msg.signature.data[71] + "' != '" + 71 + "'", value.equals(BigInteger.valueOf(71L))); } else { value = value.longValue(); expected = 71L; org.junit.Assert.assertEquals(value, expected); } + value = msg.signature.len; + if (value instanceof BigInteger) { + org.junit.Assert.assertTrue( + "'" + msg.signature.len + "' != '" + 72 + "'", + value.equals(BigInteger.valueOf(72L))); + } else { + value = value.longValue(); + expected = 72L; + org.junit.Assert.assertEquals(value, expected); + } value = msg.signed_messages[0]; if (value instanceof BigInteger) { org.junit.Assert.assertTrue( diff --git a/javascript/sbp.bundle.js b/javascript/sbp.bundle.js index 908caa2f78..240c0edb34 100644 --- a/javascript/sbp.bundle.js +++ b/javascript/sbp.bundle.js @@ -12,4 +12,4 @@ var r=p(25),o=p(26),i=p(16);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647 * @author Feross Aboukhadijeh * @license MIT */ -function r(e,t){if(e===t)return 0;for(var p=e.length,r=t.length,o=0,i=Math.min(p,r);o=0;l--)if(c[l]!==u[l])return!1;for(l=c.length-1;l>=0;l--)if(a=c[l],!g(e[a],t[a],p,r))return!1;return!0}(e,t,p,s))}return p?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function m(e,t,p,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof p&&(r=p,p=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(p&&p.name?" ("+p.name+").":".")+(r?" "+r:"."),e&&!o&&_(o,p,"Missing expected exception"+r);var s="string"==typeof r,n=!e&&o&&!p;if((!e&&i.isError(o)&&s&&E(o,p)||n)&&_(o,p,"Got unwanted exception"+r),e&&o&&p&&!E(o,p)||!e&&o)throw o}u.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return h(d(e.actual),128)+" "+e.operator+" "+h(d(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||_;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var p=new Error;if(p.stack){var r=p.stack,o=f(t),i=r.indexOf("\n"+o);if(i>=0){var s=r.indexOf("\n",i+1);r=r.substring(s+1)}this.stack=r}}},i.inherits(u.AssertionError,Error),u.fail=_,u.ok=S,u.equal=function(e,t,p){e!=t&&_(e,t,p,"==",u.equal)},u.notEqual=function(e,t,p){e==t&&_(e,t,p,"!=",u.notEqual)},u.deepEqual=function(e,t,p){g(e,t,!1)||_(e,t,p,"deepEqual",u.deepEqual)},u.deepStrictEqual=function(e,t,p){g(e,t,!0)||_(e,t,p,"deepStrictEqual",u.deepStrictEqual)},u.notDeepEqual=function(e,t,p){g(e,t,!1)&&_(e,t,p,"notDeepEqual",u.notDeepEqual)},u.notDeepStrictEqual=function e(t,p,r){g(t,p,!0)&&_(t,p,r,"notDeepStrictEqual",e)},u.strictEqual=function(e,t,p){e!==t&&_(e,t,p,"===",u.strictEqual)},u.notStrictEqual=function(e,t,p){e===t&&_(e,t,p,"!==",u.notStrictEqual)},u.throws=function(e,t,p){m(!0,e,t,p)},u.doesNotThrow=function(e,t,p){m(!1,e,t,p)},u.ifError=function(e){if(e)throw e};var b=Object.keys||function(e){var t=[];for(var p in e)s.call(e,p)&&t.push(p);return t}}).call(this,p(5))},function(e,t,p){var r;!function(p){o(Math.pow(36,5)),o(Math.pow(16,7)),o(Math.pow(10,9)),o(Math.pow(2,30)),o(36),o(16),o(10),o(2);function o(e,t){return this instanceof o?(this._low=0,this._high=0,this.remainder=null,void 0===t?s.call(this,e):"string"==typeof e?n.call(this,e,t):void i.call(this,e,t)):new o(e,t)}function i(e,t){return this._low=0|e,this._high=0|t,this}function s(e){return this._low=65535&e,this._high=e>>>16,this}function n(e,t){var p=parseInt(e,t||10);return this._low=65535&p,this._high=p>>>16,this}o.prototype.fromBits=i,o.prototype.fromNumber=s,o.prototype.fromString=n,o.prototype.toNumber=function(){return 65536*this._high+this._low},o.prototype.toString=function(e){return this.toNumber().toString(e||10)},o.prototype.add=function(e){var t=this._low+e._low,p=t>>>16;return p+=this._high+e._high,this._low=65535&t,this._high=65535&p,this},o.prototype.subtract=function(e){return this.add(e.clone().negate())},o.prototype.multiply=function(e){var t,p,r=this._high,o=this._low,i=e._high,s=e._low;return t=(p=o*s)>>>16,t+=r*s,t&=65535,t+=o*i,this._low=65535&p,this._high=65535&t,this},o.prototype.div=function(e){if(0==e._low&&0==e._high)throw Error("division by zero");if(0==e._high&&1==e._low)return this.remainder=new o(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new o(0),this._low=1,this._high=0,this;for(var t=e.clone(),p=-1;!this.lt(t);)t.shiftLeft(1,!0),p++;for(this.remainder=this.clone(),this._low=0,this._high=0;p>=0;p--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),p>=16?this._high|=1<>>16)&65535,this},o.prototype.equals=o.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},o.prototype.greaterThan=o.prototype.gt=function(e){return this._high>e._high||!(this._highe._low},o.prototype.lessThan=o.prototype.lt=function(e){return this._highe._high)&&this._low16?(this._low=this._high>>e-16,this._high=0):16==e?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},o.prototype.shiftLeft=o.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<>16-e,this._low=this._low<>>32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.rotateRight=o.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.clone=function(){return new o(this._low,this._high)},void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,p){var r;!function(p){var o={16:s(Math.pow(16,5)),10:s(Math.pow(10,5)),2:s(Math.pow(2,5))},i={16:s(16),10:s(10),2:s(2)};function s(e,t,p,r){return this instanceof s?(this.remainder=null,"string"==typeof e?l.call(this,e,t):void 0===t?a.call(this,e):void n.apply(this,arguments)):new s(e,t,p,r)}function n(e,t,p,r){return void 0===p?(this._a00=65535&e,this._a16=e>>>16,this._a32=65535&t,this._a48=t>>>16,this):(this._a00=0|e,this._a16=0|t,this._a32=0|p,this._a48=0|r,this)}function a(e){return this._a00=65535&e,this._a16=e>>>16,this._a32=0,this._a48=0,this}function l(e,t){t=t||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var p=o[t]||new s(Math.pow(t,5)),r=0,i=e.length;r=0&&(p.div(t),r[o]=p.remainder.toNumber().toString(e),p.gt(t));o--);return r[o-1]=p.toNumber().toString(e),r.join("")},s.prototype.add=function(e){var t=this._a00+e._a00,p=t>>>16,r=(p+=this._a16+e._a16)>>>16,o=(r+=this._a32+e._a32)>>>16;return o+=this._a48+e._a48,this._a00=65535&t,this._a16=65535&p,this._a32=65535&r,this._a48=65535&o,this},s.prototype.subtract=function(e){return this.add(e.clone().negate())},s.prototype.multiply=function(e){var t=this._a00,p=this._a16,r=this._a32,o=this._a48,i=e._a00,s=e._a16,n=e._a32,a=t*i,l=a>>>16,c=(l+=t*s)>>>16;l&=65535,c+=(l+=p*i)>>>16;var u=(c+=t*n)>>>16;return c&=65535,u+=(c+=p*s)>>>16,c&=65535,u+=(c+=r*i)>>>16,u+=t*e._a48,u&=65535,u+=p*n,u&=65535,u+=r*s,u&=65535,u+=o*i,this._a00=65535&a,this._a16=65535&l,this._a32=65535&c,this._a48=65535&u,this},s.prototype.div=function(e){if(0==e._a16&&0==e._a32&&0==e._a48){if(0==e._a00)throw Error("division by zero");if(1==e._a00)return this.remainder=new s(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new s(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),p=-1;!this.lt(t);)t.shiftLeft(1,!0),p++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;p>=0;p--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),p>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&e,e=(65535&~this._a32)+(e>>>16),this._a32=65535&e,this._a48=~this._a48+(e>>>16)&65535,this},s.prototype.equals=s.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},s.prototype.greaterThan=s.prototype.gt=function(e){return this._a48>e._a48||!(this._a48e._a32||!(this._a32e._a16||!(this._a16e._a00))},s.prototype.lessThan=s.prototype.lt=function(e){return this._a48e._a48)&&(this._a32e._a32)&&(this._a16e._a16)&&this._a00=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=65535&(this._a32>>e|this._a48<<16-e),this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=65535&(this._a16>>e|this._a32<<16-e),this._a16=65535&(this._a32>>e|this._a48<<16-e),this._a32=this._a48>>e&65535,this._a48=0):(this._a00=65535&(this._a00>>e|this._a16<<16-e),this._a16=65535&(this._a16>>e|this._a32<<16-e),this._a32=65535&(this._a32>>e|this._a48<<16-e),this._a48=this._a48>>e&65535),this},s.prototype.shiftLeft=s.prototype.shiftl=function(e,t){return(e%=64)>=48?(this._a48=this._a00<=32?(e-=32,this._a48=this._a16<>16-e,this._a32=this._a00<=16?(e-=16,this._a48=this._a32<>16-e,this._a32=65535&(this._a16<>16-e),this._a16=this._a00<>16-e,this._a32=65535&(this._a32<>16-e),this._a16=65535&(this._a16<>16-e),this._a00=this._a00<=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var p=this._a48<<16|this._a32,r=this._a16<<16|this._a00,o=p<>>32-e,i=r<>>32-e;return this._a00=65535&i,this._a16=i>>>16,this._a32=65535&o,this._a48=o>>>16,this},s.prototype.rotateRight=s.prototype.rotr=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var p=this._a48<<16|this._a32,r=this._a16<<16|this._a00,o=p>>>e|r<<32-e,i=r>>>e|p<<32-e;return this._a00=65535&i,this._a16=i>>>16,this._a32=65535&o,this._a48=o>>>16,this},s.prototype.clone=function(){return new s(this._a00,this._a16,this._a32,this._a48)},void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=p(0).GnssSignalDep,n=(p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT",this.fields=t||this.parser.parse(e.payload),this});(n.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT",n.prototype.msg_type=47,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").floatle("cn0").floatle("cp").floatle("cf").nest("sid",{type:i.prototype.parser}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["cn0","writeFloatLE",4]),n.prototype.fieldSpec.push(["cp","writeFloatLE",4]),n.prototype.fieldSpec.push(["cf","writeFloatLE",4]),n.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_C",a.prototype.msg_type=31,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").floatle("cn0").floatle("cp").floatle("cf").nest("sid",{type:s.prototype.parser}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["cn0","writeFloatLE",4]),a.prototype.fieldSpec.push(["cp","writeFloatLE",4]),a.prototype.fieldSpec.push(["cf","writeFloatLE",4]),a.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_B",l.prototype.msg_type=20,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").floatle("snr").floatle("cp").floatle("cf").nest("sid",{type:s.prototype.parser}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["snr","writeFloatLE",4]),l.prototype.fieldSpec.push(["cp","writeFloatLE",4]),l.prototype.fieldSpec.push(["cf","writeFloatLE",4]),l.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_A",c.prototype.msg_type=21,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").floatle("snr").floatle("cp").floatle("cf").uint8("prn"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["snr","writeFloatLE",4]),c.prototype.fieldSpec.push(["cp","writeFloatLE",4]),c.prototype.fieldSpec.push(["cf","writeFloatLE",4]),c.prototype.fieldSpec.push(["prn","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="AcqSvProfile",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="AcqSvProfile",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint8("job_type").uint8("status").uint16("cn0").uint8("int_time").nest("sid",{type:i.prototype.parser}).uint16("bin_width").uint32("timestamp").uint32("time_spent").int32("cf_min").int32("cf_max").int32("cf").uint32("cp"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["job_type","writeUInt8",1]),u.prototype.fieldSpec.push(["status","writeUInt8",1]),u.prototype.fieldSpec.push(["cn0","writeUInt16LE",2]),u.prototype.fieldSpec.push(["int_time","writeUInt8",1]),u.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),u.prototype.fieldSpec.push(["bin_width","writeUInt16LE",2]),u.prototype.fieldSpec.push(["timestamp","writeUInt32LE",4]),u.prototype.fieldSpec.push(["time_spent","writeUInt32LE",4]),u.prototype.fieldSpec.push(["cf_min","writeInt32LE",4]),u.prototype.fieldSpec.push(["cf_max","writeInt32LE",4]),u.prototype.fieldSpec.push(["cf","writeInt32LE",4]),u.prototype.fieldSpec.push(["cp","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="AcqSvProfileDep",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="AcqSvProfileDep",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint8("job_type").uint8("status").uint16("cn0").uint8("int_time").nest("sid",{type:s.prototype.parser}).uint16("bin_width").uint32("timestamp").uint32("time_spent").int32("cf_min").int32("cf_max").int32("cf").uint32("cp"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["job_type","writeUInt8",1]),y.prototype.fieldSpec.push(["status","writeUInt8",1]),y.prototype.fieldSpec.push(["cn0","writeUInt16LE",2]),y.prototype.fieldSpec.push(["int_time","writeUInt8",1]),y.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),y.prototype.fieldSpec.push(["bin_width","writeUInt16LE",2]),y.prototype.fieldSpec.push(["timestamp","writeUInt32LE",4]),y.prototype.fieldSpec.push(["time_spent","writeUInt32LE",4]),y.prototype.fieldSpec.push(["cf_min","writeInt32LE",4]),y.prototype.fieldSpec.push(["cf_max","writeInt32LE",4]),y.prototype.fieldSpec.push(["cf","writeInt32LE",4]),y.prototype.fieldSpec.push(["cp","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_SV_PROFILE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_SV_PROFILE",f.prototype.msg_type=46,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("acq_sv_profile",{type:u.prototype.parser,readUntil:"eof"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["acq_sv_profile","array",u.prototype.fieldSpec,function(){return this.fields.array.length},null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_SV_PROFILE_DEP",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_SV_PROFILE_DEP",h.prototype.msg_type=30,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").array("acq_sv_profile",{type:y.prototype.parser,readUntil:"eof"}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["acq_sv_profile","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={47:n,MsgAcqResult:n,31:a,MsgAcqResultDepC:a,20:l,MsgAcqResultDepB:l,21:c,MsgAcqResultDepA:c,AcqSvProfile:u,AcqSvProfileDep:y,46:f,MsgAcqSvProfile:f,30:h,MsgAcqSvProfileDep:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_REQ",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_REQ",i.prototype.msg_type=179,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little"),i.prototype.fieldSpec=[];let s=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_RESP",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_RESP",s.prototype.msg_type=180,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("flags").string("version",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["flags","writeUInt32LE",4]),s.prototype.fieldSpec.push(["version","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_JUMP_TO_APP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_JUMP_TO_APP",n.prototype.msg_type=177,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("jump"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["jump","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_NAP_DEVICE_DNA_REQ",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_NAP_DEVICE_DNA_REQ",a.prototype.msg_type=222,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little"),a.prototype.fieldSpec=[];let l=function(e,t){return r.call(this,e),this.messageType="MSG_NAP_DEVICE_DNA_RESP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_NAP_DEVICE_DNA_RESP",l.prototype.msg_type=221,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").array("dna",{length:8,type:"uint8"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["dna","array","writeUInt8",function(){return 1},8]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_DEP_A",c.prototype.msg_type=176,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").array("handshake",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["handshake","array","writeUInt8",function(){return 1},null]),e.exports={179:i,MsgBootloaderHandshakeReq:i,180:s,MsgBootloaderHandshakeResp:s,177:n,MsgBootloaderJumpToApp:n,222:a,MsgNapDeviceDnaReq:a,221:l,MsgNapDeviceDnaResp:l,176:c,MsgBootloaderHandshakeDepA:c}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_EXT_EVENT",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_EXT_EVENT",i.prototype.msg_type=257,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags").uint8("pin"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]),i.prototype.fieldSpec.push(["pin","writeUInt8",1]),e.exports={257:i,MsgExtEvent:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_REQ",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_REQ",i.prototype.msg_type=168,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").uint8("chunk_size").string("filename",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),i.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),i.prototype.fieldSpec.push(["chunk_size","writeUInt8",1]),i.prototype.fieldSpec.push(["filename","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_RESP",s.prototype.msg_type=163,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("sequence").array("contents",{type:"uint8",readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),s.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_DIR_REQ",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_DIR_REQ",n.prototype.msg_type=169,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").string("dirname",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),n.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),n.prototype.fieldSpec.push(["dirname","string",null]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_DIR_RESP",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_DIR_RESP",a.prototype.msg_type=170,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint32("sequence").array("contents",{type:"uint8",readUntil:"eof"}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),a.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_REMOVE",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_REMOVE",l.prototype.msg_type=172,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").string("filename",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["filename","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_WRITE_REQ",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_WRITE_REQ",c.prototype.msg_type=173,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").string("filename",{greedy:!0}).array("data",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),c.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),c.prototype.fieldSpec.push(["filename","string",null]),c.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},null]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_WRITE_RESP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_WRITE_RESP",u.prototype.msg_type=171,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("sequence"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_CONFIG_REQ",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_CONFIG_REQ",y.prototype.msg_type=4097,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("sequence"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_CONFIG_RESP",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_CONFIG_RESP",f.prototype.msg_type=4098,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("window_size").uint32("batch_size").uint32("fileio_version"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),f.prototype.fieldSpec.push(["window_size","writeUInt32LE",4]),f.prototype.fieldSpec.push(["batch_size","writeUInt32LE",4]),f.prototype.fieldSpec.push(["fileio_version","writeUInt32LE",4]),e.exports={168:i,MsgFileioReadReq:i,163:s,MsgFileioReadResp:s,169:n,MsgFileioReadDirReq:n,170:a,MsgFileioReadDirResp:a,172:l,MsgFileioRemove:l,173:c,MsgFileioWriteReq:c,171:u,MsgFileioWriteResp:u,4097:y,MsgFileioConfigReq:y,4098:f,MsgFileioConfigResp:f}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_PROGRAM",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_PROGRAM",i.prototype.msg_type=230,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len").array("data",{type:"uint8",length:"addr_len"}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["target","writeUInt8",1]),i.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),i.prototype.fieldSpec.push(["addr_len","writeUInt8",1]),i.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},"addr_len"]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_DONE",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_DONE",s.prototype.msg_type=224,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("response"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["response","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_READ_REQ",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_READ_REQ",n.prototype.msg_type=231,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["target","writeUInt8",1]),n.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),n.prototype.fieldSpec.push(["addr_len","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_READ_RESP",a.prototype.msg_type=225,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["target","writeUInt8",1]),a.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),a.prototype.fieldSpec.push(["addr_len","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_ERASE",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_ERASE",l.prototype.msg_type=226,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("target").uint32("sector_num"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["target","writeUInt8",1]),l.prototype.fieldSpec.push(["sector_num","writeUInt32LE",4]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_STM_FLASH_LOCK_SECTOR",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_STM_FLASH_LOCK_SECTOR",c.prototype.msg_type=227,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("sector"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["sector","writeUInt32LE",4]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_STM_FLASH_UNLOCK_SECTOR",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_STM_FLASH_UNLOCK_SECTOR",u.prototype.msg_type=228,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("sector"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["sector","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_STM_UNIQUE_ID_REQ",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_STM_UNIQUE_ID_REQ",y.prototype.msg_type=232,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_STM_UNIQUE_ID_RESP",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_STM_UNIQUE_ID_RESP",f.prototype.msg_type=229,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("stm_id",{length:12,type:"uint8"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["stm_id","array","writeUInt8",function(){return 1},12]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_M25_FLASH_WRITE_STATUS",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_M25_FLASH_WRITE_STATUS",h.prototype.msg_type=243,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").array("status",{length:1,type:"uint8"}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["status","array","writeUInt8",function(){return 1},1]),e.exports={230:i,MsgFlashProgram:i,224:s,MsgFlashDone:s,231:n,MsgFlashReadReq:n,225:a,MsgFlashReadResp:a,226:l,MsgFlashErase:l,227:c,MsgStmFlashLockSector:c,228:u,MsgStmFlashUnlockSector:u,232:y,MsgStmUniqueIdReq:y,229:f,MsgStmUniqueIdResp:f,243:h,MsgM25FlashWriteStatus:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_IMU_RAW",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_IMU_RAW",i.prototype.msg_type=2304,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint8("tow_f").int16("acc_x").int16("acc_y").int16("acc_z").int16("gyr_x").int16("gyr_y").int16("gyr_z"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["tow_f","writeUInt8",1]),i.prototype.fieldSpec.push(["acc_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["acc_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["acc_z","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_z","writeInt16LE",2]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_IMU_AUX",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_IMU_AUX",s.prototype.msg_type=2305,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("imu_type").int16("temp").uint8("imu_conf"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["imu_type","writeUInt8",1]),s.prototype.fieldSpec.push(["temp","writeInt16LE",2]),s.prototype.fieldSpec.push(["imu_conf","writeUInt8",1]),e.exports={2304:i,MsgImuRaw:i,2305:s,MsgImuAux:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal,p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec),s=p(0).SvId,n=function(e,t){return r.call(this,e),this.messageType="IntegritySSRHeader",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="IntegritySSRHeader",n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").uint8("chain_id"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),n.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),n.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),n.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),n.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),n.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),n.prototype.fieldSpec.push(["chain_id","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_HIGH_LEVEL",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_HIGH_LEVEL",a.prototype.msg_type=3001,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).nest("corr_time",{type:i.prototype.parser}).uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").uint8("chain_id").uint8("use_gps_sat").uint8("use_gal_sat").uint8("use_bds_sat").array("reserved",{length:6,type:"uint8"}).uint8("use_tropo_grid_points").uint8("use_iono_grid_points").uint8("use_iono_tile_sat_los").uint8("use_iono_grid_point_sat_los"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),a.prototype.fieldSpec.push(["corr_time",i.prototype.fieldSpec]),a.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),a.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),a.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),a.prototype.fieldSpec.push(["chain_id","writeUInt8",1]),a.prototype.fieldSpec.push(["use_gps_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["use_gal_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["use_bds_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["reserved","array","writeUInt8",function(){return 1},6]),a.prototype.fieldSpec.push(["use_tropo_grid_points","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_grid_points","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_tile_sat_los","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_grid_point_sat_los","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_SATELLITES",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_SATELLITES",l.prototype.msg_type=3005,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("ssr_sol_id").uint8("chain_id").uint8("const_id").uint8("n_faulty_sats").array("faulty_sats",{type:"uint8",length:"n_faulty_sats"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),l.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),l.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),l.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),l.prototype.fieldSpec.push(["chain_id","writeUInt8",1]),l.prototype.fieldSpec.push(["const_id","writeUInt8",1]),l.prototype.fieldSpec.push(["n_faulty_sats","writeUInt8",1]),l.prototype.fieldSpec.push(["faulty_sats","array","writeUInt8",function(){return 1},"n_faulty_sats"]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_TROPO_GRID_POINTS",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_TROPO_GRID_POINTS",c.prototype.msg_type=3011,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_points").array("faulty_points",{type:"uint16le",length:"n_faulty_points"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),c.prototype.fieldSpec.push(["n_faulty_points","writeUInt8",1]),c.prototype.fieldSpec.push(["faulty_points","array","writeUInt16LE",function(){return 2},"n_faulty_points"]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_GRID_POINTS",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_GRID_POINTS",u.prototype.msg_type=3015,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_points").array("faulty_points",{type:"uint16le",length:"n_faulty_points"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),u.prototype.fieldSpec.push(["n_faulty_points","writeUInt8",1]),u.prototype.fieldSpec.push(["faulty_points","array","writeUInt16LE",function(){return 2},"n_faulty_points"]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_TILE_SAT_LOS",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_TILE_SAT_LOS",y.prototype.msg_type=3021,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_los").array("faulty_los",{type:s.prototype.parser,length:"n_faulty_los"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),y.prototype.fieldSpec.push(["n_faulty_los","writeUInt8",1]),y.prototype.fieldSpec.push(["faulty_los","array",s.prototype.fieldSpec,function(){return this.fields.array.length},"n_faulty_los"]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS",f.prototype.msg_type=3025,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint16("grid_point_id").uint8("n_faulty_los").array("faulty_los",{type:s.prototype.parser,length:"n_faulty_los"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),f.prototype.fieldSpec.push(["grid_point_id","writeUInt16LE",2]),f.prototype.fieldSpec.push(["n_faulty_los","writeUInt8",1]),f.prototype.fieldSpec.push(["faulty_los","array",s.prototype.fieldSpec,function(){return this.fields.array.length},"n_faulty_los"]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_ACKNOWLEDGE",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_ACKNOWLEDGE",h.prototype.msg_type=3026,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("request_id").uint32("area_id").uint8("response_code").uint16("correction_mask_on_demand").uint16("correction_mask_stream").uint8("solution_id"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["request_id","writeUInt8",1]),h.prototype.fieldSpec.push(["area_id","writeUInt32LE",4]),h.prototype.fieldSpec.push(["response_code","writeUInt8",1]),h.prototype.fieldSpec.push(["correction_mask_on_demand","writeUInt16LE",2]),h.prototype.fieldSpec.push(["correction_mask_stream","writeUInt16LE",2]),h.prototype.fieldSpec.push(["solution_id","writeUInt8",1]),e.exports={IntegritySSRHeader:n,3001:a,MsgSsrFlagHighLevel:a,3005:l,MsgSsrFlagSatellites:l,3011:c,MsgSsrFlagTropoGridPoints:c,3015:u,MsgSsrFlagIonoGridPoints:u,3021:y,MsgSsrFlagIonoTileSatLos:y,3025:f,MsgSsrFlagIonoGridPointSatLos:f,3026:h,MsgAcknowledge:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_CPU_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_CPU_STATE_DEP_A",i.prototype.msg_type=32512,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pcpu").string("tname",{length:15}).string("cmdline",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["index","writeUInt8",1]),i.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),i.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),i.prototype.fieldSpec.push(["tname","string",15]),i.prototype.fieldSpec.push(["cmdline","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_MEM_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_MEM_STATE_DEP_A",s.prototype.msg_type=32513,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pmem").string("tname",{length:15}).string("cmdline",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["index","writeUInt8",1]),s.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),s.prototype.fieldSpec.push(["pmem","writeUInt8",1]),s.prototype.fieldSpec.push(["tname","string",15]),s.prototype.fieldSpec.push(["cmdline","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SYS_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SYS_STATE_DEP_A",n.prototype.msg_type=32514,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint16("mem_total").uint8("pcpu").uint8("pmem").uint16("procs_starting").uint16("procs_stopping").uint16("pid_count"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["mem_total","writeUInt16LE",2]),n.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),n.prototype.fieldSpec.push(["pmem","writeUInt8",1]),n.prototype.fieldSpec.push(["procs_starting","writeUInt16LE",2]),n.prototype.fieldSpec.push(["procs_stopping","writeUInt16LE",2]),n.prototype.fieldSpec.push(["pid_count","writeUInt16LE",2]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_SOCKET_COUNTS",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_SOCKET_COUNTS",a.prototype.msg_type=32515,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("socket_count").uint16("socket_types").uint16("socket_states").string("cmdline",{greedy:!0}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["index","writeUInt8",1]),a.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_count","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_types","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_states","writeUInt16LE",2]),a.prototype.fieldSpec.push(["cmdline","string",null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_SOCKET_QUEUES",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_SOCKET_QUEUES",l.prototype.msg_type=32516,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("recv_queued").uint16("send_queued").uint16("socket_types").uint16("socket_states").string("address_of_largest",{length:64}).string("cmdline",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["index","writeUInt8",1]),l.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),l.prototype.fieldSpec.push(["recv_queued","writeUInt16LE",2]),l.prototype.fieldSpec.push(["send_queued","writeUInt16LE",2]),l.prototype.fieldSpec.push(["socket_types","writeUInt16LE",2]),l.prototype.fieldSpec.push(["socket_states","writeUInt16LE",2]),l.prototype.fieldSpec.push(["address_of_largest","string",64]),l.prototype.fieldSpec.push(["cmdline","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SOCKET_USAGE",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SOCKET_USAGE",c.prototype.msg_type=32517,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("avg_queue_depth").uint32("max_queue_depth").array("socket_state_counts",{length:16,type:"uint16le"}).array("socket_type_counts",{length:16,type:"uint16le"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["avg_queue_depth","writeUInt32LE",4]),c.prototype.fieldSpec.push(["max_queue_depth","writeUInt32LE",4]),c.prototype.fieldSpec.push(["socket_state_counts","array","writeUInt16LE",function(){return 2},16]),c.prototype.fieldSpec.push(["socket_type_counts","array","writeUInt16LE",function(){return 2},16]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_FD_COUNT",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_FD_COUNT",u.prototype.msg_type=32518,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("fd_count").string("cmdline",{greedy:!0}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["index","writeUInt8",1]),u.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),u.prototype.fieldSpec.push(["fd_count","writeUInt16LE",2]),u.prototype.fieldSpec.push(["cmdline","string",null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_FD_SUMMARY",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_FD_SUMMARY",y.prototype.msg_type=32519,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("sys_fd_count").string("most_opened",{greedy:!0}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sys_fd_count","writeUInt32LE",4]),y.prototype.fieldSpec.push(["most_opened","string",null]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_CPU_STATE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_CPU_STATE",f.prototype.msg_type=32520,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pcpu").uint32("time").uint8("flags").string("tname",{length:15}).string("cmdline",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["index","writeUInt8",1]),f.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),f.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),f.prototype.fieldSpec.push(["time","writeUInt32LE",4]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]),f.prototype.fieldSpec.push(["tname","string",15]),f.prototype.fieldSpec.push(["cmdline","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_MEM_STATE",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_MEM_STATE",h.prototype.msg_type=32521,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pmem").uint32("time").uint8("flags").string("tname",{length:15}).string("cmdline",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["index","writeUInt8",1]),h.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),h.prototype.fieldSpec.push(["pmem","writeUInt8",1]),h.prototype.fieldSpec.push(["time","writeUInt32LE",4]),h.prototype.fieldSpec.push(["flags","writeUInt8",1]),h.prototype.fieldSpec.push(["tname","string",15]),h.prototype.fieldSpec.push(["cmdline","string",null]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SYS_STATE",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SYS_STATE",d.prototype.msg_type=32522,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint16("mem_total").uint8("pcpu").uint8("pmem").uint16("procs_starting").uint16("procs_stopping").uint16("pid_count").uint32("time").uint8("flags"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["mem_total","writeUInt16LE",2]),d.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),d.prototype.fieldSpec.push(["pmem","writeUInt8",1]),d.prototype.fieldSpec.push(["procs_starting","writeUInt16LE",2]),d.prototype.fieldSpec.push(["procs_stopping","writeUInt16LE",2]),d.prototype.fieldSpec.push(["pid_count","writeUInt16LE",2]),d.prototype.fieldSpec.push(["time","writeUInt32LE",4]),d.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={32512:i,MsgLinuxCpuStateDepA:i,32513:s,MsgLinuxMemStateDepA:s,32514:n,MsgLinuxSysStateDepA:n,32515:a,MsgLinuxProcessSocketCounts:a,32516:l,MsgLinuxProcessSocketQueues:l,32517:c,MsgLinuxSocketUsage:c,32518:u,MsgLinuxProcessFdCount:u,32519:y,MsgLinuxProcessFdSummary:y,32520:f,MsgLinuxCpuState:f,32521:h,MsgLinuxMemState:h,32522:d,MsgLinuxSysState:d}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_LOG",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_LOG",i.prototype.msg_type=1025,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("level").string("text",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["level","writeUInt8",1]),i.prototype.fieldSpec.push(["text","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FWD",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FWD",s.prototype.msg_type=1026,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("source").uint8("protocol").array("fwd_payload",{type:"uint8",readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["source","writeUInt8",1]),s.prototype.fieldSpec.push(["protocol","writeUInt8",1]),s.prototype.fieldSpec.push(["fwd_payload","array","writeUInt8",function(){return 1},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_PRINT_DEP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_PRINT_DEP",n.prototype.msg_type=16,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").string("text",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["text","string",null]),e.exports={1025:i,MsgLog:i,1026:s,MsgFwd:s,16:n,MsgPrintDep:n}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_MAG_RAW",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_MAG_RAW",i.prototype.msg_type=2306,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint8("tow_f").int16("mag_x").int16("mag_y").int16("mag_z"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["tow_f","writeUInt8",1]),i.prototype.fieldSpec.push(["mag_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["mag_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["mag_z","writeInt16LE",2]),e.exports={2306:i,MsgMagRaw:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME",i.prototype.msg_type=258,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME_GNSS",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME_GNSS",s.prototype.msg_type=260,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_TIME",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_UTC_TIME",n.prototype.msg_type=259,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("flags").uint32("tow").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["flags","writeUInt8",1]),n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["year","writeUInt16LE",2]),n.prototype.fieldSpec.push(["month","writeUInt8",1]),n.prototype.fieldSpec.push(["day","writeUInt8",1]),n.prototype.fieldSpec.push(["hours","writeUInt8",1]),n.prototype.fieldSpec.push(["minutes","writeUInt8",1]),n.prototype.fieldSpec.push(["seconds","writeUInt8",1]),n.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_TIME_GNSS",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_UTC_TIME_GNSS",a.prototype.msg_type=261,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("flags").uint32("tow").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["flags","writeUInt8",1]),a.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),a.prototype.fieldSpec.push(["year","writeUInt16LE",2]),a.prototype.fieldSpec.push(["month","writeUInt8",1]),a.prototype.fieldSpec.push(["day","writeUInt8",1]),a.prototype.fieldSpec.push(["hours","writeUInt8",1]),a.prototype.fieldSpec.push(["minutes","writeUInt8",1]),a.prototype.fieldSpec.push(["seconds","writeUInt8",1]),a.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_DOPS",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_DOPS",l.prototype.msg_type=520,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint32("tow").uint16("gdop").uint16("pdop").uint16("tdop").uint16("hdop").uint16("vdop").uint8("flags"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),l.prototype.fieldSpec.push(["gdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["tdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["flags","writeUInt8",1]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF",c.prototype.msg_type=521,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),c.prototype.fieldSpec.push(["x","writeDoubleLE",8]),c.prototype.fieldSpec.push(["y","writeDoubleLE",8]),c.prototype.fieldSpec.push(["z","writeDoubleLE",8]),c.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),c.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),c.prototype.fieldSpec.push(["flags","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_COV",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_COV",u.prototype.msg_type=532,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),u.prototype.fieldSpec.push(["x","writeDoubleLE",8]),u.prototype.fieldSpec.push(["y","writeDoubleLE",8]),u.prototype.fieldSpec.push(["z","writeDoubleLE",8]),u.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),u.prototype.fieldSpec.push(["flags","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH",y.prototype.msg_type=522,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),y.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),y.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),y.prototype.fieldSpec.push(["height","writeDoubleLE",8]),y.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),y.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),y.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),y.prototype.fieldSpec.push(["flags","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_COV",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_COV",f.prototype.msg_type=529,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),f.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),f.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),f.prototype.fieldSpec.push(["height","writeDoubleLE",8]),f.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]);let h=function(e,t){return r.call(this,e),this.messageType="EstimatedHorizontalErrorEllipse",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="EstimatedHorizontalErrorEllipse",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").floatle("semi_major").floatle("semi_minor").floatle("orientation"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["semi_major","writeFloatLE",4]),h.prototype.fieldSpec.push(["semi_minor","writeFloatLE",4]),h.prototype.fieldSpec.push(["orientation","writeFloatLE",4]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_ACC",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_ACC",d.prototype.msg_type=536,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").doublele("orthometric_height").floatle("h_accuracy").floatle("v_accuracy").floatle("ct_accuracy").floatle("at_accuracy").nest("h_ellipse",{type:h.prototype.parser}).uint8("confidence_and_geoid").uint8("n_sats").uint8("flags"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),d.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),d.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),d.prototype.fieldSpec.push(["height","writeDoubleLE",8]),d.prototype.fieldSpec.push(["orthometric_height","writeDoubleLE",8]),d.prototype.fieldSpec.push(["h_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["v_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["ct_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["at_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["h_ellipse",h.prototype.fieldSpec]),d.prototype.fieldSpec.push(["confidence_and_geoid","writeUInt8",1]),d.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),d.prototype.fieldSpec.push(["flags","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_ECEF",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_ECEF",_.prototype.msg_type=523,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),_.prototype.fieldSpec.push(["x","writeInt32LE",4]),_.prototype.fieldSpec.push(["y","writeInt32LE",4]),_.prototype.fieldSpec.push(["z","writeInt32LE",4]),_.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),_.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),_.prototype.fieldSpec.push(["flags","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_NED",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_NED",S.prototype.msg_type=524,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),S.prototype.fieldSpec.push(["n","writeInt32LE",4]),S.prototype.fieldSpec.push(["e","writeInt32LE",4]),S.prototype.fieldSpec.push(["d","writeInt32LE",4]),S.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),S.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),S.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),S.prototype.fieldSpec.push(["flags","writeUInt8",1]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF",g.prototype.msg_type=525,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),g.prototype.fieldSpec.push(["x","writeInt32LE",4]),g.prototype.fieldSpec.push(["y","writeInt32LE",4]),g.prototype.fieldSpec.push(["z","writeInt32LE",4]),g.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),g.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),g.prototype.fieldSpec.push(["flags","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_COV",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_COV",w.prototype.msg_type=533,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),w.prototype.fieldSpec.push(["x","writeInt32LE",4]),w.prototype.fieldSpec.push(["y","writeInt32LE",4]),w.prototype.fieldSpec.push(["z","writeInt32LE",4]),w.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),w.prototype.fieldSpec.push(["flags","writeUInt8",1]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED",E.prototype.msg_type=526,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),E.prototype.fieldSpec.push(["n","writeInt32LE",4]),E.prototype.fieldSpec.push(["e","writeInt32LE",4]),E.prototype.fieldSpec.push(["d","writeInt32LE",4]),E.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),E.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),E.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),E.prototype.fieldSpec.push(["flags","writeUInt8",1]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_COV",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_COV",m.prototype.msg_type=530,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),m.prototype.fieldSpec.push(["n","writeInt32LE",4]),m.prototype.fieldSpec.push(["e","writeInt32LE",4]),m.prototype.fieldSpec.push(["d","writeInt32LE",4]),m.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),m.prototype.fieldSpec.push(["flags","writeUInt8",1]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_GNSS",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_GNSS",b.prototype.msg_type=553,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),b.prototype.fieldSpec.push(["x","writeDoubleLE",8]),b.prototype.fieldSpec.push(["y","writeDoubleLE",8]),b.prototype.fieldSpec.push(["z","writeDoubleLE",8]),b.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),b.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),b.prototype.fieldSpec.push(["flags","writeUInt8",1]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_COV_GNSS",I.prototype.msg_type=564,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),I.prototype.fieldSpec.push(["x","writeDoubleLE",8]),I.prototype.fieldSpec.push(["y","writeDoubleLE",8]),I.prototype.fieldSpec.push(["z","writeDoubleLE",8]),I.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),I.prototype.fieldSpec.push(["flags","writeUInt8",1]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_GNSS",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_GNSS",L.prototype.msg_type=554,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),L.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),L.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),L.prototype.fieldSpec.push(["height","writeDoubleLE",8]),L.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),L.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),L.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),L.prototype.fieldSpec.push(["flags","writeUInt8",1]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_COV_GNSS",T.prototype.msg_type=561,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),T.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),T.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),T.prototype.fieldSpec.push(["height","writeDoubleLE",8]),T.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),T.prototype.fieldSpec.push(["flags","writeUInt8",1]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_GNSS",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_GNSS",v.prototype.msg_type=557,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),v.prototype.fieldSpec.push(["x","writeInt32LE",4]),v.prototype.fieldSpec.push(["y","writeInt32LE",4]),v.prototype.fieldSpec.push(["z","writeInt32LE",4]),v.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),v.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),v.prototype.fieldSpec.push(["flags","writeUInt8",1]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_COV_GNSS",U.prototype.msg_type=565,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),U.prototype.fieldSpec.push(["x","writeInt32LE",4]),U.prototype.fieldSpec.push(["y","writeInt32LE",4]),U.prototype.fieldSpec.push(["z","writeInt32LE",4]),U.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),U.prototype.fieldSpec.push(["flags","writeUInt8",1]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_GNSS",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_GNSS",M.prototype.msg_type=558,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),M.prototype.fieldSpec.push(["n","writeInt32LE",4]),M.prototype.fieldSpec.push(["e","writeInt32LE",4]),M.prototype.fieldSpec.push(["d","writeInt32LE",4]),M.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),M.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),M.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),M.prototype.fieldSpec.push(["flags","writeUInt8",1]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_COV_GNSS",D.prototype.msg_type=562,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),D.prototype.fieldSpec.push(["n","writeInt32LE",4]),D.prototype.fieldSpec.push(["e","writeInt32LE",4]),D.prototype.fieldSpec.push(["d","writeInt32LE",4]),D.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),D.prototype.fieldSpec.push(["flags","writeUInt8",1]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_BODY",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_VEL_BODY",O.prototype.msg_type=531,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),O.prototype.fieldSpec.push(["x","writeInt32LE",4]),O.prototype.fieldSpec.push(["y","writeInt32LE",4]),O.prototype.fieldSpec.push(["z","writeInt32LE",4]),O.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),O.prototype.fieldSpec.push(["flags","writeUInt8",1]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_COG",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_VEL_COG",G.prototype.msg_type=540,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").uint32("tow").uint32("cog").uint32("sog").int32("v_up").uint32("cog_accuracy").uint32("sog_accuracy").uint32("v_up_accuracy").uint16("flags"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),G.prototype.fieldSpec.push(["cog","writeUInt32LE",4]),G.prototype.fieldSpec.push(["sog","writeUInt32LE",4]),G.prototype.fieldSpec.push(["v_up","writeInt32LE",4]),G.prototype.fieldSpec.push(["cog_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["sog_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["v_up_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["flags","writeUInt16LE",2]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_AGE_CORRECTIONS",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_AGE_CORRECTIONS",A.prototype.msg_type=528,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").uint32("tow").uint16("age"),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),A.prototype.fieldSpec.push(["age","writeUInt16LE",2]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME_DEP_A",C.prototype.msg_type=256,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),C.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),C.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),C.prototype.fieldSpec.push(["flags","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_DOPS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_DOPS_DEP_A",R.prototype.msg_type=518,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").uint32("tow").uint16("gdop").uint16("pdop").uint16("tdop").uint16("hdop").uint16("vdop"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),R.prototype.fieldSpec.push(["gdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["tdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_DEP_A",P.prototype.msg_type=512,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),P.prototype.fieldSpec.push(["x","writeDoubleLE",8]),P.prototype.fieldSpec.push(["y","writeDoubleLE",8]),P.prototype.fieldSpec.push(["z","writeDoubleLE",8]),P.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),P.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),P.prototype.fieldSpec.push(["flags","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_DEP_A",N.prototype.msg_type=513,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),N.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),N.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),N.prototype.fieldSpec.push(["height","writeDoubleLE",8]),N.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),N.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),N.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),N.prototype.fieldSpec.push(["flags","writeUInt8",1]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_ECEF_DEP_A",j.prototype.msg_type=514,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),j.prototype.fieldSpec.push(["x","writeInt32LE",4]),j.prototype.fieldSpec.push(["y","writeInt32LE",4]),j.prototype.fieldSpec.push(["z","writeInt32LE",4]),j.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),j.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),j.prototype.fieldSpec.push(["flags","writeUInt8",1]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_NED_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_NED_DEP_A",x.prototype.msg_type=515,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),x.prototype.fieldSpec.push(["n","writeInt32LE",4]),x.prototype.fieldSpec.push(["e","writeInt32LE",4]),x.prototype.fieldSpec.push(["d","writeInt32LE",4]),x.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),x.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),x.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),x.prototype.fieldSpec.push(["flags","writeUInt8",1]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_DEP_A",F.prototype.msg_type=516,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),F.prototype.fieldSpec.push(["x","writeInt32LE",4]),F.prototype.fieldSpec.push(["y","writeInt32LE",4]),F.prototype.fieldSpec.push(["z","writeInt32LE",4]),F.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),F.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),F.prototype.fieldSpec.push(["flags","writeUInt8",1]);let k=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_DEP_A",k.prototype.msg_type=517,k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),k.prototype.fieldSpec.push(["n","writeInt32LE",4]),k.prototype.fieldSpec.push(["e","writeInt32LE",4]),k.prototype.fieldSpec.push(["d","writeInt32LE",4]),k.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),k.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),k.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),k.prototype.fieldSpec.push(["flags","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_HEADING_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_HEADING_DEP_A",B.prototype.msg_type=519,B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").uint32("tow").uint32("heading").uint8("n_sats").uint8("flags"),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),B.prototype.fieldSpec.push(["heading","writeUInt32LE",4]),B.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),B.prototype.fieldSpec.push(["flags","writeUInt8",1]);let q=function(e,t){return r.call(this,e),this.messageType="MSG_PROTECTION_LEVEL_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="MSG_PROTECTION_LEVEL_DEP_A",q.prototype.msg_type=534,q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint32("tow").uint16("vpl").uint16("hpl").doublele("lat").doublele("lon").doublele("height").uint8("flags"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),q.prototype.fieldSpec.push(["vpl","writeUInt16LE",2]),q.prototype.fieldSpec.push(["hpl","writeUInt16LE",2]),q.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),q.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),q.prototype.fieldSpec.push(["height","writeDoubleLE",8]),q.prototype.fieldSpec.push(["flags","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="MSG_PROTECTION_LEVEL",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="MSG_PROTECTION_LEVEL",z.prototype.msg_type=535,z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").uint32("tow").int16("wn").uint16("hpl").uint16("vpl").uint16("atpl").uint16("ctpl").uint16("hvpl").uint16("vvpl").uint16("hopl").uint16("popl").uint16("ropl").doublele("lat").doublele("lon").doublele("height").int32("v_x").int32("v_y").int32("v_z").int32("roll").int32("pitch").int32("heading").uint32("flags"),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),z.prototype.fieldSpec.push(["wn","writeInt16LE",2]),z.prototype.fieldSpec.push(["hpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["vpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["atpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["ctpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["hvpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["vvpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["hopl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["popl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["ropl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),z.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),z.prototype.fieldSpec.push(["height","writeDoubleLE",8]),z.prototype.fieldSpec.push(["v_x","writeInt32LE",4]),z.prototype.fieldSpec.push(["v_y","writeInt32LE",4]),z.prototype.fieldSpec.push(["v_z","writeInt32LE",4]),z.prototype.fieldSpec.push(["roll","writeInt32LE",4]),z.prototype.fieldSpec.push(["pitch","writeInt32LE",4]),z.prototype.fieldSpec.push(["heading","writeInt32LE",4]),z.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let H=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_LEAP_SECOND",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="MSG_UTC_LEAP_SECOND",H.prototype.msg_type=570,H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").int16("reserved_0").int16("reserved_1").int8("reserved_2").int8("count_before").uint16("reserved_3").uint16("reserved_4").uint16("ref_wn").uint8("ref_dn").int8("count_after"),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["reserved_0","writeInt16LE",2]),H.prototype.fieldSpec.push(["reserved_1","writeInt16LE",2]),H.prototype.fieldSpec.push(["reserved_2","writeInt8",1]),H.prototype.fieldSpec.push(["count_before","writeInt8",1]),H.prototype.fieldSpec.push(["reserved_3","writeUInt16LE",2]),H.prototype.fieldSpec.push(["reserved_4","writeUInt16LE",2]),H.prototype.fieldSpec.push(["ref_wn","writeUInt16LE",2]),H.prototype.fieldSpec.push(["ref_dn","writeUInt8",1]),H.prototype.fieldSpec.push(["count_after","writeInt8",1]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_REFERENCE_FRAME_PARAM",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_REFERENCE_FRAME_PARAM",V.prototype.msg_type=580,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").uint8("ssr_iod").string("sn",{length:32}).string("tn",{length:32}).uint8("sin").uint16("utn").uint16("re_t0").int32("delta_X0").int32("delta_Y0").int32("delta_Z0").int32("theta_01").int32("theta_02").int32("theta_03").int32("scale").int32("dot_delta_X0").int32("dot_delta_Y0").int32("dot_delta_Z0").int32("dot_theta_01").int32("dot_theta_02").int32("dot_theta_03").int16("dot_scale"),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),V.prototype.fieldSpec.push(["sn","string",32]),V.prototype.fieldSpec.push(["tn","string",32]),V.prototype.fieldSpec.push(["sin","writeUInt8",1]),V.prototype.fieldSpec.push(["utn","writeUInt16LE",2]),V.prototype.fieldSpec.push(["re_t0","writeUInt16LE",2]),V.prototype.fieldSpec.push(["delta_X0","writeInt32LE",4]),V.prototype.fieldSpec.push(["delta_Y0","writeInt32LE",4]),V.prototype.fieldSpec.push(["delta_Z0","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_01","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_02","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_03","writeInt32LE",4]),V.prototype.fieldSpec.push(["scale","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_X0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_Y0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_Z0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_01","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_02","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_03","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_scale","writeInt16LE",2]);let Y=function(e,t){return r.call(this,e),this.messageType="MSG_POSE_RELATIVE",this.fields=t||this.parser.parse(e.payload),this};(Y.prototype=Object.create(r.prototype)).messageType="MSG_POSE_RELATIVE",Y.prototype.msg_type=581,Y.prototype.constructor=Y,Y.prototype.parser=(new o).endianess("little").uint32("tow").uint8("sensor_id").uint32("timestamp_1").uint32("timestamp_2").array("trans",{length:3,type:"int32le"}).int32("w").int32("x").int32("y").int32("z").floatle("cov_r_x_x").floatle("cov_r_x_y").floatle("cov_r_x_z").floatle("cov_r_y_y").floatle("cov_r_y_z").floatle("cov_r_z_z").floatle("cov_c_x_x").floatle("cov_c_x_y").floatle("cov_c_x_z").floatle("cov_c_y_y").floatle("cov_c_y_z").floatle("cov_c_z_z").uint8("flags"),Y.prototype.fieldSpec=[],Y.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["sensor_id","writeUInt8",1]),Y.prototype.fieldSpec.push(["timestamp_1","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["timestamp_2","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["trans","array","writeInt32LE",function(){return 4},3]),Y.prototype.fieldSpec.push(["w","writeInt32LE",4]),Y.prototype.fieldSpec.push(["x","writeInt32LE",4]),Y.prototype.fieldSpec.push(["y","writeInt32LE",4]),Y.prototype.fieldSpec.push(["z","writeInt32LE",4]),Y.prototype.fieldSpec.push(["cov_r_x_x","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_x_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_x_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_y_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_y_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_z_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_x","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_y_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_y_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_z_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={258:i,MsgGpsTime:i,260:s,MsgGpsTimeGnss:s,259:n,MsgUtcTime:n,261:a,MsgUtcTimeGnss:a,520:l,MsgDops:l,521:c,MsgPosEcef:c,532:u,MsgPosEcefCov:u,522:y,MsgPosLlh:y,529:f,MsgPosLlhCov:f,EstimatedHorizontalErrorEllipse:h,536:d,MsgPosLlhAcc:d,523:_,MsgBaselineEcef:_,524:S,MsgBaselineNed:S,525:g,MsgVelEcef:g,533:w,MsgVelEcefCov:w,526:E,MsgVelNed:E,530:m,MsgVelNedCov:m,553:b,MsgPosEcefGnss:b,564:I,MsgPosEcefCovGnss:I,554:L,MsgPosLlhGnss:L,561:T,MsgPosLlhCovGnss:T,557:v,MsgVelEcefGnss:v,565:U,MsgVelEcefCovGnss:U,558:M,MsgVelNedGnss:M,562:D,MsgVelNedCovGnss:D,531:O,MsgVelBody:O,540:G,MsgVelCog:G,528:A,MsgAgeCorrections:A,256:C,MsgGpsTimeDepA:C,518:R,MsgDopsDepA:R,512:P,MsgPosEcefDepA:P,513:N,MsgPosLlhDepA:N,514:j,MsgBaselineEcefDepA:j,515:x,MsgBaselineNedDepA:x,516:F,MsgVelEcefDepA:F,517:k,MsgVelNedDepA:k,519:B,MsgBaselineHeadingDepA:B,534:q,MsgProtectionLevelDepA:q,535:z,MsgProtectionLevel:z,570:H,MsgUtcLeapSecond:H,580:V,MsgReferenceFrameParam:V,581:Y,MsgPoseRelative:Y}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_NDB_EVENT",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="MSG_NDB_EVENT",s.prototype.msg_type=1024,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint64("recv_time").uint8("event").uint8("object_type").uint8("result").uint8("data_source").nest("object_sid",{type:i.prototype.parser}).nest("src_sid",{type:i.prototype.parser}).uint16("original_sender"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),s.prototype.fieldSpec.push(["event","writeUInt8",1]),s.prototype.fieldSpec.push(["object_type","writeUInt8",1]),s.prototype.fieldSpec.push(["result","writeUInt8",1]),s.prototype.fieldSpec.push(["data_source","writeUInt8",1]),s.prototype.fieldSpec.push(["object_sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["src_sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["original_sender","writeUInt16LE",2]),e.exports={1024:s,MsgNdbEvent:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase),s=p(0).GnssSignal,n=p(0).GnssSignalDep,a=p(0).GPSTime,l=p(0).GPSTimeDep,c=p(0).GPSTimeSec,u=(p(0).SvId,function(e,t){return r.call(this,e),this.messageType="ObservationHeader",this.fields=t||this.parser.parse(e.payload),this});(u.prototype=Object.create(r.prototype)).messageType="ObservationHeader",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").nest("t",{type:a.prototype.parser}).uint8("n_obs"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["t",a.prototype.fieldSpec]),u.prototype.fieldSpec.push(["n_obs","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="Doppler",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="Doppler",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").int16("i").uint8("f"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["i","writeInt16LE",2]),y.prototype.fieldSpec.push(["f","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="PackedObsContent",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="PackedObsContent",f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).nest("D",{type:y.prototype.parser}).uint8("cn0").uint8("lock").uint8("flags").nest("sid",{type:s.prototype.parser}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["P","writeUInt32LE",4]),f.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),f.prototype.fieldSpec.push(["D",y.prototype.fieldSpec]),f.prototype.fieldSpec.push(["cn0","writeUInt8",1]),f.prototype.fieldSpec.push(["lock","writeUInt8",1]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]),f.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let h=function(e,t){return r.call(this,e),this.messageType="PackedOsrContent",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="PackedOsrContent",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).uint8("lock").uint8("flags").nest("sid",{type:s.prototype.parser}).uint16("iono_std").uint16("tropo_std").uint16("range_std"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["P","writeUInt32LE",4]),h.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),h.prototype.fieldSpec.push(["lock","writeUInt8",1]),h.prototype.fieldSpec.push(["flags","writeUInt8",1]),h.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),h.prototype.fieldSpec.push(["iono_std","writeUInt16LE",2]),h.prototype.fieldSpec.push(["tropo_std","writeUInt16LE",2]),h.prototype.fieldSpec.push(["range_std","writeUInt16LE",2]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_OBS",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_OBS",d.prototype.msg_type=74,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).array("obs",{type:f.prototype.parser,readUntil:"eof"}),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),d.prototype.fieldSpec.push(["obs","array",f.prototype.fieldSpec,function(){return this.fields.array.length},null]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_BASE_POS_LLH",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_BASE_POS_LLH",_.prototype.msg_type=68,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").doublele("lat").doublele("lon").doublele("height"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),_.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),_.prototype.fieldSpec.push(["height","writeDoubleLE",8]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_BASE_POS_ECEF",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_BASE_POS_ECEF",S.prototype.msg_type=72,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").doublele("x").doublele("y").doublele("z"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["x","writeDoubleLE",8]),S.prototype.fieldSpec.push(["y","writeDoubleLE",8]),S.prototype.fieldSpec.push(["z","writeDoubleLE",8]);let g=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContent",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContent",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toe",{type:c.prototype.parser}).floatle("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),g.prototype.fieldSpec.push(["toe",c.prototype.fieldSpec]),g.prototype.fieldSpec.push(["ura","writeFloatLE",4]),g.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),g.prototype.fieldSpec.push(["valid","writeUInt8",1]),g.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContentDepB",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContentDepB",w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toe",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["toe",c.prototype.fieldSpec]),w.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),w.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),w.prototype.fieldSpec.push(["valid","writeUInt8",1]),w.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let E=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContentDepA",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContentDepA",E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").nest("sid",{type:n.prototype.parser}).nest("toe",{type:l.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),E.prototype.fieldSpec.push(["toe",l.prototype.fieldSpec]),E.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),E.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),E.prototype.fieldSpec.push(["valid","writeUInt8",1]),E.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS_DEP_E",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS_DEP_E",m.prototype.msg_type=129,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").nest("toc",{type:l.prototype.parser}).uint8("iode").uint16("iodc"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),m.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),m.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),m.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),m.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),m.prototype.fieldSpec.push(["w","writeDoubleLE",8]),m.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),m.prototype.fieldSpec.push(["toc",l.prototype.fieldSpec]),m.prototype.fieldSpec.push(["iode","writeUInt8",1]),m.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS_DEP_F",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS_DEP_F",b.prototype.msg_type=134,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),b.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),b.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),b.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),b.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),b.prototype.fieldSpec.push(["w","writeDoubleLE",8]),b.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),b.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),b.prototype.fieldSpec.push(["iode","writeUInt8",1]),b.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS",I.prototype.msg_type=138,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").floatle("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),I.prototype.fieldSpec.push(["tgd","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),I.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),I.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),I.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),I.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),I.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),I.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),I.prototype.fieldSpec.push(["w","writeDoubleLE",8]),I.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),I.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),I.prototype.fieldSpec.push(["af0","writeFloatLE",4]),I.prototype.fieldSpec.push(["af1","writeFloatLE",4]),I.prototype.fieldSpec.push(["af2","writeFloatLE",4]),I.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),I.prototype.fieldSpec.push(["iode","writeUInt8",1]),I.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_QZSS",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_QZSS",L.prototype.msg_type=142,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").floatle("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),L.prototype.fieldSpec.push(["tgd","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),L.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),L.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),L.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),L.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),L.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),L.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),L.prototype.fieldSpec.push(["w","writeDoubleLE",8]),L.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),L.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),L.prototype.fieldSpec.push(["af0","writeFloatLE",4]),L.prototype.fieldSpec.push(["af1","writeFloatLE",4]),L.prototype.fieldSpec.push(["af2","writeFloatLE",4]),L.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),L.prototype.fieldSpec.push(["iode","writeUInt8",1]),L.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_BDS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_BDS",T.prototype.msg_type=137,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd1").floatle("tgd2").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),T.prototype.fieldSpec.push(["tgd1","writeFloatLE",4]),T.prototype.fieldSpec.push(["tgd2","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),T.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),T.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),T.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),T.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),T.prototype.fieldSpec.push(["w","writeDoubleLE",8]),T.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),T.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),T.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["af1","writeFloatLE",4]),T.prototype.fieldSpec.push(["af2","writeFloatLE",4]),T.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),T.prototype.fieldSpec.push(["iode","writeUInt8",1]),T.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GAL_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GAL_DEP_A",v.prototype.msg_type=149,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("bgd_e1e5a").floatle("bgd_e1e5b").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint16("iode").uint16("iodc"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),v.prototype.fieldSpec.push(["bgd_e1e5a","writeFloatLE",4]),v.prototype.fieldSpec.push(["bgd_e1e5b","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),v.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),v.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),v.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),v.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),v.prototype.fieldSpec.push(["w","writeDoubleLE",8]),v.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),v.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af2","writeFloatLE",4]),v.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),v.prototype.fieldSpec.push(["iode","writeUInt16LE",2]),v.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GAL",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GAL",U.prototype.msg_type=141,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("bgd_e1e5a").floatle("bgd_e1e5b").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint16("iode").uint16("iodc").uint8("source"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),U.prototype.fieldSpec.push(["bgd_e1e5a","writeFloatLE",4]),U.prototype.fieldSpec.push(["bgd_e1e5b","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),U.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),U.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),U.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),U.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),U.prototype.fieldSpec.push(["w","writeDoubleLE",8]),U.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),U.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af2","writeFloatLE",4]),U.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),U.prototype.fieldSpec.push(["iode","writeUInt16LE",2]),U.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),U.prototype.fieldSpec.push(["source","writeUInt8",1]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS_DEP_A",M.prototype.msg_type=130,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).doublele("a_gf0").doublele("a_gf1"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),M.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["a_gf0","writeDoubleLE",8]),M.prototype.fieldSpec.push(["a_gf1","writeDoubleLE",8]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_A",D.prototype.msg_type=131,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).doublele("gamma").doublele("tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),D.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),D.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),D.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),D.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),D.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS_DEP_B",O.prototype.msg_type=132,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).doublele("a_gf0").doublele("a_gf1"),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),O.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["a_gf0","writeDoubleLE",8]),O.prototype.fieldSpec.push(["a_gf1","writeDoubleLE",8]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS",G.prototype.msg_type=140,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"floatle"}).array("acc",{length:3,type:"floatle"}).floatle("a_gf0").floatle("a_gf1"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),G.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),G.prototype.fieldSpec.push(["vel","array","writeFloatLE",function(){return 4},3]),G.prototype.fieldSpec.push(["acc","array","writeFloatLE",function(){return 4},3]),G.prototype.fieldSpec.push(["a_gf0","writeFloatLE",4]),G.prototype.fieldSpec.push(["a_gf1","writeFloatLE",4]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_B",A.prototype.msg_type=133,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),A.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),A.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),A.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),A.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),A.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_C",C.prototype.msg_type=135,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").doublele("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).uint8("fcn"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),C.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),C.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),C.prototype.fieldSpec.push(["d_tau","writeDoubleLE",8]),C.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["fcn","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_D",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_D",R.prototype.msg_type=136,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").doublele("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).uint8("fcn").uint8("iod"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),R.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),R.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),R.prototype.fieldSpec.push(["d_tau","writeDoubleLE",8]),R.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["fcn","writeUInt8",1]),R.prototype.fieldSpec.push(["iod","writeUInt8",1]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO",P.prototype.msg_type=139,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("gamma").floatle("tau").floatle("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"floatle"}).uint8("fcn").uint8("iod"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),P.prototype.fieldSpec.push(["gamma","writeFloatLE",4]),P.prototype.fieldSpec.push(["tau","writeFloatLE",4]),P.prototype.fieldSpec.push(["d_tau","writeFloatLE",4]),P.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),P.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),P.prototype.fieldSpec.push(["acc","array","writeFloatLE",function(){return 4},3]),P.prototype.fieldSpec.push(["fcn","writeUInt8",1]),P.prototype.fieldSpec.push(["iod","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_D",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_D",N.prototype.msg_type=128,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").nest("sid",{type:n.prototype.parser}).uint8("iode").uint16("iodc").uint32("reserved"),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),N.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),N.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),N.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),N.prototype.fieldSpec.push(["w","writeDoubleLE",8]),N.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),N.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),N.prototype.fieldSpec.push(["valid","writeUInt8",1]),N.prototype.fieldSpec.push(["healthy","writeUInt8",1]),N.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),N.prototype.fieldSpec.push(["iode","writeUInt8",1]),N.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),N.prototype.fieldSpec.push(["reserved","writeUInt32LE",4]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_A",j.prototype.msg_type=26,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").uint8("prn"),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),j.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),j.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),j.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),j.prototype.fieldSpec.push(["w","writeDoubleLE",8]),j.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),j.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),j.prototype.fieldSpec.push(["valid","writeUInt8",1]),j.prototype.fieldSpec.push(["healthy","writeUInt8",1]),j.prototype.fieldSpec.push(["prn","writeUInt8",1]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_B",x.prototype.msg_type=70,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").uint8("prn").uint8("iode"),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),x.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),x.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),x.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),x.prototype.fieldSpec.push(["w","writeDoubleLE",8]),x.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),x.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),x.prototype.fieldSpec.push(["valid","writeUInt8",1]),x.prototype.fieldSpec.push(["healthy","writeUInt8",1]),x.prototype.fieldSpec.push(["prn","writeUInt8",1]),x.prototype.fieldSpec.push(["iode","writeUInt8",1]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_C",F.prototype.msg_type=71,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").nest("sid",{type:n.prototype.parser}).uint8("iode").uint16("iodc").uint32("reserved"),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),F.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),F.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),F.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),F.prototype.fieldSpec.push(["w","writeDoubleLE",8]),F.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),F.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),F.prototype.fieldSpec.push(["valid","writeUInt8",1]),F.prototype.fieldSpec.push(["healthy","writeUInt8",1]),F.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),F.prototype.fieldSpec.push(["iode","writeUInt8",1]),F.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),F.prototype.fieldSpec.push(["reserved","writeUInt32LE",4]);let k=function(e,t){return r.call(this,e),this.messageType="ObservationHeaderDep",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="ObservationHeaderDep",k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").nest("t",{type:l.prototype.parser}).uint8("n_obs"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["t",l.prototype.fieldSpec]),k.prototype.fieldSpec.push(["n_obs","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="CarrierPhaseDepA",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="CarrierPhaseDepA",B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").int32("i").uint8("f"),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["i","writeInt32LE",4]),B.prototype.fieldSpec.push(["f","writeUInt8",1]);let q=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepA",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepA",q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:B.prototype.parser}).uint8("cn0").uint16("lock").uint8("prn"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["P","writeUInt32LE",4]),q.prototype.fieldSpec.push(["L",B.prototype.fieldSpec]),q.prototype.fieldSpec.push(["cn0","writeUInt8",1]),q.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),q.prototype.fieldSpec.push(["prn","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepB",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepB",z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:B.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["P","writeUInt32LE",4]),z.prototype.fieldSpec.push(["L",B.prototype.fieldSpec]),z.prototype.fieldSpec.push(["cn0","writeUInt8",1]),z.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),z.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]);let H=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepC",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepC",H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["P","writeUInt32LE",4]),H.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),H.prototype.fieldSpec.push(["cn0","writeUInt8",1]),H.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),H.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_A",V.prototype.msg_type=69,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:q.prototype.parser,readUntil:"eof"}),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),V.prototype.fieldSpec.push(["obs","array",q.prototype.fieldSpec,function(){return this.fields.array.length},null]);let Y=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(Y.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_B",Y.prototype.msg_type=67,Y.prototype.constructor=Y,Y.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:z.prototype.parser,readUntil:"eof"}),Y.prototype.fieldSpec=[],Y.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),Y.prototype.fieldSpec.push(["obs","array",z.prototype.fieldSpec,function(){return this.fields.array.length},null]);let W=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(W.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_C",W.prototype.msg_type=73,W.prototype.constructor=W,W.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:H.prototype.parser,readUntil:"eof"}),W.prototype.fieldSpec=[],W.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),W.prototype.fieldSpec.push(["obs","array",H.prototype.fieldSpec,function(){return this.fields.array.length},null]);let Q=function(e,t){return r.call(this,e),this.messageType="MSG_IONO",this.fields=t||this.parser.parse(e.payload),this};(Q.prototype=Object.create(r.prototype)).messageType="MSG_IONO",Q.prototype.msg_type=144,Q.prototype.constructor=Q,Q.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).doublele("a0").doublele("a1").doublele("a2").doublele("a3").doublele("b0").doublele("b1").doublele("b2").doublele("b3"),Q.prototype.fieldSpec=[],Q.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),Q.prototype.fieldSpec.push(["a0","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a1","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a2","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a3","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b0","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b1","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b2","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b3","writeDoubleLE",8]);let K=function(e,t){return r.call(this,e),this.messageType="MSG_SV_CONFIGURATION_GPS_DEP",this.fields=t||this.parser.parse(e.payload),this};(K.prototype=Object.create(r.prototype)).messageType="MSG_SV_CONFIGURATION_GPS_DEP",K.prototype.msg_type=145,K.prototype.constructor=K,K.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).uint32("l2c_mask"),K.prototype.fieldSpec=[],K.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),K.prototype.fieldSpec.push(["l2c_mask","writeUInt32LE",4]);let X=function(e,t){return r.call(this,e),this.messageType="GnssCapb",this.fields=t||this.parser.parse(e.payload),this};(X.prototype=Object.create(r.prototype)).messageType="GnssCapb",X.prototype.constructor=X,X.prototype.parser=(new o).endianess("little").uint64("gps_active").uint64("gps_l2c").uint64("gps_l5").uint32("glo_active").uint32("glo_l2of").uint32("glo_l3").uint64("sbas_active").uint64("sbas_l5").uint64("bds_active").uint64("bds_d2nav").uint64("bds_b2").uint64("bds_b2a").uint32("qzss_active").uint64("gal_active").uint64("gal_e5"),X.prototype.fieldSpec=[],X.prototype.fieldSpec.push(["gps_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gps_l2c","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gps_l5","writeUInt64LE",8]),X.prototype.fieldSpec.push(["glo_active","writeUInt32LE",4]),X.prototype.fieldSpec.push(["glo_l2of","writeUInt32LE",4]),X.prototype.fieldSpec.push(["glo_l3","writeUInt32LE",4]),X.prototype.fieldSpec.push(["sbas_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["sbas_l5","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_d2nav","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_b2","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_b2a","writeUInt64LE",8]),X.prototype.fieldSpec.push(["qzss_active","writeUInt32LE",4]),X.prototype.fieldSpec.push(["gal_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gal_e5","writeUInt64LE",8]);let J=function(e,t){return r.call(this,e),this.messageType="MSG_GNSS_CAPB",this.fields=t||this.parser.parse(e.payload),this};(J.prototype=Object.create(r.prototype)).messageType="MSG_GNSS_CAPB",J.prototype.msg_type=150,J.prototype.constructor=J,J.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).nest("gc",{type:X.prototype.parser}),J.prototype.fieldSpec=[],J.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),J.prototype.fieldSpec.push(["gc",X.prototype.fieldSpec]);let Z=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(Z.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY_DEP_A",Z.prototype.msg_type=146,Z.prototype.constructor=Z,Z.prototype.parser=(new o).endianess("little").nest("t_op",{type:l.prototype.parser}).uint8("prn").uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),Z.prototype.fieldSpec=[],Z.prototype.fieldSpec.push(["t_op",l.prototype.fieldSpec]),Z.prototype.fieldSpec.push(["prn","writeUInt8",1]),Z.prototype.fieldSpec.push(["valid","writeUInt8",1]),Z.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),Z.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),Z.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let $=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY_DEP_B",this.fields=t||this.parser.parse(e.payload),this};($.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY_DEP_B",$.prototype.msg_type=147,$.prototype.constructor=$,$.prototype.parser=(new o).endianess("little").nest("t_op",{type:c.prototype.parser}).nest("sid",{type:n.prototype.parser}).uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),$.prototype.fieldSpec=[],$.prototype.fieldSpec.push(["t_op",c.prototype.fieldSpec]),$.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),$.prototype.fieldSpec.push(["valid","writeUInt8",1]),$.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),$.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),$.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let ee=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY",this.fields=t||this.parser.parse(e.payload),this};(ee.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY",ee.prototype.msg_type=148,ee.prototype.constructor=ee,ee.prototype.parser=(new o).endianess("little").nest("t_op",{type:c.prototype.parser}).nest("sid",{type:s.prototype.parser}).uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),ee.prototype.fieldSpec=[],ee.prototype.fieldSpec.push(["t_op",c.prototype.fieldSpec]),ee.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),ee.prototype.fieldSpec.push(["valid","writeUInt8",1]),ee.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),ee.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),ee.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let te=function(e,t){return r.call(this,e),this.messageType="AlmanacCommonContent",this.fields=t||this.parser.parse(e.payload),this};(te.prototype=Object.create(r.prototype)).messageType="AlmanacCommonContent",te.prototype.constructor=te,te.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toa",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),te.prototype.fieldSpec=[],te.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),te.prototype.fieldSpec.push(["toa",c.prototype.fieldSpec]),te.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),te.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),te.prototype.fieldSpec.push(["valid","writeUInt8",1]),te.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let pe=function(e,t){return r.call(this,e),this.messageType="AlmanacCommonContentDep",this.fields=t||this.parser.parse(e.payload),this};(pe.prototype=Object.create(r.prototype)).messageType="AlmanacCommonContentDep",pe.prototype.constructor=pe,pe.prototype.parser=(new o).endianess("little").nest("sid",{type:n.prototype.parser}).nest("toa",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),pe.prototype.fieldSpec=[],pe.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),pe.prototype.fieldSpec.push(["toa",c.prototype.fieldSpec]),pe.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),pe.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),pe.prototype.fieldSpec.push(["valid","writeUInt8",1]),pe.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let re=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GPS_DEP",this.fields=t||this.parser.parse(e.payload),this};(re.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GPS_DEP",re.prototype.msg_type=112,re.prototype.constructor=re,re.prototype.parser=(new o).endianess("little").nest("common",{type:pe.prototype.parser}).doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("af0").doublele("af1"),re.prototype.fieldSpec=[],re.prototype.fieldSpec.push(["common",pe.prototype.fieldSpec]),re.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),re.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),re.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),re.prototype.fieldSpec.push(["w","writeDoubleLE",8]),re.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),re.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["af1","writeDoubleLE",8]);let oe=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GPS",this.fields=t||this.parser.parse(e.payload),this};(oe.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GPS",oe.prototype.msg_type=114,oe.prototype.constructor=oe,oe.prototype.parser=(new o).endianess("little").nest("common",{type:te.prototype.parser}).doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("af0").doublele("af1"),oe.prototype.fieldSpec=[],oe.prototype.fieldSpec.push(["common",te.prototype.fieldSpec]),oe.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["w","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["af1","writeDoubleLE",8]);let ie=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GLO_DEP",this.fields=t||this.parser.parse(e.payload),this};(ie.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GLO_DEP",ie.prototype.msg_type=113,ie.prototype.constructor=ie,ie.prototype.parser=(new o).endianess("little").nest("common",{type:pe.prototype.parser}).doublele("lambda_na").doublele("t_lambda_na").doublele("i").doublele("t").doublele("t_dot").doublele("epsilon").doublele("omega"),ie.prototype.fieldSpec=[],ie.prototype.fieldSpec.push(["common",pe.prototype.fieldSpec]),ie.prototype.fieldSpec.push(["lambda_na","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t_lambda_na","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["i","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t_dot","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["epsilon","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["omega","writeDoubleLE",8]);let se=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GLO",this.fields=t||this.parser.parse(e.payload),this};(se.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GLO",se.prototype.msg_type=115,se.prototype.constructor=se,se.prototype.parser=(new o).endianess("little").nest("common",{type:te.prototype.parser}).doublele("lambda_na").doublele("t_lambda_na").doublele("i").doublele("t").doublele("t_dot").doublele("epsilon").doublele("omega"),se.prototype.fieldSpec=[],se.prototype.fieldSpec.push(["common",te.prototype.fieldSpec]),se.prototype.fieldSpec.push(["lambda_na","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t_lambda_na","writeDoubleLE",8]),se.prototype.fieldSpec.push(["i","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t_dot","writeDoubleLE",8]),se.prototype.fieldSpec.push(["epsilon","writeDoubleLE",8]),se.prototype.fieldSpec.push(["omega","writeDoubleLE",8]);let ne=function(e,t){return r.call(this,e),this.messageType="MSG_GLO_BIASES",this.fields=t||this.parser.parse(e.payload),this};(ne.prototype=Object.create(r.prototype)).messageType="MSG_GLO_BIASES",ne.prototype.msg_type=117,ne.prototype.constructor=ne,ne.prototype.parser=(new o).endianess("little").uint8("mask").int16("l1ca_bias").int16("l1p_bias").int16("l2ca_bias").int16("l2p_bias"),ne.prototype.fieldSpec=[],ne.prototype.fieldSpec.push(["mask","writeUInt8",1]),ne.prototype.fieldSpec.push(["l1ca_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l1p_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l2ca_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l2p_bias","writeInt16LE",2]);let ae=function(e,t){return r.call(this,e),this.messageType="SvAzEl",this.fields=t||this.parser.parse(e.payload),this};(ae.prototype=Object.create(r.prototype)).messageType="SvAzEl",ae.prototype.constructor=ae,ae.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).uint8("az").int8("el"),ae.prototype.fieldSpec=[],ae.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),ae.prototype.fieldSpec.push(["az","writeUInt8",1]),ae.prototype.fieldSpec.push(["el","writeInt8",1]);let le=function(e,t){return r.call(this,e),this.messageType="MSG_SV_AZ_EL",this.fields=t||this.parser.parse(e.payload),this};(le.prototype=Object.create(r.prototype)).messageType="MSG_SV_AZ_EL",le.prototype.msg_type=151,le.prototype.constructor=le,le.prototype.parser=(new o).endianess("little").array("azel",{type:ae.prototype.parser,readUntil:"eof"}),le.prototype.fieldSpec=[],le.prototype.fieldSpec.push(["azel","array",ae.prototype.fieldSpec,function(){return this.fields.array.length},null]);let ce=function(e,t){return r.call(this,e),this.messageType="MSG_OSR",this.fields=t||this.parser.parse(e.payload),this};(ce.prototype=Object.create(r.prototype)).messageType="MSG_OSR",ce.prototype.msg_type=1600,ce.prototype.constructor=ce,ce.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).array("obs",{type:h.prototype.parser,readUntil:"eof"}),ce.prototype.fieldSpec=[],ce.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),ce.prototype.fieldSpec.push(["obs","array",h.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={ObservationHeader:u,Doppler:y,PackedObsContent:f,PackedOsrContent:h,74:d,MsgObs:d,68:_,MsgBasePosLlh:_,72:S,MsgBasePosEcef:S,EphemerisCommonContent:g,EphemerisCommonContentDepB:w,EphemerisCommonContentDepA:E,129:m,MsgEphemerisGpsDepE:m,134:b,MsgEphemerisGpsDepF:b,138:I,MsgEphemerisGps:I,142:L,MsgEphemerisQzss:L,137:T,MsgEphemerisBds:T,149:v,MsgEphemerisGalDepA:v,141:U,MsgEphemerisGal:U,130:M,MsgEphemerisSbasDepA:M,131:D,MsgEphemerisGloDepA:D,132:O,MsgEphemerisSbasDepB:O,140:G,MsgEphemerisSbas:G,133:A,MsgEphemerisGloDepB:A,135:C,MsgEphemerisGloDepC:C,136:R,MsgEphemerisGloDepD:R,139:P,MsgEphemerisGlo:P,128:N,MsgEphemerisDepD:N,26:j,MsgEphemerisDepA:j,70:x,MsgEphemerisDepB:x,71:F,MsgEphemerisDepC:F,ObservationHeaderDep:k,CarrierPhaseDepA:B,PackedObsContentDepA:q,PackedObsContentDepB:z,PackedObsContentDepC:H,69:V,MsgObsDepA:V,67:Y,MsgObsDepB:Y,73:W,MsgObsDepC:W,144:Q,MsgIono:Q,145:K,MsgSvConfigurationGpsDep:K,GnssCapb:X,150:J,MsgGnssCapb:J,146:Z,MsgGroupDelayDepA:Z,147:$,MsgGroupDelayDepB:$,148:ee,MsgGroupDelay:ee,AlmanacCommonContent:te,AlmanacCommonContentDep:pe,112:re,MsgAlmanacGpsDep:re,114:oe,MsgAlmanacGps:oe,113:ie,MsgAlmanacGloDep:ie,115:se,MsgAlmanacGlo:se,117:ne,MsgGloBiases:ne,SvAzEl:ae,151:le,MsgSvAzEl:le,1600:ce,MsgOsr:ce}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_HEADING",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_HEADING",i.prototype.msg_type=527,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint32("heading").uint8("n_sats").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["heading","writeUInt32LE",4]),i.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_ORIENT_QUAT",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_ORIENT_QUAT",s.prototype.msg_type=544,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("tow").int32("w").int32("x").int32("y").int32("z").floatle("w_accuracy").floatle("x_accuracy").floatle("y_accuracy").floatle("z_accuracy").uint8("flags"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["w","writeInt32LE",4]),s.prototype.fieldSpec.push(["x","writeInt32LE",4]),s.prototype.fieldSpec.push(["y","writeInt32LE",4]),s.prototype.fieldSpec.push(["z","writeInt32LE",4]),s.prototype.fieldSpec.push(["w_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["x_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["y_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["z_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_ORIENT_EULER",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_ORIENT_EULER",n.prototype.msg_type=545,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("tow").int32("roll").int32("pitch").int32("yaw").floatle("roll_accuracy").floatle("pitch_accuracy").floatle("yaw_accuracy").uint8("flags"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["roll","writeInt32LE",4]),n.prototype.fieldSpec.push(["pitch","writeInt32LE",4]),n.prototype.fieldSpec.push(["yaw","writeInt32LE",4]),n.prototype.fieldSpec.push(["roll_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["pitch_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["yaw_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["flags","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_ANGULAR_RATE",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_ANGULAR_RATE",a.prototype.msg_type=546,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint8("flags"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),a.prototype.fieldSpec.push(["x","writeInt32LE",4]),a.prototype.fieldSpec.push(["y","writeInt32LE",4]),a.prototype.fieldSpec.push(["z","writeInt32LE",4]),a.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={527:i,MsgBaselineHeading:i,544:s,MsgOrientQuat:s,545:n,MsgOrientEuler:n,546:a,MsgAngularRate:a}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=p(0).GnssSignalDep,n=p(0).GPSTime,a=p(0).GPSTimeDep,l=(p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC",this.fields=t||this.parser.parse(e.payload),this});(l.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC",l.prototype.msg_type=105,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little"),l.prototype.fieldSpec=[];let c=function(e,t){return r.call(this,e),this.messageType="MSG_SET_TIME",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SET_TIME",c.prototype.msg_type=104,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little"),c.prototype.fieldSpec=[];let u=function(e,t){return r.call(this,e),this.messageType="MSG_RESET",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_RESET",u.prototype.msg_type=182,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_RESET_DEP",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_RESET_DEP",y.prototype.msg_type=178,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_CW_RESULTS",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_CW_RESULTS",f.prototype.msg_type=192,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little"),f.prototype.fieldSpec=[];let h=function(e,t){return r.call(this,e),this.messageType="MSG_CW_START",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_CW_START",h.prototype.msg_type=193,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little"),h.prototype.fieldSpec=[];let d=function(e,t){return r.call(this,e),this.messageType="MSG_RESET_FILTERS",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_RESET_FILTERS",d.prototype.msg_type=34,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint8("filter"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["filter","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_INIT_BASE_DEP",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_INIT_BASE_DEP",_.prototype.msg_type=35,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little"),_.prototype.fieldSpec=[];let S=function(e,t){return r.call(this,e),this.messageType="MSG_THREAD_STATE",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_THREAD_STATE",S.prototype.msg_type=23,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").string("name",{length:20}).uint16("cpu").uint32("stack_free"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["name","string",20]),S.prototype.fieldSpec.push(["cpu","writeUInt16LE",2]),S.prototype.fieldSpec.push(["stack_free","writeUInt32LE",4]);let g=function(e,t){return r.call(this,e),this.messageType="UARTChannel",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="UARTChannel",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").floatle("tx_throughput").floatle("rx_throughput").uint16("crc_error_count").uint16("io_error_count").uint8("tx_buffer_level").uint8("rx_buffer_level"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["tx_throughput","writeFloatLE",4]),g.prototype.fieldSpec.push(["rx_throughput","writeFloatLE",4]),g.prototype.fieldSpec.push(["crc_error_count","writeUInt16LE",2]),g.prototype.fieldSpec.push(["io_error_count","writeUInt16LE",2]),g.prototype.fieldSpec.push(["tx_buffer_level","writeUInt8",1]),g.prototype.fieldSpec.push(["rx_buffer_level","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="Period",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="Period",w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").int32("avg").int32("pmin").int32("pmax").int32("current"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["avg","writeInt32LE",4]),w.prototype.fieldSpec.push(["pmin","writeInt32LE",4]),w.prototype.fieldSpec.push(["pmax","writeInt32LE",4]),w.prototype.fieldSpec.push(["current","writeInt32LE",4]);let E=function(e,t){return r.call(this,e),this.messageType="Latency",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="Latency",E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").int32("avg").int32("lmin").int32("lmax").int32("current"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["avg","writeInt32LE",4]),E.prototype.fieldSpec.push(["lmin","writeInt32LE",4]),E.prototype.fieldSpec.push(["lmax","writeInt32LE",4]),E.prototype.fieldSpec.push(["current","writeInt32LE",4]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_UART_STATE",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_UART_STATE",m.prototype.msg_type=29,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("uart_a",{type:g.prototype.parser}).nest("uart_b",{type:g.prototype.parser}).nest("uart_ftdi",{type:g.prototype.parser}).nest("latency",{type:E.prototype.parser}).nest("obs_period",{type:w.prototype.parser}),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["uart_a",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["uart_b",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["uart_ftdi",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["latency",E.prototype.fieldSpec]),m.prototype.fieldSpec.push(["obs_period",w.prototype.fieldSpec]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_UART_STATE_DEPA",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_UART_STATE_DEPA",b.prototype.msg_type=24,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("uart_a",{type:g.prototype.parser}).nest("uart_b",{type:g.prototype.parser}).nest("uart_ftdi",{type:g.prototype.parser}).nest("latency",{type:E.prototype.parser}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["uart_a",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["uart_b",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["uart_ftdi",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["latency",E.prototype.fieldSpec]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_IAR_STATE",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_IAR_STATE",I.prototype.msg_type=25,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint32("num_hyps"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["num_hyps","writeUInt32LE",4]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_MASK_SATELLITE",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_MASK_SATELLITE",L.prototype.msg_type=43,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").uint8("mask").nest("sid",{type:i.prototype.parser}),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["mask","writeUInt8",1]),L.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_MASK_SATELLITE_DEP",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_MASK_SATELLITE_DEP",T.prototype.msg_type=27,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").uint8("mask").nest("sid",{type:s.prototype.parser}),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["mask","writeUInt8",1]),T.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_DEVICE_MONITOR",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_DEVICE_MONITOR",v.prototype.msg_type=181,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").int16("dev_vin").int16("cpu_vint").int16("cpu_vaux").int16("cpu_temperature").int16("fe_temperature"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["dev_vin","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_vint","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_vaux","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_temperature","writeInt16LE",2]),v.prototype.fieldSpec.push(["fe_temperature","writeInt16LE",2]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_REQ",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_REQ",U.prototype.msg_type=184,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint32("sequence").string("command",{greedy:!0}),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),U.prototype.fieldSpec.push(["command","string",null]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_RESP",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_RESP",M.prototype.msg_type=185,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").uint32("sequence").int32("code"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),M.prototype.fieldSpec.push(["code","writeInt32LE",4]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_OUTPUT",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_OUTPUT",D.prototype.msg_type=188,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").uint32("sequence").string("line",{greedy:!0}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),D.prototype.fieldSpec.push(["line","string",null]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_STATE_REQ",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_STATE_REQ",O.prototype.msg_type=186,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little"),O.prototype.fieldSpec=[];let G=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_STATE_RESP",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_STATE_RESP",G.prototype.msg_type=187,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").array("ipv4_address",{length:4,type:"uint8"}).uint8("ipv4_mask_size").array("ipv6_address",{length:16,type:"uint8"}).uint8("ipv6_mask_size").uint32("rx_bytes").uint32("tx_bytes").string("interface_name",{length:16}).uint32("flags"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["ipv4_address","array","writeUInt8",function(){return 1},4]),G.prototype.fieldSpec.push(["ipv4_mask_size","writeUInt8",1]),G.prototype.fieldSpec.push(["ipv6_address","array","writeUInt8",function(){return 1},16]),G.prototype.fieldSpec.push(["ipv6_mask_size","writeUInt8",1]),G.prototype.fieldSpec.push(["rx_bytes","writeUInt32LE",4]),G.prototype.fieldSpec.push(["tx_bytes","writeUInt32LE",4]),G.prototype.fieldSpec.push(["interface_name","string",16]),G.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let A=function(e,t){return r.call(this,e),this.messageType="NetworkUsage",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="NetworkUsage",A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").uint64("duration").uint64("total_bytes").uint32("rx_bytes").uint32("tx_bytes").string("interface_name",{length:16}),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["duration","writeUInt64LE",8]),A.prototype.fieldSpec.push(["total_bytes","writeUInt64LE",8]),A.prototype.fieldSpec.push(["rx_bytes","writeUInt32LE",4]),A.prototype.fieldSpec.push(["tx_bytes","writeUInt32LE",4]),A.prototype.fieldSpec.push(["interface_name","string",16]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_BANDWIDTH_USAGE",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_BANDWIDTH_USAGE",C.prototype.msg_type=189,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").array("interfaces",{type:A.prototype.parser,readUntil:"eof"}),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["interfaces","array",A.prototype.fieldSpec,function(){return this.fields.array.length},null]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_CELL_MODEM_STATUS",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_CELL_MODEM_STATUS",R.prototype.msg_type=190,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").int8("signal_strength").floatle("signal_error_rate").array("reserved",{type:"uint8",readUntil:"eof"}),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["signal_strength","writeInt8",1]),R.prototype.fieldSpec.push(["signal_error_rate","writeFloatLE",4]),R.prototype.fieldSpec.push(["reserved","array","writeUInt8",function(){return 1},null]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_SPECAN_DEP",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_SPECAN_DEP",P.prototype.msg_type=80,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint16("channel_tag").nest("t",{type:a.prototype.parser}).floatle("freq_ref").floatle("freq_step").floatle("amplitude_ref").floatle("amplitude_unit").array("amplitude_value",{type:"uint8",readUntil:"eof"}),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["channel_tag","writeUInt16LE",2]),P.prototype.fieldSpec.push(["t",a.prototype.fieldSpec]),P.prototype.fieldSpec.push(["freq_ref","writeFloatLE",4]),P.prototype.fieldSpec.push(["freq_step","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_ref","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_unit","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_value","array","writeUInt8",function(){return 1},null]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_SPECAN",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_SPECAN",N.prototype.msg_type=81,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").uint16("channel_tag").nest("t",{type:n.prototype.parser}).floatle("freq_ref").floatle("freq_step").floatle("amplitude_ref").floatle("amplitude_unit").array("amplitude_value",{type:"uint8",readUntil:"eof"}),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["channel_tag","writeUInt16LE",2]),N.prototype.fieldSpec.push(["t",n.prototype.fieldSpec]),N.prototype.fieldSpec.push(["freq_ref","writeFloatLE",4]),N.prototype.fieldSpec.push(["freq_step","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_ref","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_unit","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_value","array","writeUInt8",function(){return 1},null]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_FRONT_END_GAIN",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_FRONT_END_GAIN",j.prototype.msg_type=191,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").array("rf_gain",{length:8,type:"int8"}).array("if_gain",{length:8,type:"int8"}),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["rf_gain","array","writeInt8",function(){return 1},8]),j.prototype.fieldSpec.push(["if_gain","array","writeInt8",function(){return 1},8]),e.exports={105:l,MsgAlmanac:l,104:c,MsgSetTime:c,182:u,MsgReset:u,178:y,MsgResetDep:y,192:f,MsgCwResults:f,193:h,MsgCwStart:h,34:d,MsgResetFilters:d,35:_,MsgInitBaseDep:_,23:S,MsgThreadState:S,UARTChannel:g,Period:w,Latency:E,29:m,MsgUartState:m,24:b,MsgUartStateDepa:b,25:I,MsgIarState:I,43:L,MsgMaskSatellite:L,27:T,MsgMaskSatelliteDep:T,181:v,MsgDeviceMonitor:v,184:U,MsgCommandReq:U,185:M,MsgCommandResp:M,188:D,MsgCommandOutput:D,186:O,MsgNetworkStateReq:O,187:G,MsgNetworkStateResp:G,NetworkUsage:A,189:C,MsgNetworkBandwidthUsage:C,190:R,MsgCellModemStatus:R,80:P,MsgSpecanDep:P,81:N,MsgSpecan:N,191:j,MsgFrontEndGain:j}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_SBAS_RAW",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="MSG_SBAS_RAW",s.prototype.msg_type=30583,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").nest("sid",{type:i.prototype.parser}).uint32("tow").uint8("message_type").array("data",{length:27,type:"uint8"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["message_type","writeUInt8",1]),s.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},27]),e.exports={30583:s,MsgSbasRaw:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_SAVE",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_SAVE",i.prototype.msg_type=161,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little"),i.prototype.fieldSpec=[];let s=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_WRITE",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_WRITE",s.prototype.msg_type=160,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["setting","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_WRITE_RESP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_WRITE_RESP",n.prototype.msg_type=175,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("status").string("setting",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["status","writeUInt8",1]),n.prototype.fieldSpec.push(["setting","string",null]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_REQ",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_REQ",a.prototype.msg_type=164,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["setting","string",null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_RESP",l.prototype.msg_type=165,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["setting","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_REQ",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_REQ",c.prototype.msg_type=162,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint16("index"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["index","writeUInt16LE",2]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_RESP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_RESP",u.prototype.msg_type=167,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("index").string("setting",{greedy:!0}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["index","writeUInt16LE",2]),u.prototype.fieldSpec.push(["setting","string",null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_DONE",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_DONE",y.prototype.msg_type=166,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_REGISTER",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_REGISTER",f.prototype.msg_type=174,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["setting","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_REGISTER_RESP",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_REGISTER_RESP",h.prototype.msg_type=431,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("status").string("setting",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["status","writeUInt8",1]),h.prototype.fieldSpec.push(["setting","string",null]),e.exports={161:i,MsgSettingsSave:i,160:s,MsgSettingsWrite:s,175:n,MsgSettingsWriteResp:n,164:a,MsgSettingsReadReq:a,165:l,MsgSettingsReadResp:l,162:c,MsgSettingsReadByIndexReq:c,167:u,MsgSettingsReadByIndexResp:u,166:y,MsgSettingsReadByIndexDone:y,174:f,MsgSettingsRegister:f,431:h,MsgSettingsRegisterResp:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="UtcTime",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="UtcTime",i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["year","writeUInt16LE",2]),i.prototype.fieldSpec.push(["month","writeUInt8",1]),i.prototype.fieldSpec.push(["day","writeUInt8",1]),i.prototype.fieldSpec.push(["hours","writeUInt8",1]),i.prototype.fieldSpec.push(["minutes","writeUInt8",1]),i.prototype.fieldSpec.push(["seconds","writeUInt8",1]),i.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_CERTIFICATE",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_CERTIFICATE",s.prototype.msg_type=3076,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("n_msg").array("certificate_id",{length:4,type:"uint8"}).uint8("flags").array("certificate_bytes",{type:"uint8",readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["n_msg","writeUInt8",1]),s.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]),s.prototype.fieldSpec.push(["certificate_bytes","array","writeUInt8",function(){return 1},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_CERTIFICATE_CHAIN",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_CERTIFICATE_CHAIN",n.prototype.msg_type=3077,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").array("root_certificate",{length:20,type:"uint8"}).array("intermediate_certificate",{length:20,type:"uint8"}).array("corrections_certificate",{length:20,type:"uint8"}).nest("expiration",{type:i.prototype.parser}).array("signature",{length:64,type:"uint8"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["root_certificate","array","writeUInt8",function(){return 1},20]),n.prototype.fieldSpec.push(["intermediate_certificate","array","writeUInt8",function(){return 1},20]),n.prototype.fieldSpec.push(["corrections_certificate","array","writeUInt8",function(){return 1},20]),n.prototype.fieldSpec.push(["expiration",i.prototype.fieldSpec]),n.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_SIGNATURE",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_SIGNATURE",a.prototype.msg_type=3079,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("flags").uint8("stream_counter").uint8("on_demand_counter").array("certificate_id",{length:4,type:"uint8"}).uint8("n_signature_bytes").array("signature",{length:72,type:"uint8"}).array("signed_messages",{type:"uint8",readUntil:"eof"}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["flags","writeUInt8",1]),a.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),a.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),a.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),a.prototype.fieldSpec.push(["n_signature_bytes","writeUInt8",1]),a.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},72]),a.prototype.fieldSpec.push(["signed_messages","array","writeUInt8",function(){return 1},null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_SIGNATURE_DEP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_SIGNATURE_DEP",l.prototype.msg_type=3078,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("flags").uint8("stream_counter").uint8("on_demand_counter").array("certificate_id",{length:4,type:"uint8"}).array("signature",{length:64,type:"uint8"}).array("signed_messages",{type:"uint8",readUntil:"eof"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["flags","writeUInt8",1]),l.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),l.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),l.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),l.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),l.prototype.fieldSpec.push(["signed_messages","array","writeUInt8",function(){return 1},null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_CERTIFICATE_DEP",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_CERTIFICATE_DEP",c.prototype.msg_type=3074,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint8("n_msg").array("fingerprint",{length:20,type:"uint8"}).array("certificate_bytes",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["n_msg","writeUInt8",1]),c.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),c.prototype.fieldSpec.push(["certificate_bytes","array","writeUInt8",function(){return 1},null]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_SIGNATURE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_SIGNATURE_DEP_A",u.prototype.msg_type=3073,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").array("signature",{length:64,type:"uint8"}).array("fingerprint",{length:20,type:"uint8"}).array("signed_messages",{type:"uint32le",readUntil:"eof"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),u.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),u.prototype.fieldSpec.push(["signed_messages","array","writeUInt32LE",function(){return 4},null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_SIGNATURE_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_SIGNATURE_DEP_B",y.prototype.msg_type=3075,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint8("stream_counter").uint8("on_demand_counter").array("signature",{length:64,type:"uint8"}).array("fingerprint",{length:20,type:"uint8"}).array("signed_messages",{type:"uint32le",readUntil:"eof"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),y.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),y.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),y.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),y.prototype.fieldSpec.push(["signed_messages","array","writeUInt32LE",function(){return 4},null]),e.exports={UtcTime:i,3076:s,MsgEcdsaCertificate:s,3077:n,MsgCertificateChain:n,3079:a,MsgEcdsaSignature:a,3078:l,MsgEcdsaSignatureDep:l,3074:c,MsgEd25519CertificateDep:c,3073:u,MsgEd25519SignatureDepA:u,3075:y,MsgEd25519SignatureDepB:y}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="SolutionInputType",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="SolutionInputType",i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("sensor_type").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["sensor_type","writeUInt8",1]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_SOLN_META_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_SOLN_META_DEP_A",s.prototype.msg_type=65295,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint16("pdop").uint16("hdop").uint16("vdop").uint8("n_sats").uint16("age_corrections").uint8("alignment_status").uint32("last_used_gnss_pos_tow").uint32("last_used_gnss_vel_tow").array("sol_in",{type:i.prototype.parser,readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),s.prototype.fieldSpec.push(["age_corrections","writeUInt16LE",2]),s.prototype.fieldSpec.push(["alignment_status","writeUInt8",1]),s.prototype.fieldSpec.push(["last_used_gnss_pos_tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["last_used_gnss_vel_tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["sol_in","array",i.prototype.fieldSpec,function(){return this.fields.array.length},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_SOLN_META",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_SOLN_META",n.prototype.msg_type=65294,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("tow").uint16("pdop").uint16("hdop").uint16("vdop").uint16("age_corrections").uint32("age_gnss").array("sol_in",{type:i.prototype.parser,readUntil:"eof"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["age_corrections","writeUInt16LE",2]),n.prototype.fieldSpec.push(["age_gnss","writeUInt32LE",4]),n.prototype.fieldSpec.push(["sol_in","array",i.prototype.fieldSpec,function(){return this.fields.array.length},null]);let a=function(e,t){return r.call(this,e),this.messageType="GNSSInputType",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="GNSSInputType",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("flags"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["flags","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="IMUInputType",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="IMUInputType",l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("flags"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["flags","writeUInt8",1]);let c=function(e,t){return r.call(this,e),this.messageType="OdoInputType",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="OdoInputType",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint8("flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={SolutionInputType:i,65295:s,MsgSolnMetaDepA:s,65294:n,MsgSolnMeta:n,GNSSInputType:a,IMUInputType:l,OdoInputType:c}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec),n=p(0).SvId,a=function(e,t){return r.call(this,e),this.messageType="CodeBiasesContent",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="CodeBiasesContent",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("code").int16("value"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["code","writeUInt8",1]),a.prototype.fieldSpec.push(["value","writeInt16LE",2]);let l=function(e,t){return r.call(this,e),this.messageType="PhaseBiasesContent",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="PhaseBiasesContent",l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("code").uint8("integer_indicator").uint8("widelane_integer_indicator").uint8("discontinuity_counter").int32("bias"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["code","writeUInt8",1]),l.prototype.fieldSpec.push(["integer_indicator","writeUInt8",1]),l.prototype.fieldSpec.push(["widelane_integer_indicator","writeUInt8",1]),l.prototype.fieldSpec.push(["discontinuity_counter","writeUInt8",1]),l.prototype.fieldSpec.push(["bias","writeInt32LE",4]);let c=function(e,t){return r.call(this,e),this.messageType="STECHeader",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="STECHeader",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("iod_atmo"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),c.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),c.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),c.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),c.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),c.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),c.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="GriddedCorrectionHeader",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="GriddedCorrectionHeader",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").nest("time",{type:s.prototype.parser}).uint16("num_msgs").uint16("seq_num").uint8("update_interval").uint8("iod_atmo").uint8("tropo_quality_indicator"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),u.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),u.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),u.prototype.fieldSpec.push(["num_msgs","writeUInt16LE",2]),u.prototype.fieldSpec.push(["seq_num","writeUInt16LE",2]),u.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),u.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),u.prototype.fieldSpec.push(["tropo_quality_indicator","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="STECSatElement",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="STECSatElement",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).uint8("stec_quality_indicator").array("stec_coeff",{length:4,type:"int16le"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),y.prototype.fieldSpec.push(["stec_quality_indicator","writeUInt8",1]),y.prototype.fieldSpec.push(["stec_coeff","array","writeInt16LE",function(){return 2},4]);let f=function(e,t){return r.call(this,e),this.messageType="TroposphericDelayCorrectionNoStd",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="TroposphericDelayCorrectionNoStd",f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").int16("hydro").int8("wet"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["hydro","writeInt16LE",2]),f.prototype.fieldSpec.push(["wet","writeInt8",1]);let h=function(e,t){return r.call(this,e),this.messageType="TroposphericDelayCorrection",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="TroposphericDelayCorrection",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").int16("hydro").int8("wet").uint8("stddev"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["hydro","writeInt16LE",2]),h.prototype.fieldSpec.push(["wet","writeInt8",1]),h.prototype.fieldSpec.push(["stddev","writeUInt8",1]);let d=function(e,t){return r.call(this,e),this.messageType="STECResidualNoStd",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="STECResidualNoStd",d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).int16("residual"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),d.prototype.fieldSpec.push(["residual","writeInt16LE",2]);let _=function(e,t){return r.call(this,e),this.messageType="STECResidual",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="STECResidual",_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).int16("residual").uint8("stddev"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),_.prototype.fieldSpec.push(["residual","writeInt16LE",2]),_.prototype.fieldSpec.push(["stddev","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK",S.prototype.msg_type=1501,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint32("iod").int32("radial").int32("along").int32("cross").int32("dot_radial").int32("dot_along").int32("dot_cross").int32("c0").int32("c1").int32("c2"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),S.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),S.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),S.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),S.prototype.fieldSpec.push(["iod","writeUInt32LE",4]),S.prototype.fieldSpec.push(["radial","writeInt32LE",4]),S.prototype.fieldSpec.push(["along","writeInt32LE",4]),S.prototype.fieldSpec.push(["cross","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_radial","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_along","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_cross","writeInt32LE",4]),S.prototype.fieldSpec.push(["c0","writeInt32LE",4]),S.prototype.fieldSpec.push(["c1","writeInt32LE",4]),S.prototype.fieldSpec.push(["c2","writeInt32LE",4]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_CODE_BIASES",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_SSR_CODE_BIASES",g.prototype.msg_type=1505,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").array("biases",{type:a.prototype.parser,readUntil:"eof"}),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),g.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),g.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),g.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),g.prototype.fieldSpec.push(["biases","array",a.prototype.fieldSpec,function(){return this.fields.array.length},null]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_PHASE_BIASES",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_SSR_PHASE_BIASES",w.prototype.msg_type=1510,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint8("dispersive_bias").uint8("mw_consistency").uint16("yaw").int8("yaw_rate").array("biases",{type:l.prototype.parser,readUntil:"eof"}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),w.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),w.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),w.prototype.fieldSpec.push(["dispersive_bias","writeUInt8",1]),w.prototype.fieldSpec.push(["mw_consistency","writeUInt8",1]),w.prototype.fieldSpec.push(["yaw","writeUInt16LE",2]),w.prototype.fieldSpec.push(["yaw_rate","writeInt8",1]),w.prototype.fieldSpec.push(["biases","array",l.prototype.fieldSpec,function(){return this.fields.array.length},null]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION_DEP",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION_DEP",E.prototype.msg_type=1531,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").nest("header",{type:c.prototype.parser}).array("stec_sat_list",{type:y.prototype.parser,readUntil:"eof"}),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["header",c.prototype.fieldSpec]),E.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let m=function(e,t){return r.call(this,e),this.messageType="BoundsHeader",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="BoundsHeader",m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("sol_id"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),m.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),m.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),m.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),m.prototype.fieldSpec.push(["sol_id","writeUInt8",1]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION",b.prototype.msg_type=1533,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod_atmo").uint16("tile_set_id").uint16("tile_id").uint8("n_sats").array("stec_sat_list",{type:y.prototype.parser,length:"n_sats"}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),b.prototype.fieldSpec.push(["ssr_iod_atmo","writeUInt8",1]),b.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),b.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),b.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),b.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION",I.prototype.msg_type=1532,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:h.prototype.parser}).array("stec_residuals",{type:_.prototype.parser,readUntil:"eof"}),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),I.prototype.fieldSpec.push(["index","writeUInt16LE",2]),I.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),I.prototype.fieldSpec.push(["stec_residuals","array",_.prototype.fieldSpec,function(){return this.fields.array.length},null]);let L=function(e,t){return r.call(this,e),this.messageType="STECSatElementIntegrity",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="STECSatElementIntegrity",L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").nest("stec_residual",{type:_.prototype.parser}).uint8("stec_bound_mu").uint8("stec_bound_sig").uint8("stec_bound_mu_dot").uint8("stec_bound_sig_dot"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["stec_residual",_.prototype.fieldSpec]),L.prototype.fieldSpec.push(["stec_bound_mu","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_sig","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_mu_dot","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_sig_dot","writeUInt8",1]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_BOUNDS",T.prototype.msg_type=1534,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod_atmo").uint16("tile_set_id").uint16("tile_id").uint8("tropo_qi").uint16("grid_point_id").nest("tropo_delay_correction",{type:h.prototype.parser}).uint8("tropo_v_hydro_bound_mu").uint8("tropo_v_hydro_bound_sig").uint8("tropo_v_wet_bound_mu").uint8("tropo_v_wet_bound_sig").uint8("n_sats").array("stec_sat_list",{type:L.prototype.parser,length:"n_sats"}),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),T.prototype.fieldSpec.push(["ssr_iod_atmo","writeUInt8",1]),T.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tropo_qi","writeUInt8",1]),T.prototype.fieldSpec.push(["grid_point_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),T.prototype.fieldSpec.push(["tropo_v_hydro_bound_mu","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_hydro_bound_sig","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_wet_bound_mu","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_wet_bound_sig","writeUInt8",1]),T.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),T.prototype.fieldSpec.push(["stec_sat_list","array",L.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION_DEP_A",v.prototype.msg_type=1526,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),v.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),v.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),v.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),v.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),v.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),v.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),v.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),v.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION_DEP_B",U.prototype.msg_type=1527,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),U.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),U.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),U.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),U.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),U.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),U.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),U.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),U.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),U.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION",M.prototype.msg_type=1528,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("update_interval").uint8("sol_id").uint8("iod_atmo").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),M.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),M.prototype.fieldSpec.push(["sol_id","writeUInt8",1]),M.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),M.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),M.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),M.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),M.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),M.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),M.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),M.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),M.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),M.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let D=function(e,t){return r.call(this,e),this.messageType="SatelliteAPC",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="SatelliteAPC",D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").nest("sid",{type:i.prototype.parser}).uint8("sat_info").uint16("svn").array("pco",{length:3,type:"int16le"}).array("pcv",{length:21,type:"int8"}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),D.prototype.fieldSpec.push(["sat_info","writeUInt8",1]),D.prototype.fieldSpec.push(["svn","writeUInt16LE",2]),D.prototype.fieldSpec.push(["pco","array","writeInt16LE",function(){return 2},3]),D.prototype.fieldSpec.push(["pcv","array","writeInt8",function(){return 1},21]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_SATELLITE_APC_DEP",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_SSR_SATELLITE_APC_DEP",O.prototype.msg_type=1540,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").array("apc",{type:D.prototype.parser,readUntil:"eof"}),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["apc","array",D.prototype.fieldSpec,function(){return this.fields.array.length},null]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_SATELLITE_APC",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_SSR_SATELLITE_APC",G.prototype.msg_type=1541,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("update_interval").uint8("sol_id").uint8("iod_ssr").array("apc",{type:D.prototype.parser,readUntil:"eof"}),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),G.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),G.prototype.fieldSpec.push(["sol_id","writeUInt8",1]),G.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),G.prototype.fieldSpec.push(["apc","array",D.prototype.fieldSpec,function(){return this.fields.array.length},null]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_DEP_A",A.prototype.msg_type=1500,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint8("iod").int32("radial").int32("along").int32("cross").int32("dot_radial").int32("dot_along").int32("dot_cross").int32("c0").int32("c1").int32("c2"),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),A.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),A.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),A.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),A.prototype.fieldSpec.push(["iod","writeUInt8",1]),A.prototype.fieldSpec.push(["radial","writeInt32LE",4]),A.prototype.fieldSpec.push(["along","writeInt32LE",4]),A.prototype.fieldSpec.push(["cross","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_radial","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_along","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_cross","writeInt32LE",4]),A.prototype.fieldSpec.push(["c0","writeInt32LE",4]),A.prototype.fieldSpec.push(["c1","writeInt32LE",4]),A.prototype.fieldSpec.push(["c2","writeInt32LE",4]);let C=function(e,t){return r.call(this,e),this.messageType="STECHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="STECHeaderDepA",C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("iod_atmo"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),C.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),C.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),C.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),C.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="GriddedCorrectionHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="GriddedCorrectionHeaderDepA",R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint16("num_msgs").uint16("seq_num").uint8("update_interval").uint8("iod_atmo").uint8("tropo_quality_indicator"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),R.prototype.fieldSpec.push(["num_msgs","writeUInt16LE",2]),R.prototype.fieldSpec.push(["seq_num","writeUInt16LE",2]),R.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),R.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),R.prototype.fieldSpec.push(["tropo_quality_indicator","writeUInt8",1]);let P=function(e,t){return r.call(this,e),this.messageType="GridDefinitionHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="GridDefinitionHeaderDepA",P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint8("region_size_inverse").uint16("area_width").uint16("lat_nw_corner_enc").uint16("lon_nw_corner_enc").uint8("num_msgs").uint8("seq_num"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["region_size_inverse","writeUInt8",1]),P.prototype.fieldSpec.push(["area_width","writeUInt16LE",2]),P.prototype.fieldSpec.push(["lat_nw_corner_enc","writeUInt16LE",2]),P.prototype.fieldSpec.push(["lon_nw_corner_enc","writeUInt16LE",2]),P.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),P.prototype.fieldSpec.push(["seq_num","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION_DEP_A",N.prototype.msg_type=1515,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").nest("header",{type:C.prototype.parser}).array("stec_sat_list",{type:y.prototype.parser,readUntil:"eof"}),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["header",C.prototype.fieldSpec]),N.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A",j.prototype.msg_type=1520,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").nest("header",{type:R.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:f.prototype.parser}).array("stec_residuals",{type:d.prototype.parser,readUntil:"eof"}),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["header",R.prototype.fieldSpec]),j.prototype.fieldSpec.push(["index","writeUInt16LE",2]),j.prototype.fieldSpec.push(["tropo_delay_correction",f.prototype.fieldSpec]),j.prototype.fieldSpec.push(["stec_residuals","array",d.prototype.fieldSpec,function(){return this.fields.array.length},null]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_DEP_A",x.prototype.msg_type=1530,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").nest("header",{type:R.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:h.prototype.parser}).array("stec_residuals",{type:_.prototype.parser,readUntil:"eof"}),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["header",R.prototype.fieldSpec]),x.prototype.fieldSpec.push(["index","writeUInt16LE",2]),x.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),x.prototype.fieldSpec.push(["stec_residuals","array",_.prototype.fieldSpec,function(){return this.fields.array.length},null]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRID_DEFINITION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRID_DEFINITION_DEP_A",F.prototype.msg_type=1525,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").nest("header",{type:P.prototype.parser}).array("rle_list",{type:"uint8",readUntil:"eof"}),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["header",P.prototype.fieldSpec]),F.prototype.fieldSpec.push(["rle_list","array","writeUInt8",function(){return 1},null]);let k=function(e,t){return r.call(this,e),this.messageType="OrbitClockBound",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="OrbitClockBound",k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").uint8("sat_id").uint8("orb_radial_bound_mu").uint8("orb_along_bound_mu").uint8("orb_cross_bound_mu").uint8("orb_radial_bound_sig").uint8("orb_along_bound_sig").uint8("orb_cross_bound_sig").uint8("clock_bound_mu").uint8("clock_bound_sig"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["sat_id","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_radial_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_along_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_cross_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_radial_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_along_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_cross_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["clock_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["clock_bound_sig","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS",B.prototype.msg_type=1502,B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint8("n_sats").array("orbit_clock_bounds",{type:k.prototype.parser,length:"n_sats"}),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),B.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),B.prototype.fieldSpec.push(["const_id","writeUInt8",1]),B.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),B.prototype.fieldSpec.push(["orbit_clock_bounds","array",k.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let q=function(e,t){return r.call(this,e),this.messageType="CodePhaseBiasesSatSig",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="CodePhaseBiasesSatSig",q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint8("sat_id").uint8("signal_id").uint8("code_bias_bound_mu").uint8("code_bias_bound_sig").uint8("phase_bias_bound_mu").uint8("phase_bias_bound_sig"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["sat_id","writeUInt8",1]),q.prototype.fieldSpec.push(["signal_id","writeUInt8",1]),q.prototype.fieldSpec.push(["code_bias_bound_mu","writeUInt8",1]),q.prototype.fieldSpec.push(["code_bias_bound_sig","writeUInt8",1]),q.prototype.fieldSpec.push(["phase_bias_bound_mu","writeUInt8",1]),q.prototype.fieldSpec.push(["phase_bias_bound_sig","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_CODE_PHASE_BIASES_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="MSG_SSR_CODE_PHASE_BIASES_BOUNDS",z.prototype.msg_type=1516,z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint8("n_sats_signals").array("satellites_signals",{type:q.prototype.parser,length:"n_sats_signals"}),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),z.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),z.prototype.fieldSpec.push(["const_id","writeUInt8",1]),z.prototype.fieldSpec.push(["n_sats_signals","writeUInt8",1]),z.prototype.fieldSpec.push(["satellites_signals","array",q.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats_signals"]);let H=function(e,t){return r.call(this,e),this.messageType="OrbitClockBoundDegradation",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="OrbitClockBoundDegradation",H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").uint8("orb_radial_bound_mu_dot").uint8("orb_along_bound_mu_dot").uint8("orb_cross_bound_mu_dot").uint8("orb_radial_bound_sig_dot").uint8("orb_along_bound_sig_dot").uint8("orb_cross_bound_sig_dot").uint8("clock_bound_mu_dot").uint8("clock_bound_sig_dot"),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["orb_radial_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_along_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_cross_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_radial_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_along_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_cross_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["clock_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["clock_bound_sig_dot","writeUInt8",1]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION",V.prototype.msg_type=1503,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint64("sat_bitmask").nest("orbit_clock_bounds_degradation",{type:H.prototype.parser}),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),V.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),V.prototype.fieldSpec.push(["const_id","writeUInt8",1]),V.prototype.fieldSpec.push(["sat_bitmask","writeUInt64LE",8]),V.prototype.fieldSpec.push(["orbit_clock_bounds_degradation",H.prototype.fieldSpec]),e.exports={CodeBiasesContent:a,PhaseBiasesContent:l,STECHeader:c,GriddedCorrectionHeader:u,STECSatElement:y,TroposphericDelayCorrectionNoStd:f,TroposphericDelayCorrection:h,STECResidualNoStd:d,STECResidual:_,1501:S,MsgSsrOrbitClock:S,1505:g,MsgSsrCodeBiases:g,1510:w,MsgSsrPhaseBiases:w,1531:E,MsgSsrStecCorrectionDep:E,BoundsHeader:m,1533:b,MsgSsrStecCorrection:b,1532:I,MsgSsrGriddedCorrection:I,STECSatElementIntegrity:L,1534:T,MsgSsrGriddedCorrectionBounds:T,1526:v,MsgSsrTileDefinitionDepA:v,1527:U,MsgSsrTileDefinitionDepB:U,1528:M,MsgSsrTileDefinition:M,SatelliteAPC:D,1540:O,MsgSsrSatelliteApcDep:O,1541:G,MsgSsrSatelliteApc:G,1500:A,MsgSsrOrbitClockDepA:A,STECHeaderDepA:C,GriddedCorrectionHeaderDepA:R,GridDefinitionHeaderDepA:P,1515:N,MsgSsrStecCorrectionDepA:N,1520:j,MsgSsrGriddedCorrectionNoStdDepA:j,1530:x,MsgSsrGriddedCorrectionDepA:x,1525:F,MsgSsrGridDefinitionDepA:F,OrbitClockBound:k,1502:B,MsgSsrOrbitClockBounds:B,CodePhaseBiasesSatSig:q,1516:z,MsgSsrCodePhaseBiasesBounds:z,OrbitClockBoundDegradation:H,1503:V,MsgSsrOrbitClockBoundsDegradation:V}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_STARTUP",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_STARTUP",i.prototype.msg_type=65280,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("cause").uint8("startup_type").uint16("reserved"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["cause","writeUInt8",1]),i.prototype.fieldSpec.push(["startup_type","writeUInt8",1]),i.prototype.fieldSpec.push(["reserved","writeUInt16LE",2]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_DGNSS_STATUS",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_DGNSS_STATUS",s.prototype.msg_type=65282,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("flags").uint16("latency").uint8("num_signals").string("source",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["flags","writeUInt8",1]),s.prototype.fieldSpec.push(["latency","writeUInt16LE",2]),s.prototype.fieldSpec.push(["num_signals","writeUInt8",1]),s.prototype.fieldSpec.push(["source","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_HEARTBEAT",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_HEARTBEAT",n.prototype.msg_type=65535,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("flags"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let a=function(e,t){return r.call(this,e),this.messageType="SubSystemReport",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="SubSystemReport",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint16("component").uint8("generic").uint8("specific"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["component","writeUInt16LE",2]),a.prototype.fieldSpec.push(["generic","writeUInt8",1]),a.prototype.fieldSpec.push(["specific","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_STATUS_REPORT",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_STATUS_REPORT",l.prototype.msg_type=65534,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint16("reporting_system").uint16("sbp_version").uint32("sequence").uint32("uptime").array("status",{type:a.prototype.parser,readUntil:"eof"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["reporting_system","writeUInt16LE",2]),l.prototype.fieldSpec.push(["sbp_version","writeUInt16LE",2]),l.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),l.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),l.prototype.fieldSpec.push(["status","array",a.prototype.fieldSpec,function(){return this.fields.array.length},null]);let c=function(e,t){return r.call(this,e),this.messageType="StatusJournalItem",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="StatusJournalItem",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("uptime").nest("report",{type:a.prototype.parser}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),c.prototype.fieldSpec.push(["report",a.prototype.fieldSpec]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_STATUS_JOURNAL",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_STATUS_JOURNAL",u.prototype.msg_type=65533,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("reporting_system").uint16("sbp_version").uint32("total_status_reports").uint8("sequence_descriptor").array("journal",{type:c.prototype.parser,readUntil:"eof"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["reporting_system","writeUInt16LE",2]),u.prototype.fieldSpec.push(["sbp_version","writeUInt16LE",2]),u.prototype.fieldSpec.push(["total_status_reports","writeUInt32LE",4]),u.prototype.fieldSpec.push(["sequence_descriptor","writeUInt8",1]),u.prototype.fieldSpec.push(["journal","array",c.prototype.fieldSpec,function(){return this.fields.array.length},null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_INS_STATUS",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_INS_STATUS",y.prototype.msg_type=65283,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("flags"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_CSAC_TELEMETRY",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_CSAC_TELEMETRY",f.prototype.msg_type=65284,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint8("id").string("telemetry",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["id","writeUInt8",1]),f.prototype.fieldSpec.push(["telemetry","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_CSAC_TELEMETRY_LABELS",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_CSAC_TELEMETRY_LABELS",h.prototype.msg_type=65285,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("id").string("telemetry_labels",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["id","writeUInt8",1]),h.prototype.fieldSpec.push(["telemetry_labels","string",null]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_INS_UPDATES",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_INS_UPDATES",d.prototype.msg_type=65286,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint32("tow").uint8("gnsspos").uint8("gnssvel").uint8("wheelticks").uint8("speed").uint8("nhc").uint8("zerovel"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),d.prototype.fieldSpec.push(["gnsspos","writeUInt8",1]),d.prototype.fieldSpec.push(["gnssvel","writeUInt8",1]),d.prototype.fieldSpec.push(["wheelticks","writeUInt8",1]),d.prototype.fieldSpec.push(["speed","writeUInt8",1]),d.prototype.fieldSpec.push(["nhc","writeUInt8",1]),d.prototype.fieldSpec.push(["zerovel","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_GNSS_TIME_OFFSET",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_GNSS_TIME_OFFSET",_.prototype.msg_type=65287,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").int16("weeks").int32("milliseconds").int16("microseconds").uint8("flags"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["weeks","writeInt16LE",2]),_.prototype.fieldSpec.push(["milliseconds","writeInt32LE",4]),_.prototype.fieldSpec.push(["microseconds","writeInt16LE",2]),_.prototype.fieldSpec.push(["flags","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_PPS_TIME",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_PPS_TIME",S.prototype.msg_type=65288,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint64("time").uint8("flags"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["time","writeUInt64LE",8]),S.prototype.fieldSpec.push(["flags","writeUInt8",1]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_SENSOR_AID_EVENT",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_SENSOR_AID_EVENT",g.prototype.msg_type=65289,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").uint32("time").uint8("sensor_type").uint16("sensor_id").uint8("sensor_state").uint8("n_available_meas").uint8("n_attempted_meas").uint8("n_accepted_meas").uint32("flags"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["time","writeUInt32LE",4]),g.prototype.fieldSpec.push(["sensor_type","writeUInt8",1]),g.prototype.fieldSpec.push(["sensor_id","writeUInt16LE",2]),g.prototype.fieldSpec.push(["sensor_state","writeUInt8",1]),g.prototype.fieldSpec.push(["n_available_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["n_attempted_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["n_accepted_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_META",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_META",w.prototype.msg_type=65290,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint8("group_id").uint8("flags").uint8("n_group_msgs").array("group_msgs",{type:"uint16le",length:"n_group_msgs"}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["group_id","writeUInt8",1]),w.prototype.fieldSpec.push(["flags","writeUInt8",1]),w.prototype.fieldSpec.push(["n_group_msgs","writeUInt8",1]),w.prototype.fieldSpec.push(["group_msgs","array","writeUInt16LE",function(){return 2},"n_group_msgs"]),e.exports={65280:i,MsgStartup:i,65282:s,MsgDgnssStatus:s,65535:n,MsgHeartbeat:n,SubSystemReport:a,65534:l,MsgStatusReport:l,StatusJournalItem:c,65533:u,MsgStatusJournal:u,65283:y,MsgInsStatus:y,65284:f,MsgCsacTelemetry:f,65285:h,MsgCsacTelemetryLabels:h,65286:d,MsgInsUpdates:d,65287:_,MsgGnssTimeOffset:_,65288:S,MsgPpsTime:S,65289:g,MsgSensorAidEvent:g,65290:w,MsgGroupMeta:w}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase),s=p(0).GnssSignal,n=p(0).GnssSignalDep,a=p(0).GPSTime,l=p(0).GPSTimeDep,c=(p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DETAILED_DEP_A",this.fields=t||this.parser.parse(e.payload),this});(c.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DETAILED_DEP_A",c.prototype.msg_type=33,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint64("recv_time").nest("tot",{type:a.prototype.parser}).uint32("P").uint16("P_std").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:s.prototype.parser}).int32("doppler").uint16("doppler_std").uint32("uptime").int16("clock_offset").int16("clock_drift").uint16("corr_spacing").int8("acceleration").uint8("sync_flags").uint8("tow_flags").uint8("track_flags").uint8("nav_flags").uint8("pset_flags").uint8("misc_flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),c.prototype.fieldSpec.push(["tot",a.prototype.fieldSpec]),c.prototype.fieldSpec.push(["P","writeUInt32LE",4]),c.prototype.fieldSpec.push(["P_std","writeUInt16LE",2]),c.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),c.prototype.fieldSpec.push(["cn0","writeUInt8",1]),c.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),c.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),c.prototype.fieldSpec.push(["doppler","writeInt32LE",4]),c.prototype.fieldSpec.push(["doppler_std","writeUInt16LE",2]),c.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),c.prototype.fieldSpec.push(["clock_offset","writeInt16LE",2]),c.prototype.fieldSpec.push(["clock_drift","writeInt16LE",2]),c.prototype.fieldSpec.push(["corr_spacing","writeUInt16LE",2]),c.prototype.fieldSpec.push(["acceleration","writeInt8",1]),c.prototype.fieldSpec.push(["sync_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["tow_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["track_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["nav_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["pset_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["misc_flags","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DETAILED_DEP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DETAILED_DEP",u.prototype.msg_type=17,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint64("recv_time").nest("tot",{type:l.prototype.parser}).uint32("P").uint16("P_std").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}).int32("doppler").uint16("doppler_std").uint32("uptime").int16("clock_offset").int16("clock_drift").uint16("corr_spacing").int8("acceleration").uint8("sync_flags").uint8("tow_flags").uint8("track_flags").uint8("nav_flags").uint8("pset_flags").uint8("misc_flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),u.prototype.fieldSpec.push(["tot",l.prototype.fieldSpec]),u.prototype.fieldSpec.push(["P","writeUInt32LE",4]),u.prototype.fieldSpec.push(["P_std","writeUInt16LE",2]),u.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),u.prototype.fieldSpec.push(["cn0","writeUInt8",1]),u.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),u.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),u.prototype.fieldSpec.push(["doppler","writeInt32LE",4]),u.prototype.fieldSpec.push(["doppler_std","writeUInt16LE",2]),u.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),u.prototype.fieldSpec.push(["clock_offset","writeInt16LE",2]),u.prototype.fieldSpec.push(["clock_drift","writeInt16LE",2]),u.prototype.fieldSpec.push(["corr_spacing","writeUInt16LE",2]),u.prototype.fieldSpec.push(["acceleration","writeInt8",1]),u.prototype.fieldSpec.push(["sync_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["tow_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["track_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["nav_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["pset_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["misc_flags","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="TrackingChannelState",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="TrackingChannelState",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).uint8("fcn").uint8("cn0"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),y.prototype.fieldSpec.push(["fcn","writeUInt8",1]),y.prototype.fieldSpec.push(["cn0","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE",f.prototype.msg_type=65,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("states",{type:y.prototype.parser,readUntil:"eof"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["states","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let h=function(e,t){return r.call(this,e),this.messageType="MeasurementState",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MeasurementState",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").nest("mesid",{type:s.prototype.parser}).uint8("cn0"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["mesid",s.prototype.fieldSpec]),h.prototype.fieldSpec.push(["cn0","writeUInt8",1]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_MEASUREMENT_STATE",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_MEASUREMENT_STATE",d.prototype.msg_type=97,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").array("states",{type:h.prototype.parser,readUntil:"eof"}),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["states","array",h.prototype.fieldSpec,function(){return this.fields.array.length},null]);let _=function(e,t){return r.call(this,e),this.messageType="TrackingChannelCorrelation",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="TrackingChannelCorrelation",_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").int16("I").int16("Q"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["I","writeInt16LE",2]),_.prototype.fieldSpec.push(["Q","writeInt16LE",2]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ",S.prototype.msg_type=45,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:s.prototype.parser}).array("corrs",{length:3,type:_.prototype.parser}),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["channel","writeUInt8",1]),S.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),S.prototype.fieldSpec.push(["corrs","array",_.prototype.fieldSpec,function(){return this.fields.array.length},3]);let g=function(e,t){return r.call(this,e),this.messageType="TrackingChannelCorrelationDep",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="TrackingChannelCorrelationDep",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").int32("I").int32("Q"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["I","writeInt32LE",4]),g.prototype.fieldSpec.push(["Q","writeInt32LE",4]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ_DEP_B",w.prototype.msg_type=44,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:s.prototype.parser}).array("corrs",{length:3,type:g.prototype.parser}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["channel","writeUInt8",1]),w.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["corrs","array",g.prototype.fieldSpec,function(){return this.fields.array.length},3]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ_DEP_A",E.prototype.msg_type=28,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:n.prototype.parser}).array("corrs",{length:3,type:g.prototype.parser}),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["channel","writeUInt8",1]),E.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),E.prototype.fieldSpec.push(["corrs","array",g.prototype.fieldSpec,function(){return this.fields.array.length},3]);let m=function(e,t){return r.call(this,e),this.messageType="TrackingChannelStateDepA",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="TrackingChannelStateDepA",m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").uint8("state").uint8("prn").floatle("cn0"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["state","writeUInt8",1]),m.prototype.fieldSpec.push(["prn","writeUInt8",1]),m.prototype.fieldSpec.push(["cn0","writeFloatLE",4]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DEP_A",b.prototype.msg_type=22,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").array("states",{type:m.prototype.parser,readUntil:"eof"}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["states","array",m.prototype.fieldSpec,function(){return this.fields.array.length},null]);let I=function(e,t){return r.call(this,e),this.messageType="TrackingChannelStateDepB",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="TrackingChannelStateDepB",I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint8("state").nest("sid",{type:n.prototype.parser}).floatle("cn0"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["state","writeUInt8",1]),I.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),I.prototype.fieldSpec.push(["cn0","writeFloatLE",4]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DEP_B",L.prototype.msg_type=19,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").array("states",{type:I.prototype.parser,readUntil:"eof"}),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["states","array",I.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={33:c,MsgTrackingStateDetailedDepA:c,17:u,MsgTrackingStateDetailedDep:u,TrackingChannelState:y,65:f,MsgTrackingState:f,MeasurementState:h,97:d,MsgMeasurementState:d,TrackingChannelCorrelation:_,45:S,MsgTrackingIq:S,TrackingChannelCorrelationDep:g,44:w,MsgTrackingIqDepB:w,28:E,MsgTrackingIqDepA:E,TrackingChannelStateDepA:m,22:b,MsgTrackingStateDepA:b,TrackingChannelStateDepB:I,19:L,MsgTrackingStateDepB:L}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_USER_DATA",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_USER_DATA",i.prototype.msg_type=2048,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").array("contents",{type:"uint8",readUntil:"eof"}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]),e.exports={2048:i,MsgUserData:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_ODOMETRY",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_ODOMETRY",i.prototype.msg_type=2307,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").int32("velocity").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["velocity","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_WHEELTICK",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_WHEELTICK",s.prototype.msg_type=2308,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint64("time").uint8("flags").uint8("source").int32("ticks"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["time","writeUInt64LE",8]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]),s.prototype.fieldSpec.push(["source","writeUInt8",1]),s.prototype.fieldSpec.push(["ticks","writeInt32LE",4]),e.exports={2307:i,MsgOdometry:i,2308:s,MsgWheeltick:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="TelemetrySV",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="TelemetrySV",s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("az").int8("el").uint8("availability_flags").int16("pseudorange_residual").int16("phase_residual").uint8("outlier_flags").uint8("ephemeris_flags").uint8("correction_flags").nest("sid",{type:i.prototype.parser}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["az","writeUInt8",1]),s.prototype.fieldSpec.push(["el","writeInt8",1]),s.prototype.fieldSpec.push(["availability_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["pseudorange_residual","writeInt16LE",2]),s.prototype.fieldSpec.push(["phase_residual","writeInt16LE",2]),s.prototype.fieldSpec.push(["outlier_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["ephemeris_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["correction_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_TEL_SV",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_TEL_SV",n.prototype.msg_type=288,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").uint8("n_obs").uint8("origin_flags").array("sv_tel",{type:s.prototype.parser,readUntil:"eof"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["n_obs","writeUInt8",1]),n.prototype.fieldSpec.push(["origin_flags","writeUInt8",1]),n.prototype.fieldSpec.push(["sv_tel","array",s.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={TelemetrySV:s,288:n,MsgTelSv:n}}]); \ No newline at end of file +function r(e,t){if(e===t)return 0;for(var p=e.length,r=t.length,o=0,i=Math.min(p,r);o=0;l--)if(c[l]!==u[l])return!1;for(l=c.length-1;l>=0;l--)if(a=c[l],!g(e[a],t[a],p,r))return!1;return!0}(e,t,p,s))}return p?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function E(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function m(e,t,p,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof p&&(r=p,p=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(p&&p.name?" ("+p.name+").":".")+(r?" "+r:"."),e&&!o&&_(o,p,"Missing expected exception"+r);var s="string"==typeof r,n=!e&&o&&!p;if((!e&&i.isError(o)&&s&&E(o,p)||n)&&_(o,p,"Got unwanted exception"+r),e&&o&&p&&!E(o,p)||!e&&o)throw o}u.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return h(d(e.actual),128)+" "+e.operator+" "+h(d(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||_;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var p=new Error;if(p.stack){var r=p.stack,o=f(t),i=r.indexOf("\n"+o);if(i>=0){var s=r.indexOf("\n",i+1);r=r.substring(s+1)}this.stack=r}}},i.inherits(u.AssertionError,Error),u.fail=_,u.ok=S,u.equal=function(e,t,p){e!=t&&_(e,t,p,"==",u.equal)},u.notEqual=function(e,t,p){e==t&&_(e,t,p,"!=",u.notEqual)},u.deepEqual=function(e,t,p){g(e,t,!1)||_(e,t,p,"deepEqual",u.deepEqual)},u.deepStrictEqual=function(e,t,p){g(e,t,!0)||_(e,t,p,"deepStrictEqual",u.deepStrictEqual)},u.notDeepEqual=function(e,t,p){g(e,t,!1)&&_(e,t,p,"notDeepEqual",u.notDeepEqual)},u.notDeepStrictEqual=function e(t,p,r){g(t,p,!0)&&_(t,p,r,"notDeepStrictEqual",e)},u.strictEqual=function(e,t,p){e!==t&&_(e,t,p,"===",u.strictEqual)},u.notStrictEqual=function(e,t,p){e===t&&_(e,t,p,"!==",u.notStrictEqual)},u.throws=function(e,t,p){m(!0,e,t,p)},u.doesNotThrow=function(e,t,p){m(!1,e,t,p)},u.ifError=function(e){if(e)throw e};var b=Object.keys||function(e){var t=[];for(var p in e)s.call(e,p)&&t.push(p);return t}}).call(this,p(5))},function(e,t,p){var r;!function(p){o(Math.pow(36,5)),o(Math.pow(16,7)),o(Math.pow(10,9)),o(Math.pow(2,30)),o(36),o(16),o(10),o(2);function o(e,t){return this instanceof o?(this._low=0,this._high=0,this.remainder=null,void 0===t?s.call(this,e):"string"==typeof e?n.call(this,e,t):void i.call(this,e,t)):new o(e,t)}function i(e,t){return this._low=0|e,this._high=0|t,this}function s(e){return this._low=65535&e,this._high=e>>>16,this}function n(e,t){var p=parseInt(e,t||10);return this._low=65535&p,this._high=p>>>16,this}o.prototype.fromBits=i,o.prototype.fromNumber=s,o.prototype.fromString=n,o.prototype.toNumber=function(){return 65536*this._high+this._low},o.prototype.toString=function(e){return this.toNumber().toString(e||10)},o.prototype.add=function(e){var t=this._low+e._low,p=t>>>16;return p+=this._high+e._high,this._low=65535&t,this._high=65535&p,this},o.prototype.subtract=function(e){return this.add(e.clone().negate())},o.prototype.multiply=function(e){var t,p,r=this._high,o=this._low,i=e._high,s=e._low;return t=(p=o*s)>>>16,t+=r*s,t&=65535,t+=o*i,this._low=65535&p,this._high=65535&t,this},o.prototype.div=function(e){if(0==e._low&&0==e._high)throw Error("division by zero");if(0==e._high&&1==e._low)return this.remainder=new o(0),this;if(e.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(e))return this.remainder=new o(0),this._low=1,this._high=0,this;for(var t=e.clone(),p=-1;!this.lt(t);)t.shiftLeft(1,!0),p++;for(this.remainder=this.clone(),this._low=0,this._high=0;p>=0;p--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),p>=16?this._high|=1<>>16)&65535,this},o.prototype.equals=o.prototype.eq=function(e){return this._low==e._low&&this._high==e._high},o.prototype.greaterThan=o.prototype.gt=function(e){return this._high>e._high||!(this._highe._low},o.prototype.lessThan=o.prototype.lt=function(e){return this._highe._high)&&this._low16?(this._low=this._high>>e-16,this._high=0):16==e?(this._low=this._high,this._high=0):(this._low=this._low>>e|this._high<<16-e&65535,this._high>>=e),this},o.prototype.shiftLeft=o.prototype.shiftl=function(e,t){return e>16?(this._high=this._low<>16-e,this._low=this._low<>>32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.rotateRight=o.prototype.rotr=function(e){var t=this._high<<16|this._low;return t=t>>>e|t<<32-e,this._low=65535&t,this._high=t>>>16,this},o.prototype.clone=function(){return new o(this._low,this._high)},void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},function(e,t,p){var r;!function(p){var o={16:s(Math.pow(16,5)),10:s(Math.pow(10,5)),2:s(Math.pow(2,5))},i={16:s(16),10:s(10),2:s(2)};function s(e,t,p,r){return this instanceof s?(this.remainder=null,"string"==typeof e?l.call(this,e,t):void 0===t?a.call(this,e):void n.apply(this,arguments)):new s(e,t,p,r)}function n(e,t,p,r){return void 0===p?(this._a00=65535&e,this._a16=e>>>16,this._a32=65535&t,this._a48=t>>>16,this):(this._a00=0|e,this._a16=0|t,this._a32=0|p,this._a48=0|r,this)}function a(e){return this._a00=65535&e,this._a16=e>>>16,this._a32=0,this._a48=0,this}function l(e,t){t=t||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var p=o[t]||new s(Math.pow(t,5)),r=0,i=e.length;r=0&&(p.div(t),r[o]=p.remainder.toNumber().toString(e),p.gt(t));o--);return r[o-1]=p.toNumber().toString(e),r.join("")},s.prototype.add=function(e){var t=this._a00+e._a00,p=t>>>16,r=(p+=this._a16+e._a16)>>>16,o=(r+=this._a32+e._a32)>>>16;return o+=this._a48+e._a48,this._a00=65535&t,this._a16=65535&p,this._a32=65535&r,this._a48=65535&o,this},s.prototype.subtract=function(e){return this.add(e.clone().negate())},s.prototype.multiply=function(e){var t=this._a00,p=this._a16,r=this._a32,o=this._a48,i=e._a00,s=e._a16,n=e._a32,a=t*i,l=a>>>16,c=(l+=t*s)>>>16;l&=65535,c+=(l+=p*i)>>>16;var u=(c+=t*n)>>>16;return c&=65535,u+=(c+=p*s)>>>16,c&=65535,u+=(c+=r*i)>>>16,u+=t*e._a48,u&=65535,u+=p*n,u&=65535,u+=r*s,u&=65535,u+=o*i,this._a00=65535&a,this._a16=65535&l,this._a32=65535&c,this._a48=65535&u,this},s.prototype.div=function(e){if(0==e._a16&&0==e._a32&&0==e._a48){if(0==e._a00)throw Error("division by zero");if(1==e._a00)return this.remainder=new s(0),this}if(e.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(e))return this.remainder=new s(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var t=e.clone(),p=-1;!this.lt(t);)t.shiftLeft(1,!0),p++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;p>=0;p--)t.shiftRight(1),this.remainder.lt(t)||(this.remainder.subtract(t),p>=48?this._a48|=1<=32?this._a32|=1<=16?this._a16|=1<>>16),this._a16=65535&e,e=(65535&~this._a32)+(e>>>16),this._a32=65535&e,this._a48=~this._a48+(e>>>16)&65535,this},s.prototype.equals=s.prototype.eq=function(e){return this._a48==e._a48&&this._a00==e._a00&&this._a32==e._a32&&this._a16==e._a16},s.prototype.greaterThan=s.prototype.gt=function(e){return this._a48>e._a48||!(this._a48e._a32||!(this._a32e._a16||!(this._a16e._a00))},s.prototype.lessThan=s.prototype.lt=function(e){return this._a48e._a48)&&(this._a32e._a32)&&(this._a16e._a16)&&this._a00=48?(this._a00=this._a48>>e-48,this._a16=0,this._a32=0,this._a48=0):e>=32?(e-=32,this._a00=65535&(this._a32>>e|this._a48<<16-e),this._a16=this._a48>>e&65535,this._a32=0,this._a48=0):e>=16?(e-=16,this._a00=65535&(this._a16>>e|this._a32<<16-e),this._a16=65535&(this._a32>>e|this._a48<<16-e),this._a32=this._a48>>e&65535,this._a48=0):(this._a00=65535&(this._a00>>e|this._a16<<16-e),this._a16=65535&(this._a16>>e|this._a32<<16-e),this._a32=65535&(this._a32>>e|this._a48<<16-e),this._a48=this._a48>>e&65535),this},s.prototype.shiftLeft=s.prototype.shiftl=function(e,t){return(e%=64)>=48?(this._a48=this._a00<=32?(e-=32,this._a48=this._a16<>16-e,this._a32=this._a00<=16?(e-=16,this._a48=this._a32<>16-e,this._a32=65535&(this._a16<>16-e),this._a16=this._a00<>16-e,this._a32=65535&(this._a32<>16-e),this._a16=65535&(this._a16<>16-e),this._a00=this._a00<=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var p=this._a48<<16|this._a32,r=this._a16<<16|this._a00,o=p<>>32-e,i=r<>>32-e;return this._a00=65535&i,this._a16=i>>>16,this._a32=65535&o,this._a48=o>>>16,this},s.prototype.rotateRight=s.prototype.rotr=function(e){if(0==(e%=64))return this;if(e>=32){var t=this._a00;if(this._a00=this._a32,this._a32=t,t=this._a48,this._a48=this._a16,this._a16=t,32==e)return this;e-=32}var p=this._a48<<16|this._a32,r=this._a16<<16|this._a00,o=p>>>e|r<<32-e,i=r>>>e|p<<32-e;return this._a00=65535&i,this._a16=i>>>16,this._a32=65535&o,this._a48=o>>>16,this},s.prototype.clone=function(){return new s(this._a00,this._a16,this._a32,this._a48)},void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=p(0).GnssSignalDep,n=(p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT",this.fields=t||this.parser.parse(e.payload),this});(n.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT",n.prototype.msg_type=47,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").floatle("cn0").floatle("cp").floatle("cf").nest("sid",{type:i.prototype.parser}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["cn0","writeFloatLE",4]),n.prototype.fieldSpec.push(["cp","writeFloatLE",4]),n.prototype.fieldSpec.push(["cf","writeFloatLE",4]),n.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_C",a.prototype.msg_type=31,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").floatle("cn0").floatle("cp").floatle("cf").nest("sid",{type:s.prototype.parser}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["cn0","writeFloatLE",4]),a.prototype.fieldSpec.push(["cp","writeFloatLE",4]),a.prototype.fieldSpec.push(["cf","writeFloatLE",4]),a.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_B",l.prototype.msg_type=20,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").floatle("snr").floatle("cp").floatle("cf").nest("sid",{type:s.prototype.parser}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["snr","writeFloatLE",4]),l.prototype.fieldSpec.push(["cp","writeFloatLE",4]),l.prototype.fieldSpec.push(["cf","writeFloatLE",4]),l.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_RESULT_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_RESULT_DEP_A",c.prototype.msg_type=21,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").floatle("snr").floatle("cp").floatle("cf").uint8("prn"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["snr","writeFloatLE",4]),c.prototype.fieldSpec.push(["cp","writeFloatLE",4]),c.prototype.fieldSpec.push(["cf","writeFloatLE",4]),c.prototype.fieldSpec.push(["prn","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="AcqSvProfile",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="AcqSvProfile",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint8("job_type").uint8("status").uint16("cn0").uint8("int_time").nest("sid",{type:i.prototype.parser}).uint16("bin_width").uint32("timestamp").uint32("time_spent").int32("cf_min").int32("cf_max").int32("cf").uint32("cp"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["job_type","writeUInt8",1]),u.prototype.fieldSpec.push(["status","writeUInt8",1]),u.prototype.fieldSpec.push(["cn0","writeUInt16LE",2]),u.prototype.fieldSpec.push(["int_time","writeUInt8",1]),u.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),u.prototype.fieldSpec.push(["bin_width","writeUInt16LE",2]),u.prototype.fieldSpec.push(["timestamp","writeUInt32LE",4]),u.prototype.fieldSpec.push(["time_spent","writeUInt32LE",4]),u.prototype.fieldSpec.push(["cf_min","writeInt32LE",4]),u.prototype.fieldSpec.push(["cf_max","writeInt32LE",4]),u.prototype.fieldSpec.push(["cf","writeInt32LE",4]),u.prototype.fieldSpec.push(["cp","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="AcqSvProfileDep",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="AcqSvProfileDep",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint8("job_type").uint8("status").uint16("cn0").uint8("int_time").nest("sid",{type:s.prototype.parser}).uint16("bin_width").uint32("timestamp").uint32("time_spent").int32("cf_min").int32("cf_max").int32("cf").uint32("cp"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["job_type","writeUInt8",1]),y.prototype.fieldSpec.push(["status","writeUInt8",1]),y.prototype.fieldSpec.push(["cn0","writeUInt16LE",2]),y.prototype.fieldSpec.push(["int_time","writeUInt8",1]),y.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),y.prototype.fieldSpec.push(["bin_width","writeUInt16LE",2]),y.prototype.fieldSpec.push(["timestamp","writeUInt32LE",4]),y.prototype.fieldSpec.push(["time_spent","writeUInt32LE",4]),y.prototype.fieldSpec.push(["cf_min","writeInt32LE",4]),y.prototype.fieldSpec.push(["cf_max","writeInt32LE",4]),y.prototype.fieldSpec.push(["cf","writeInt32LE",4]),y.prototype.fieldSpec.push(["cp","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_SV_PROFILE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_SV_PROFILE",f.prototype.msg_type=46,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("acq_sv_profile",{type:u.prototype.parser,readUntil:"eof"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["acq_sv_profile","array",u.prototype.fieldSpec,function(){return this.fields.array.length},null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_ACQ_SV_PROFILE_DEP",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_ACQ_SV_PROFILE_DEP",h.prototype.msg_type=30,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").array("acq_sv_profile",{type:y.prototype.parser,readUntil:"eof"}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["acq_sv_profile","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={47:n,MsgAcqResult:n,31:a,MsgAcqResultDepC:a,20:l,MsgAcqResultDepB:l,21:c,MsgAcqResultDepA:c,AcqSvProfile:u,AcqSvProfileDep:y,46:f,MsgAcqSvProfile:f,30:h,MsgAcqSvProfileDep:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_REQ",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_REQ",i.prototype.msg_type=179,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little"),i.prototype.fieldSpec=[];let s=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_RESP",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_RESP",s.prototype.msg_type=180,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("flags").string("version",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["flags","writeUInt32LE",4]),s.prototype.fieldSpec.push(["version","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_JUMP_TO_APP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_JUMP_TO_APP",n.prototype.msg_type=177,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("jump"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["jump","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_NAP_DEVICE_DNA_REQ",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_NAP_DEVICE_DNA_REQ",a.prototype.msg_type=222,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little"),a.prototype.fieldSpec=[];let l=function(e,t){return r.call(this,e),this.messageType="MSG_NAP_DEVICE_DNA_RESP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_NAP_DEVICE_DNA_RESP",l.prototype.msg_type=221,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").array("dna",{length:8,type:"uint8"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["dna","array","writeUInt8",function(){return 1},8]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_BOOTLOADER_HANDSHAKE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_BOOTLOADER_HANDSHAKE_DEP_A",c.prototype.msg_type=176,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").array("handshake",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["handshake","array","writeUInt8",function(){return 1},null]),e.exports={179:i,MsgBootloaderHandshakeReq:i,180:s,MsgBootloaderHandshakeResp:s,177:n,MsgBootloaderJumpToApp:n,222:a,MsgNapDeviceDnaReq:a,221:l,MsgNapDeviceDnaResp:l,176:c,MsgBootloaderHandshakeDepA:c}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_EXT_EVENT",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_EXT_EVENT",i.prototype.msg_type=257,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags").uint8("pin"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]),i.prototype.fieldSpec.push(["pin","writeUInt8",1]),e.exports={257:i,MsgExtEvent:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_REQ",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_REQ",i.prototype.msg_type=168,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").uint8("chunk_size").string("filename",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),i.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),i.prototype.fieldSpec.push(["chunk_size","writeUInt8",1]),i.prototype.fieldSpec.push(["filename","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_RESP",s.prototype.msg_type=163,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("sequence").array("contents",{type:"uint8",readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),s.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_DIR_REQ",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_DIR_REQ",n.prototype.msg_type=169,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").string("dirname",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),n.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),n.prototype.fieldSpec.push(["dirname","string",null]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_READ_DIR_RESP",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_READ_DIR_RESP",a.prototype.msg_type=170,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint32("sequence").array("contents",{type:"uint8",readUntil:"eof"}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),a.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_REMOVE",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_REMOVE",l.prototype.msg_type=172,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").string("filename",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["filename","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_WRITE_REQ",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_WRITE_REQ",c.prototype.msg_type=173,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("offset").string("filename",{greedy:!0}).array("data",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),c.prototype.fieldSpec.push(["offset","writeUInt32LE",4]),c.prototype.fieldSpec.push(["filename","string",null]),c.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},null]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_WRITE_RESP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_WRITE_RESP",u.prototype.msg_type=171,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("sequence"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_CONFIG_REQ",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_CONFIG_REQ",y.prototype.msg_type=4097,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("sequence"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_FILEIO_CONFIG_RESP",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_FILEIO_CONFIG_RESP",f.prototype.msg_type=4098,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("sequence").uint32("window_size").uint32("batch_size").uint32("fileio_version"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),f.prototype.fieldSpec.push(["window_size","writeUInt32LE",4]),f.prototype.fieldSpec.push(["batch_size","writeUInt32LE",4]),f.prototype.fieldSpec.push(["fileio_version","writeUInt32LE",4]),e.exports={168:i,MsgFileioReadReq:i,163:s,MsgFileioReadResp:s,169:n,MsgFileioReadDirReq:n,170:a,MsgFileioReadDirResp:a,172:l,MsgFileioRemove:l,173:c,MsgFileioWriteReq:c,171:u,MsgFileioWriteResp:u,4097:y,MsgFileioConfigReq:y,4098:f,MsgFileioConfigResp:f}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_PROGRAM",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_PROGRAM",i.prototype.msg_type=230,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len").array("data",{type:"uint8",length:"addr_len"}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["target","writeUInt8",1]),i.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),i.prototype.fieldSpec.push(["addr_len","writeUInt8",1]),i.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},"addr_len"]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_DONE",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_DONE",s.prototype.msg_type=224,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("response"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["response","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_READ_REQ",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_READ_REQ",n.prototype.msg_type=231,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["target","writeUInt8",1]),n.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),n.prototype.fieldSpec.push(["addr_len","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_READ_RESP",a.prototype.msg_type=225,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("target").array("addr_start",{length:3,type:"uint8"}).uint8("addr_len"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["target","writeUInt8",1]),a.prototype.fieldSpec.push(["addr_start","array","writeUInt8",function(){return 1},3]),a.prototype.fieldSpec.push(["addr_len","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_FLASH_ERASE",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_FLASH_ERASE",l.prototype.msg_type=226,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("target").uint32("sector_num"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["target","writeUInt8",1]),l.prototype.fieldSpec.push(["sector_num","writeUInt32LE",4]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_STM_FLASH_LOCK_SECTOR",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_STM_FLASH_LOCK_SECTOR",c.prototype.msg_type=227,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("sector"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["sector","writeUInt32LE",4]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_STM_FLASH_UNLOCK_SECTOR",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_STM_FLASH_UNLOCK_SECTOR",u.prototype.msg_type=228,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("sector"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["sector","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_STM_UNIQUE_ID_REQ",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_STM_UNIQUE_ID_REQ",y.prototype.msg_type=232,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_STM_UNIQUE_ID_RESP",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_STM_UNIQUE_ID_RESP",f.prototype.msg_type=229,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("stm_id",{length:12,type:"uint8"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["stm_id","array","writeUInt8",function(){return 1},12]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_M25_FLASH_WRITE_STATUS",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_M25_FLASH_WRITE_STATUS",h.prototype.msg_type=243,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").array("status",{length:1,type:"uint8"}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["status","array","writeUInt8",function(){return 1},1]),e.exports={230:i,MsgFlashProgram:i,224:s,MsgFlashDone:s,231:n,MsgFlashReadReq:n,225:a,MsgFlashReadResp:a,226:l,MsgFlashErase:l,227:c,MsgStmFlashLockSector:c,228:u,MsgStmFlashUnlockSector:u,232:y,MsgStmUniqueIdReq:y,229:f,MsgStmUniqueIdResp:f,243:h,MsgM25FlashWriteStatus:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_IMU_RAW",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_IMU_RAW",i.prototype.msg_type=2304,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint8("tow_f").int16("acc_x").int16("acc_y").int16("acc_z").int16("gyr_x").int16("gyr_y").int16("gyr_z"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["tow_f","writeUInt8",1]),i.prototype.fieldSpec.push(["acc_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["acc_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["acc_z","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["gyr_z","writeInt16LE",2]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_IMU_AUX",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_IMU_AUX",s.prototype.msg_type=2305,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("imu_type").int16("temp").uint8("imu_conf"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["imu_type","writeUInt8",1]),s.prototype.fieldSpec.push(["temp","writeInt16LE",2]),s.prototype.fieldSpec.push(["imu_conf","writeUInt8",1]),e.exports={2304:i,MsgImuRaw:i,2305:s,MsgImuAux:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal,p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec),s=p(0).SvId,n=function(e,t){return r.call(this,e),this.messageType="IntegritySSRHeader",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="IntegritySSRHeader",n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").uint8("chain_id"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),n.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),n.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),n.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),n.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),n.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),n.prototype.fieldSpec.push(["chain_id","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_HIGH_LEVEL",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_HIGH_LEVEL",a.prototype.msg_type=3001,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).nest("corr_time",{type:i.prototype.parser}).uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").uint8("chain_id").uint8("use_gps_sat").uint8("use_gal_sat").uint8("use_bds_sat").array("reserved",{length:6,type:"uint8"}).uint8("use_tropo_grid_points").uint8("use_iono_grid_points").uint8("use_iono_tile_sat_los").uint8("use_iono_grid_point_sat_los"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),a.prototype.fieldSpec.push(["corr_time",i.prototype.fieldSpec]),a.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),a.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),a.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),a.prototype.fieldSpec.push(["chain_id","writeUInt8",1]),a.prototype.fieldSpec.push(["use_gps_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["use_gal_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["use_bds_sat","writeUInt8",1]),a.prototype.fieldSpec.push(["reserved","array","writeUInt8",function(){return 1},6]),a.prototype.fieldSpec.push(["use_tropo_grid_points","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_grid_points","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_tile_sat_los","writeUInt8",1]),a.prototype.fieldSpec.push(["use_iono_grid_point_sat_los","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_SATELLITES",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_SATELLITES",l.prototype.msg_type=3005,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").nest("obs_time",{type:i.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("ssr_sol_id").uint8("chain_id").uint8("const_id").uint8("n_faulty_sats").array("faulty_sats",{type:"uint8",length:"n_faulty_sats"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["obs_time",i.prototype.fieldSpec]),l.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),l.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),l.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),l.prototype.fieldSpec.push(["chain_id","writeUInt8",1]),l.prototype.fieldSpec.push(["const_id","writeUInt8",1]),l.prototype.fieldSpec.push(["n_faulty_sats","writeUInt8",1]),l.prototype.fieldSpec.push(["faulty_sats","array","writeUInt8",function(){return 1},"n_faulty_sats"]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_TROPO_GRID_POINTS",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_TROPO_GRID_POINTS",c.prototype.msg_type=3011,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_points").array("faulty_points",{type:"uint16le",length:"n_faulty_points"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),c.prototype.fieldSpec.push(["n_faulty_points","writeUInt8",1]),c.prototype.fieldSpec.push(["faulty_points","array","writeUInt16LE",function(){return 2},"n_faulty_points"]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_GRID_POINTS",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_GRID_POINTS",u.prototype.msg_type=3015,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_points").array("faulty_points",{type:"uint16le",length:"n_faulty_points"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),u.prototype.fieldSpec.push(["n_faulty_points","writeUInt8",1]),u.prototype.fieldSpec.push(["faulty_points","array","writeUInt16LE",function(){return 2},"n_faulty_points"]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_TILE_SAT_LOS",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_TILE_SAT_LOS",y.prototype.msg_type=3021,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint8("n_faulty_los").array("faulty_los",{type:s.prototype.parser,length:"n_faulty_los"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),y.prototype.fieldSpec.push(["n_faulty_los","writeUInt8",1]),y.prototype.fieldSpec.push(["faulty_los","array",s.prototype.fieldSpec,function(){return this.fields.array.length},"n_faulty_los"]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_SSR_FLAG_IONO_GRID_POINT_SAT_LOS",f.prototype.msg_type=3025,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").nest("header",{type:n.prototype.parser}).uint16("grid_point_id").uint8("n_faulty_los").array("faulty_los",{type:s.prototype.parser,length:"n_faulty_los"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["header",n.prototype.fieldSpec]),f.prototype.fieldSpec.push(["grid_point_id","writeUInt16LE",2]),f.prototype.fieldSpec.push(["n_faulty_los","writeUInt8",1]),f.prototype.fieldSpec.push(["faulty_los","array",s.prototype.fieldSpec,function(){return this.fields.array.length},"n_faulty_los"]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_ACKNOWLEDGE",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_ACKNOWLEDGE",h.prototype.msg_type=3026,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("request_id").uint32("area_id").uint8("response_code").uint16("correction_mask_on_demand").uint16("correction_mask_stream").uint8("solution_id"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["request_id","writeUInt8",1]),h.prototype.fieldSpec.push(["area_id","writeUInt32LE",4]),h.prototype.fieldSpec.push(["response_code","writeUInt8",1]),h.prototype.fieldSpec.push(["correction_mask_on_demand","writeUInt16LE",2]),h.prototype.fieldSpec.push(["correction_mask_stream","writeUInt16LE",2]),h.prototype.fieldSpec.push(["solution_id","writeUInt8",1]),e.exports={IntegritySSRHeader:n,3001:a,MsgSsrFlagHighLevel:a,3005:l,MsgSsrFlagSatellites:l,3011:c,MsgSsrFlagTropoGridPoints:c,3015:u,MsgSsrFlagIonoGridPoints:u,3021:y,MsgSsrFlagIonoTileSatLos:y,3025:f,MsgSsrFlagIonoGridPointSatLos:f,3026:h,MsgAcknowledge:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_CPU_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_CPU_STATE_DEP_A",i.prototype.msg_type=32512,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pcpu").string("tname",{length:15}).string("cmdline",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["index","writeUInt8",1]),i.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),i.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),i.prototype.fieldSpec.push(["tname","string",15]),i.prototype.fieldSpec.push(["cmdline","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_MEM_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_MEM_STATE_DEP_A",s.prototype.msg_type=32513,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pmem").string("tname",{length:15}).string("cmdline",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["index","writeUInt8",1]),s.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),s.prototype.fieldSpec.push(["pmem","writeUInt8",1]),s.prototype.fieldSpec.push(["tname","string",15]),s.prototype.fieldSpec.push(["cmdline","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SYS_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SYS_STATE_DEP_A",n.prototype.msg_type=32514,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint16("mem_total").uint8("pcpu").uint8("pmem").uint16("procs_starting").uint16("procs_stopping").uint16("pid_count"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["mem_total","writeUInt16LE",2]),n.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),n.prototype.fieldSpec.push(["pmem","writeUInt8",1]),n.prototype.fieldSpec.push(["procs_starting","writeUInt16LE",2]),n.prototype.fieldSpec.push(["procs_stopping","writeUInt16LE",2]),n.prototype.fieldSpec.push(["pid_count","writeUInt16LE",2]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_SOCKET_COUNTS",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_SOCKET_COUNTS",a.prototype.msg_type=32515,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("socket_count").uint16("socket_types").uint16("socket_states").string("cmdline",{greedy:!0}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["index","writeUInt8",1]),a.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_count","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_types","writeUInt16LE",2]),a.prototype.fieldSpec.push(["socket_states","writeUInt16LE",2]),a.prototype.fieldSpec.push(["cmdline","string",null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_SOCKET_QUEUES",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_SOCKET_QUEUES",l.prototype.msg_type=32516,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("recv_queued").uint16("send_queued").uint16("socket_types").uint16("socket_states").string("address_of_largest",{length:64}).string("cmdline",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["index","writeUInt8",1]),l.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),l.prototype.fieldSpec.push(["recv_queued","writeUInt16LE",2]),l.prototype.fieldSpec.push(["send_queued","writeUInt16LE",2]),l.prototype.fieldSpec.push(["socket_types","writeUInt16LE",2]),l.prototype.fieldSpec.push(["socket_states","writeUInt16LE",2]),l.prototype.fieldSpec.push(["address_of_largest","string",64]),l.prototype.fieldSpec.push(["cmdline","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SOCKET_USAGE",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SOCKET_USAGE",c.prototype.msg_type=32517,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("avg_queue_depth").uint32("max_queue_depth").array("socket_state_counts",{length:16,type:"uint16le"}).array("socket_type_counts",{length:16,type:"uint16le"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["avg_queue_depth","writeUInt32LE",4]),c.prototype.fieldSpec.push(["max_queue_depth","writeUInt32LE",4]),c.prototype.fieldSpec.push(["socket_state_counts","array","writeUInt16LE",function(){return 2},16]),c.prototype.fieldSpec.push(["socket_type_counts","array","writeUInt16LE",function(){return 2},16]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_FD_COUNT",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_FD_COUNT",u.prototype.msg_type=32518,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint16("fd_count").string("cmdline",{greedy:!0}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["index","writeUInt8",1]),u.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),u.prototype.fieldSpec.push(["fd_count","writeUInt16LE",2]),u.prototype.fieldSpec.push(["cmdline","string",null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_PROCESS_FD_SUMMARY",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_PROCESS_FD_SUMMARY",y.prototype.msg_type=32519,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("sys_fd_count").string("most_opened",{greedy:!0}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sys_fd_count","writeUInt32LE",4]),y.prototype.fieldSpec.push(["most_opened","string",null]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_CPU_STATE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_CPU_STATE",f.prototype.msg_type=32520,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pcpu").uint32("time").uint8("flags").string("tname",{length:15}).string("cmdline",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["index","writeUInt8",1]),f.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),f.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),f.prototype.fieldSpec.push(["time","writeUInt32LE",4]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]),f.prototype.fieldSpec.push(["tname","string",15]),f.prototype.fieldSpec.push(["cmdline","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_MEM_STATE",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_MEM_STATE",h.prototype.msg_type=32521,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("index").uint16("pid").uint8("pmem").uint32("time").uint8("flags").string("tname",{length:15}).string("cmdline",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["index","writeUInt8",1]),h.prototype.fieldSpec.push(["pid","writeUInt16LE",2]),h.prototype.fieldSpec.push(["pmem","writeUInt8",1]),h.prototype.fieldSpec.push(["time","writeUInt32LE",4]),h.prototype.fieldSpec.push(["flags","writeUInt8",1]),h.prototype.fieldSpec.push(["tname","string",15]),h.prototype.fieldSpec.push(["cmdline","string",null]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_LINUX_SYS_STATE",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_LINUX_SYS_STATE",d.prototype.msg_type=32522,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint16("mem_total").uint8("pcpu").uint8("pmem").uint16("procs_starting").uint16("procs_stopping").uint16("pid_count").uint32("time").uint8("flags"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["mem_total","writeUInt16LE",2]),d.prototype.fieldSpec.push(["pcpu","writeUInt8",1]),d.prototype.fieldSpec.push(["pmem","writeUInt8",1]),d.prototype.fieldSpec.push(["procs_starting","writeUInt16LE",2]),d.prototype.fieldSpec.push(["procs_stopping","writeUInt16LE",2]),d.prototype.fieldSpec.push(["pid_count","writeUInt16LE",2]),d.prototype.fieldSpec.push(["time","writeUInt32LE",4]),d.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={32512:i,MsgLinuxCpuStateDepA:i,32513:s,MsgLinuxMemStateDepA:s,32514:n,MsgLinuxSysStateDepA:n,32515:a,MsgLinuxProcessSocketCounts:a,32516:l,MsgLinuxProcessSocketQueues:l,32517:c,MsgLinuxSocketUsage:c,32518:u,MsgLinuxProcessFdCount:u,32519:y,MsgLinuxProcessFdSummary:y,32520:f,MsgLinuxCpuState:f,32521:h,MsgLinuxMemState:h,32522:d,MsgLinuxSysState:d}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_LOG",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_LOG",i.prototype.msg_type=1025,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("level").string("text",{greedy:!0}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["level","writeUInt8",1]),i.prototype.fieldSpec.push(["text","string",null]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_FWD",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_FWD",s.prototype.msg_type=1026,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("source").uint8("protocol").array("fwd_payload",{type:"uint8",readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["source","writeUInt8",1]),s.prototype.fieldSpec.push(["protocol","writeUInt8",1]),s.prototype.fieldSpec.push(["fwd_payload","array","writeUInt8",function(){return 1},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_PRINT_DEP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_PRINT_DEP",n.prototype.msg_type=16,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").string("text",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["text","string",null]),e.exports={1025:i,MsgLog:i,1026:s,MsgFwd:s,16:n,MsgPrintDep:n}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_MAG_RAW",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_MAG_RAW",i.prototype.msg_type=2306,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint8("tow_f").int16("mag_x").int16("mag_y").int16("mag_z"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["tow_f","writeUInt8",1]),i.prototype.fieldSpec.push(["mag_x","writeInt16LE",2]),i.prototype.fieldSpec.push(["mag_y","writeInt16LE",2]),i.prototype.fieldSpec.push(["mag_z","writeInt16LE",2]),e.exports={2306:i,MsgMagRaw:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME",i.prototype.msg_type=258,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME_GNSS",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME_GNSS",s.prototype.msg_type=260,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_TIME",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_UTC_TIME",n.prototype.msg_type=259,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("flags").uint32("tow").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["flags","writeUInt8",1]),n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["year","writeUInt16LE",2]),n.prototype.fieldSpec.push(["month","writeUInt8",1]),n.prototype.fieldSpec.push(["day","writeUInt8",1]),n.prototype.fieldSpec.push(["hours","writeUInt8",1]),n.prototype.fieldSpec.push(["minutes","writeUInt8",1]),n.prototype.fieldSpec.push(["seconds","writeUInt8",1]),n.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_TIME_GNSS",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_UTC_TIME_GNSS",a.prototype.msg_type=261,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("flags").uint32("tow").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["flags","writeUInt8",1]),a.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),a.prototype.fieldSpec.push(["year","writeUInt16LE",2]),a.prototype.fieldSpec.push(["month","writeUInt8",1]),a.prototype.fieldSpec.push(["day","writeUInt8",1]),a.prototype.fieldSpec.push(["hours","writeUInt8",1]),a.prototype.fieldSpec.push(["minutes","writeUInt8",1]),a.prototype.fieldSpec.push(["seconds","writeUInt8",1]),a.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_DOPS",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_DOPS",l.prototype.msg_type=520,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint32("tow").uint16("gdop").uint16("pdop").uint16("tdop").uint16("hdop").uint16("vdop").uint8("flags"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),l.prototype.fieldSpec.push(["gdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["tdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),l.prototype.fieldSpec.push(["flags","writeUInt8",1]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF",c.prototype.msg_type=521,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),c.prototype.fieldSpec.push(["x","writeDoubleLE",8]),c.prototype.fieldSpec.push(["y","writeDoubleLE",8]),c.prototype.fieldSpec.push(["z","writeDoubleLE",8]),c.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),c.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),c.prototype.fieldSpec.push(["flags","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_COV",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_COV",u.prototype.msg_type=532,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),u.prototype.fieldSpec.push(["x","writeDoubleLE",8]),u.prototype.fieldSpec.push(["y","writeDoubleLE",8]),u.prototype.fieldSpec.push(["z","writeDoubleLE",8]),u.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),u.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),u.prototype.fieldSpec.push(["flags","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH",y.prototype.msg_type=522,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),y.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),y.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),y.prototype.fieldSpec.push(["height","writeDoubleLE",8]),y.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),y.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),y.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),y.prototype.fieldSpec.push(["flags","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_COV",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_COV",f.prototype.msg_type=529,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),f.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),f.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),f.prototype.fieldSpec.push(["height","writeDoubleLE",8]),f.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),f.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]);let h=function(e,t){return r.call(this,e),this.messageType="EstimatedHorizontalErrorEllipse",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="EstimatedHorizontalErrorEllipse",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").floatle("semi_major").floatle("semi_minor").floatle("orientation"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["semi_major","writeFloatLE",4]),h.prototype.fieldSpec.push(["semi_minor","writeFloatLE",4]),h.prototype.fieldSpec.push(["orientation","writeFloatLE",4]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_ACC",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_ACC",d.prototype.msg_type=536,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").doublele("orthometric_height").floatle("h_accuracy").floatle("v_accuracy").floatle("ct_accuracy").floatle("at_accuracy").nest("h_ellipse",{type:h.prototype.parser}).uint8("confidence_and_geoid").uint8("n_sats").uint8("flags"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),d.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),d.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),d.prototype.fieldSpec.push(["height","writeDoubleLE",8]),d.prototype.fieldSpec.push(["orthometric_height","writeDoubleLE",8]),d.prototype.fieldSpec.push(["h_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["v_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["ct_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["at_accuracy","writeFloatLE",4]),d.prototype.fieldSpec.push(["h_ellipse",h.prototype.fieldSpec]),d.prototype.fieldSpec.push(["confidence_and_geoid","writeUInt8",1]),d.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),d.prototype.fieldSpec.push(["flags","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_ECEF",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_ECEF",_.prototype.msg_type=523,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),_.prototype.fieldSpec.push(["x","writeInt32LE",4]),_.prototype.fieldSpec.push(["y","writeInt32LE",4]),_.prototype.fieldSpec.push(["z","writeInt32LE",4]),_.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),_.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),_.prototype.fieldSpec.push(["flags","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_NED",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_NED",S.prototype.msg_type=524,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),S.prototype.fieldSpec.push(["n","writeInt32LE",4]),S.prototype.fieldSpec.push(["e","writeInt32LE",4]),S.prototype.fieldSpec.push(["d","writeInt32LE",4]),S.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),S.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),S.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),S.prototype.fieldSpec.push(["flags","writeUInt8",1]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF",g.prototype.msg_type=525,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),g.prototype.fieldSpec.push(["x","writeInt32LE",4]),g.prototype.fieldSpec.push(["y","writeInt32LE",4]),g.prototype.fieldSpec.push(["z","writeInt32LE",4]),g.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),g.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),g.prototype.fieldSpec.push(["flags","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_COV",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_COV",w.prototype.msg_type=533,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),w.prototype.fieldSpec.push(["x","writeInt32LE",4]),w.prototype.fieldSpec.push(["y","writeInt32LE",4]),w.prototype.fieldSpec.push(["z","writeInt32LE",4]),w.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),w.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),w.prototype.fieldSpec.push(["flags","writeUInt8",1]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED",E.prototype.msg_type=526,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),E.prototype.fieldSpec.push(["n","writeInt32LE",4]),E.prototype.fieldSpec.push(["e","writeInt32LE",4]),E.prototype.fieldSpec.push(["d","writeInt32LE",4]),E.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),E.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),E.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),E.prototype.fieldSpec.push(["flags","writeUInt8",1]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_COV",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_COV",m.prototype.msg_type=530,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),m.prototype.fieldSpec.push(["n","writeInt32LE",4]),m.prototype.fieldSpec.push(["e","writeInt32LE",4]),m.prototype.fieldSpec.push(["d","writeInt32LE",4]),m.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),m.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),m.prototype.fieldSpec.push(["flags","writeUInt8",1]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_GNSS",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_GNSS",b.prototype.msg_type=553,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),b.prototype.fieldSpec.push(["x","writeDoubleLE",8]),b.prototype.fieldSpec.push(["y","writeDoubleLE",8]),b.prototype.fieldSpec.push(["z","writeDoubleLE",8]),b.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),b.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),b.prototype.fieldSpec.push(["flags","writeUInt8",1]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_COV_GNSS",I.prototype.msg_type=564,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),I.prototype.fieldSpec.push(["x","writeDoubleLE",8]),I.prototype.fieldSpec.push(["y","writeDoubleLE",8]),I.prototype.fieldSpec.push(["z","writeDoubleLE",8]),I.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),I.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),I.prototype.fieldSpec.push(["flags","writeUInt8",1]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_GNSS",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_GNSS",L.prototype.msg_type=554,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),L.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),L.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),L.prototype.fieldSpec.push(["height","writeDoubleLE",8]),L.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),L.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),L.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),L.prototype.fieldSpec.push(["flags","writeUInt8",1]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_COV_GNSS",T.prototype.msg_type=561,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),T.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),T.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),T.prototype.fieldSpec.push(["height","writeDoubleLE",8]),T.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),T.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),T.prototype.fieldSpec.push(["flags","writeUInt8",1]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_GNSS",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_GNSS",v.prototype.msg_type=557,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),v.prototype.fieldSpec.push(["x","writeInt32LE",4]),v.prototype.fieldSpec.push(["y","writeInt32LE",4]),v.prototype.fieldSpec.push(["z","writeInt32LE",4]),v.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),v.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),v.prototype.fieldSpec.push(["flags","writeUInt8",1]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_COV_GNSS",U.prototype.msg_type=565,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),U.prototype.fieldSpec.push(["x","writeInt32LE",4]),U.prototype.fieldSpec.push(["y","writeInt32LE",4]),U.prototype.fieldSpec.push(["z","writeInt32LE",4]),U.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),U.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),U.prototype.fieldSpec.push(["flags","writeUInt8",1]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_GNSS",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_GNSS",M.prototype.msg_type=558,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),M.prototype.fieldSpec.push(["n","writeInt32LE",4]),M.prototype.fieldSpec.push(["e","writeInt32LE",4]),M.prototype.fieldSpec.push(["d","writeInt32LE",4]),M.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),M.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),M.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),M.prototype.fieldSpec.push(["flags","writeUInt8",1]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_COV_GNSS",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_COV_GNSS",D.prototype.msg_type=562,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").floatle("cov_n_n").floatle("cov_n_e").floatle("cov_n_d").floatle("cov_e_e").floatle("cov_e_d").floatle("cov_d_d").uint8("n_sats").uint8("flags"),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),D.prototype.fieldSpec.push(["n","writeInt32LE",4]),D.prototype.fieldSpec.push(["e","writeInt32LE",4]),D.prototype.fieldSpec.push(["d","writeInt32LE",4]),D.prototype.fieldSpec.push(["cov_n_n","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_n_e","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_n_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_e_e","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_e_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["cov_d_d","writeFloatLE",4]),D.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),D.prototype.fieldSpec.push(["flags","writeUInt8",1]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_BODY",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_VEL_BODY",O.prototype.msg_type=531,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").floatle("cov_x_x").floatle("cov_x_y").floatle("cov_x_z").floatle("cov_y_y").floatle("cov_y_z").floatle("cov_z_z").uint8("n_sats").uint8("flags"),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),O.prototype.fieldSpec.push(["x","writeInt32LE",4]),O.prototype.fieldSpec.push(["y","writeInt32LE",4]),O.prototype.fieldSpec.push(["z","writeInt32LE",4]),O.prototype.fieldSpec.push(["cov_x_x","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_x_y","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_x_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_y_y","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_y_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["cov_z_z","writeFloatLE",4]),O.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),O.prototype.fieldSpec.push(["flags","writeUInt8",1]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_COG",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_VEL_COG",G.prototype.msg_type=540,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").uint32("tow").uint32("cog").uint32("sog").int32("v_up").uint32("cog_accuracy").uint32("sog_accuracy").uint32("v_up_accuracy").uint16("flags"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),G.prototype.fieldSpec.push(["cog","writeUInt32LE",4]),G.prototype.fieldSpec.push(["sog","writeUInt32LE",4]),G.prototype.fieldSpec.push(["v_up","writeInt32LE",4]),G.prototype.fieldSpec.push(["cog_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["sog_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["v_up_accuracy","writeUInt32LE",4]),G.prototype.fieldSpec.push(["flags","writeUInt16LE",2]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_AGE_CORRECTIONS",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_AGE_CORRECTIONS",A.prototype.msg_type=528,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").uint32("tow").uint16("age"),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),A.prototype.fieldSpec.push(["age","writeUInt16LE",2]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_GPS_TIME_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_GPS_TIME_DEP_A",C.prototype.msg_type=256,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").int32("ns_residual").uint8("flags"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),C.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),C.prototype.fieldSpec.push(["ns_residual","writeInt32LE",4]),C.prototype.fieldSpec.push(["flags","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_DOPS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_DOPS_DEP_A",R.prototype.msg_type=518,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").uint32("tow").uint16("gdop").uint16("pdop").uint16("tdop").uint16("hdop").uint16("vdop"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),R.prototype.fieldSpec.push(["gdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["tdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),R.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_POS_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_POS_ECEF_DEP_A",P.prototype.msg_type=512,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint32("tow").doublele("x").doublele("y").doublele("z").uint16("accuracy").uint8("n_sats").uint8("flags"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),P.prototype.fieldSpec.push(["x","writeDoubleLE",8]),P.prototype.fieldSpec.push(["y","writeDoubleLE",8]),P.prototype.fieldSpec.push(["z","writeDoubleLE",8]),P.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),P.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),P.prototype.fieldSpec.push(["flags","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_POS_LLH_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_POS_LLH_DEP_A",N.prototype.msg_type=513,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").uint32("tow").doublele("lat").doublele("lon").doublele("height").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),N.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),N.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),N.prototype.fieldSpec.push(["height","writeDoubleLE",8]),N.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),N.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),N.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),N.prototype.fieldSpec.push(["flags","writeUInt8",1]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_ECEF_DEP_A",j.prototype.msg_type=514,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),j.prototype.fieldSpec.push(["x","writeInt32LE",4]),j.prototype.fieldSpec.push(["y","writeInt32LE",4]),j.prototype.fieldSpec.push(["z","writeInt32LE",4]),j.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),j.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),j.prototype.fieldSpec.push(["flags","writeUInt8",1]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_NED_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_NED_DEP_A",x.prototype.msg_type=515,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),x.prototype.fieldSpec.push(["n","writeInt32LE",4]),x.prototype.fieldSpec.push(["e","writeInt32LE",4]),x.prototype.fieldSpec.push(["d","writeInt32LE",4]),x.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),x.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),x.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),x.prototype.fieldSpec.push(["flags","writeUInt8",1]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_ECEF_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_VEL_ECEF_DEP_A",F.prototype.msg_type=516,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint16("accuracy").uint8("n_sats").uint8("flags"),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),F.prototype.fieldSpec.push(["x","writeInt32LE",4]),F.prototype.fieldSpec.push(["y","writeInt32LE",4]),F.prototype.fieldSpec.push(["z","writeInt32LE",4]),F.prototype.fieldSpec.push(["accuracy","writeUInt16LE",2]),F.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),F.prototype.fieldSpec.push(["flags","writeUInt8",1]);let k=function(e,t){return r.call(this,e),this.messageType="MSG_VEL_NED_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="MSG_VEL_NED_DEP_A",k.prototype.msg_type=517,k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").uint32("tow").int32("n").int32("e").int32("d").uint16("h_accuracy").uint16("v_accuracy").uint8("n_sats").uint8("flags"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),k.prototype.fieldSpec.push(["n","writeInt32LE",4]),k.prototype.fieldSpec.push(["e","writeInt32LE",4]),k.prototype.fieldSpec.push(["d","writeInt32LE",4]),k.prototype.fieldSpec.push(["h_accuracy","writeUInt16LE",2]),k.prototype.fieldSpec.push(["v_accuracy","writeUInt16LE",2]),k.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),k.prototype.fieldSpec.push(["flags","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_HEADING_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_HEADING_DEP_A",B.prototype.msg_type=519,B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").uint32("tow").uint32("heading").uint8("n_sats").uint8("flags"),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),B.prototype.fieldSpec.push(["heading","writeUInt32LE",4]),B.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),B.prototype.fieldSpec.push(["flags","writeUInt8",1]);let q=function(e,t){return r.call(this,e),this.messageType="MSG_PROTECTION_LEVEL_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="MSG_PROTECTION_LEVEL_DEP_A",q.prototype.msg_type=534,q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint32("tow").uint16("vpl").uint16("hpl").doublele("lat").doublele("lon").doublele("height").uint8("flags"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),q.prototype.fieldSpec.push(["vpl","writeUInt16LE",2]),q.prototype.fieldSpec.push(["hpl","writeUInt16LE",2]),q.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),q.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),q.prototype.fieldSpec.push(["height","writeDoubleLE",8]),q.prototype.fieldSpec.push(["flags","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="MSG_PROTECTION_LEVEL",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="MSG_PROTECTION_LEVEL",z.prototype.msg_type=535,z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").uint32("tow").int16("wn").uint16("hpl").uint16("vpl").uint16("atpl").uint16("ctpl").uint16("hvpl").uint16("vvpl").uint16("hopl").uint16("popl").uint16("ropl").doublele("lat").doublele("lon").doublele("height").int32("v_x").int32("v_y").int32("v_z").int32("roll").int32("pitch").int32("heading").uint32("flags"),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),z.prototype.fieldSpec.push(["wn","writeInt16LE",2]),z.prototype.fieldSpec.push(["hpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["vpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["atpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["ctpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["hvpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["vvpl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["hopl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["popl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["ropl","writeUInt16LE",2]),z.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),z.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),z.prototype.fieldSpec.push(["height","writeDoubleLE",8]),z.prototype.fieldSpec.push(["v_x","writeInt32LE",4]),z.prototype.fieldSpec.push(["v_y","writeInt32LE",4]),z.prototype.fieldSpec.push(["v_z","writeInt32LE",4]),z.prototype.fieldSpec.push(["roll","writeInt32LE",4]),z.prototype.fieldSpec.push(["pitch","writeInt32LE",4]),z.prototype.fieldSpec.push(["heading","writeInt32LE",4]),z.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let H=function(e,t){return r.call(this,e),this.messageType="MSG_UTC_LEAP_SECOND",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="MSG_UTC_LEAP_SECOND",H.prototype.msg_type=570,H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").int16("reserved_0").int16("reserved_1").int8("reserved_2").int8("count_before").uint16("reserved_3").uint16("reserved_4").uint16("ref_wn").uint8("ref_dn").int8("count_after"),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["reserved_0","writeInt16LE",2]),H.prototype.fieldSpec.push(["reserved_1","writeInt16LE",2]),H.prototype.fieldSpec.push(["reserved_2","writeInt8",1]),H.prototype.fieldSpec.push(["count_before","writeInt8",1]),H.prototype.fieldSpec.push(["reserved_3","writeUInt16LE",2]),H.prototype.fieldSpec.push(["reserved_4","writeUInt16LE",2]),H.prototype.fieldSpec.push(["ref_wn","writeUInt16LE",2]),H.prototype.fieldSpec.push(["ref_dn","writeUInt8",1]),H.prototype.fieldSpec.push(["count_after","writeInt8",1]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_REFERENCE_FRAME_PARAM",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_REFERENCE_FRAME_PARAM",V.prototype.msg_type=580,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").uint8("ssr_iod").string("sn",{length:32}).string("tn",{length:32}).uint8("sin").uint16("utn").uint16("re_t0").int32("delta_X0").int32("delta_Y0").int32("delta_Z0").int32("theta_01").int32("theta_02").int32("theta_03").int32("scale").int32("dot_delta_X0").int32("dot_delta_Y0").int32("dot_delta_Z0").int32("dot_theta_01").int32("dot_theta_02").int32("dot_theta_03").int16("dot_scale"),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),V.prototype.fieldSpec.push(["sn","string",32]),V.prototype.fieldSpec.push(["tn","string",32]),V.prototype.fieldSpec.push(["sin","writeUInt8",1]),V.prototype.fieldSpec.push(["utn","writeUInt16LE",2]),V.prototype.fieldSpec.push(["re_t0","writeUInt16LE",2]),V.prototype.fieldSpec.push(["delta_X0","writeInt32LE",4]),V.prototype.fieldSpec.push(["delta_Y0","writeInt32LE",4]),V.prototype.fieldSpec.push(["delta_Z0","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_01","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_02","writeInt32LE",4]),V.prototype.fieldSpec.push(["theta_03","writeInt32LE",4]),V.prototype.fieldSpec.push(["scale","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_X0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_Y0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_delta_Z0","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_01","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_02","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_theta_03","writeInt32LE",4]),V.prototype.fieldSpec.push(["dot_scale","writeInt16LE",2]);let Y=function(e,t){return r.call(this,e),this.messageType="MSG_POSE_RELATIVE",this.fields=t||this.parser.parse(e.payload),this};(Y.prototype=Object.create(r.prototype)).messageType="MSG_POSE_RELATIVE",Y.prototype.msg_type=581,Y.prototype.constructor=Y,Y.prototype.parser=(new o).endianess("little").uint32("tow").uint8("sensor_id").uint32("timestamp_1").uint32("timestamp_2").array("trans",{length:3,type:"int32le"}).int32("w").int32("x").int32("y").int32("z").floatle("cov_r_x_x").floatle("cov_r_x_y").floatle("cov_r_x_z").floatle("cov_r_y_y").floatle("cov_r_y_z").floatle("cov_r_z_z").floatle("cov_c_x_x").floatle("cov_c_x_y").floatle("cov_c_x_z").floatle("cov_c_y_y").floatle("cov_c_y_z").floatle("cov_c_z_z").uint8("flags"),Y.prototype.fieldSpec=[],Y.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["sensor_id","writeUInt8",1]),Y.prototype.fieldSpec.push(["timestamp_1","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["timestamp_2","writeUInt32LE",4]),Y.prototype.fieldSpec.push(["trans","array","writeInt32LE",function(){return 4},3]),Y.prototype.fieldSpec.push(["w","writeInt32LE",4]),Y.prototype.fieldSpec.push(["x","writeInt32LE",4]),Y.prototype.fieldSpec.push(["y","writeInt32LE",4]),Y.prototype.fieldSpec.push(["z","writeInt32LE",4]),Y.prototype.fieldSpec.push(["cov_r_x_x","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_x_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_x_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_y_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_y_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_r_z_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_x","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_x_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_y_y","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_y_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["cov_c_z_z","writeFloatLE",4]),Y.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={258:i,MsgGpsTime:i,260:s,MsgGpsTimeGnss:s,259:n,MsgUtcTime:n,261:a,MsgUtcTimeGnss:a,520:l,MsgDops:l,521:c,MsgPosEcef:c,532:u,MsgPosEcefCov:u,522:y,MsgPosLlh:y,529:f,MsgPosLlhCov:f,EstimatedHorizontalErrorEllipse:h,536:d,MsgPosLlhAcc:d,523:_,MsgBaselineEcef:_,524:S,MsgBaselineNed:S,525:g,MsgVelEcef:g,533:w,MsgVelEcefCov:w,526:E,MsgVelNed:E,530:m,MsgVelNedCov:m,553:b,MsgPosEcefGnss:b,564:I,MsgPosEcefCovGnss:I,554:L,MsgPosLlhGnss:L,561:T,MsgPosLlhCovGnss:T,557:v,MsgVelEcefGnss:v,565:U,MsgVelEcefCovGnss:U,558:M,MsgVelNedGnss:M,562:D,MsgVelNedCovGnss:D,531:O,MsgVelBody:O,540:G,MsgVelCog:G,528:A,MsgAgeCorrections:A,256:C,MsgGpsTimeDepA:C,518:R,MsgDopsDepA:R,512:P,MsgPosEcefDepA:P,513:N,MsgPosLlhDepA:N,514:j,MsgBaselineEcefDepA:j,515:x,MsgBaselineNedDepA:x,516:F,MsgVelEcefDepA:F,517:k,MsgVelNedDepA:k,519:B,MsgBaselineHeadingDepA:B,534:q,MsgProtectionLevelDepA:q,535:z,MsgProtectionLevel:z,570:H,MsgUtcLeapSecond:H,580:V,MsgReferenceFrameParam:V,581:Y,MsgPoseRelative:Y}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_NDB_EVENT",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="MSG_NDB_EVENT",s.prototype.msg_type=1024,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint64("recv_time").uint8("event").uint8("object_type").uint8("result").uint8("data_source").nest("object_sid",{type:i.prototype.parser}).nest("src_sid",{type:i.prototype.parser}).uint16("original_sender"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),s.prototype.fieldSpec.push(["event","writeUInt8",1]),s.prototype.fieldSpec.push(["object_type","writeUInt8",1]),s.prototype.fieldSpec.push(["result","writeUInt8",1]),s.prototype.fieldSpec.push(["data_source","writeUInt8",1]),s.prototype.fieldSpec.push(["object_sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["src_sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["original_sender","writeUInt16LE",2]),e.exports={1024:s,MsgNdbEvent:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase),s=p(0).GnssSignal,n=p(0).GnssSignalDep,a=p(0).GPSTime,l=p(0).GPSTimeDep,c=p(0).GPSTimeSec,u=(p(0).SvId,function(e,t){return r.call(this,e),this.messageType="ObservationHeader",this.fields=t||this.parser.parse(e.payload),this});(u.prototype=Object.create(r.prototype)).messageType="ObservationHeader",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").nest("t",{type:a.prototype.parser}).uint8("n_obs"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["t",a.prototype.fieldSpec]),u.prototype.fieldSpec.push(["n_obs","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="Doppler",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="Doppler",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").int16("i").uint8("f"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["i","writeInt16LE",2]),y.prototype.fieldSpec.push(["f","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="PackedObsContent",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="PackedObsContent",f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).nest("D",{type:y.prototype.parser}).uint8("cn0").uint8("lock").uint8("flags").nest("sid",{type:s.prototype.parser}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["P","writeUInt32LE",4]),f.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),f.prototype.fieldSpec.push(["D",y.prototype.fieldSpec]),f.prototype.fieldSpec.push(["cn0","writeUInt8",1]),f.prototype.fieldSpec.push(["lock","writeUInt8",1]),f.prototype.fieldSpec.push(["flags","writeUInt8",1]),f.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let h=function(e,t){return r.call(this,e),this.messageType="PackedOsrContent",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="PackedOsrContent",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).uint8("lock").uint8("flags").nest("sid",{type:s.prototype.parser}).uint16("iono_std").uint16("tropo_std").uint16("range_std"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["P","writeUInt32LE",4]),h.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),h.prototype.fieldSpec.push(["lock","writeUInt8",1]),h.prototype.fieldSpec.push(["flags","writeUInt8",1]),h.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),h.prototype.fieldSpec.push(["iono_std","writeUInt16LE",2]),h.prototype.fieldSpec.push(["tropo_std","writeUInt16LE",2]),h.prototype.fieldSpec.push(["range_std","writeUInt16LE",2]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_OBS",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_OBS",d.prototype.msg_type=74,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).array("obs",{type:f.prototype.parser,readUntil:"eof"}),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),d.prototype.fieldSpec.push(["obs","array",f.prototype.fieldSpec,function(){return this.fields.array.length},null]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_BASE_POS_LLH",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_BASE_POS_LLH",_.prototype.msg_type=68,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").doublele("lat").doublele("lon").doublele("height"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["lat","writeDoubleLE",8]),_.prototype.fieldSpec.push(["lon","writeDoubleLE",8]),_.prototype.fieldSpec.push(["height","writeDoubleLE",8]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_BASE_POS_ECEF",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_BASE_POS_ECEF",S.prototype.msg_type=72,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").doublele("x").doublele("y").doublele("z"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["x","writeDoubleLE",8]),S.prototype.fieldSpec.push(["y","writeDoubleLE",8]),S.prototype.fieldSpec.push(["z","writeDoubleLE",8]);let g=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContent",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContent",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toe",{type:c.prototype.parser}).floatle("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),g.prototype.fieldSpec.push(["toe",c.prototype.fieldSpec]),g.prototype.fieldSpec.push(["ura","writeFloatLE",4]),g.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),g.prototype.fieldSpec.push(["valid","writeUInt8",1]),g.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContentDepB",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContentDepB",w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toe",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["toe",c.prototype.fieldSpec]),w.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),w.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),w.prototype.fieldSpec.push(["valid","writeUInt8",1]),w.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let E=function(e,t){return r.call(this,e),this.messageType="EphemerisCommonContentDepA",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="EphemerisCommonContentDepA",E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").nest("sid",{type:n.prototype.parser}).nest("toe",{type:l.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),E.prototype.fieldSpec.push(["toe",l.prototype.fieldSpec]),E.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),E.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),E.prototype.fieldSpec.push(["valid","writeUInt8",1]),E.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS_DEP_E",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS_DEP_E",m.prototype.msg_type=129,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").nest("toc",{type:l.prototype.parser}).uint8("iode").uint16("iodc"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),m.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),m.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),m.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),m.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),m.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),m.prototype.fieldSpec.push(["w","writeDoubleLE",8]),m.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),m.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),m.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),m.prototype.fieldSpec.push(["toc",l.prototype.fieldSpec]),m.prototype.fieldSpec.push(["iode","writeUInt8",1]),m.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS_DEP_F",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS_DEP_F",b.prototype.msg_type=134,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),b.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),b.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),b.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),b.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),b.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),b.prototype.fieldSpec.push(["w","writeDoubleLE",8]),b.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),b.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),b.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),b.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),b.prototype.fieldSpec.push(["iode","writeUInt8",1]),b.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GPS",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GPS",I.prototype.msg_type=138,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").floatle("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),I.prototype.fieldSpec.push(["tgd","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),I.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),I.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),I.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),I.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),I.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),I.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),I.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),I.prototype.fieldSpec.push(["w","writeDoubleLE",8]),I.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),I.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),I.prototype.fieldSpec.push(["af0","writeFloatLE",4]),I.prototype.fieldSpec.push(["af1","writeFloatLE",4]),I.prototype.fieldSpec.push(["af2","writeFloatLE",4]),I.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),I.prototype.fieldSpec.push(["iode","writeUInt8",1]),I.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_QZSS",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_QZSS",L.prototype.msg_type=142,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").floatle("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),L.prototype.fieldSpec.push(["tgd","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),L.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),L.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),L.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),L.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),L.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),L.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),L.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),L.prototype.fieldSpec.push(["w","writeDoubleLE",8]),L.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),L.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),L.prototype.fieldSpec.push(["af0","writeFloatLE",4]),L.prototype.fieldSpec.push(["af1","writeFloatLE",4]),L.prototype.fieldSpec.push(["af2","writeFloatLE",4]),L.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),L.prototype.fieldSpec.push(["iode","writeUInt8",1]),L.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_BDS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_BDS",T.prototype.msg_type=137,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("tgd1").floatle("tgd2").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").floatle("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint8("iode").uint16("iodc"),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),T.prototype.fieldSpec.push(["tgd1","writeFloatLE",4]),T.prototype.fieldSpec.push(["tgd2","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),T.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),T.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),T.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),T.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),T.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),T.prototype.fieldSpec.push(["w","writeDoubleLE",8]),T.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),T.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),T.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),T.prototype.fieldSpec.push(["af1","writeFloatLE",4]),T.prototype.fieldSpec.push(["af2","writeFloatLE",4]),T.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),T.prototype.fieldSpec.push(["iode","writeUInt8",1]),T.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GAL_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GAL_DEP_A",v.prototype.msg_type=149,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("bgd_e1e5a").floatle("bgd_e1e5b").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint16("iode").uint16("iodc"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),v.prototype.fieldSpec.push(["bgd_e1e5a","writeFloatLE",4]),v.prototype.fieldSpec.push(["bgd_e1e5b","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),v.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),v.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),v.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),v.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),v.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),v.prototype.fieldSpec.push(["w","writeDoubleLE",8]),v.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),v.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),v.prototype.fieldSpec.push(["af2","writeFloatLE",4]),v.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),v.prototype.fieldSpec.push(["iode","writeUInt16LE",2]),v.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GAL",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GAL",U.prototype.msg_type=141,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("bgd_e1e5a").floatle("bgd_e1e5b").floatle("c_rs").floatle("c_rc").floatle("c_uc").floatle("c_us").floatle("c_ic").floatle("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").floatle("af2").nest("toc",{type:c.prototype.parser}).uint16("iode").uint16("iodc").uint8("source"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),U.prototype.fieldSpec.push(["bgd_e1e5a","writeFloatLE",4]),U.prototype.fieldSpec.push(["bgd_e1e5b","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_rs","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_rc","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_uc","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_us","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_ic","writeFloatLE",4]),U.prototype.fieldSpec.push(["c_is","writeFloatLE",4]),U.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),U.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),U.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),U.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),U.prototype.fieldSpec.push(["w","writeDoubleLE",8]),U.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),U.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),U.prototype.fieldSpec.push(["af2","writeFloatLE",4]),U.prototype.fieldSpec.push(["toc",c.prototype.fieldSpec]),U.prototype.fieldSpec.push(["iode","writeUInt16LE",2]),U.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),U.prototype.fieldSpec.push(["source","writeUInt8",1]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS_DEP_A",M.prototype.msg_type=130,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).doublele("a_gf0").doublele("a_gf1"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),M.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),M.prototype.fieldSpec.push(["a_gf0","writeDoubleLE",8]),M.prototype.fieldSpec.push(["a_gf1","writeDoubleLE",8]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_A",D.prototype.msg_type=131,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").nest("common",{type:E.prototype.parser}).doublele("gamma").doublele("tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["common",E.prototype.fieldSpec]),D.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),D.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),D.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),D.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),D.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS_DEP_B",O.prototype.msg_type=132,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).doublele("a_gf0").doublele("a_gf1"),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),O.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),O.prototype.fieldSpec.push(["a_gf0","writeDoubleLE",8]),O.prototype.fieldSpec.push(["a_gf1","writeDoubleLE",8]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_SBAS",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_SBAS",G.prototype.msg_type=140,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"floatle"}).array("acc",{length:3,type:"floatle"}).floatle("a_gf0").floatle("a_gf1"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),G.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),G.prototype.fieldSpec.push(["vel","array","writeFloatLE",function(){return 4},3]),G.prototype.fieldSpec.push(["acc","array","writeFloatLE",function(){return 4},3]),G.prototype.fieldSpec.push(["a_gf0","writeFloatLE",4]),G.prototype.fieldSpec.push(["a_gf1","writeFloatLE",4]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_B",A.prototype.msg_type=133,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),A.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),A.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),A.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),A.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),A.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_C",C.prototype.msg_type=135,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").doublele("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).uint8("fcn"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),C.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),C.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),C.prototype.fieldSpec.push(["d_tau","writeDoubleLE",8]),C.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),C.prototype.fieldSpec.push(["fcn","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO_DEP_D",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO_DEP_D",R.prototype.msg_type=136,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").nest("common",{type:w.prototype.parser}).doublele("gamma").doublele("tau").doublele("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"doublele"}).uint8("fcn").uint8("iod"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["common",w.prototype.fieldSpec]),R.prototype.fieldSpec.push(["gamma","writeDoubleLE",8]),R.prototype.fieldSpec.push(["tau","writeDoubleLE",8]),R.prototype.fieldSpec.push(["d_tau","writeDoubleLE",8]),R.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["acc","array","writeDoubleLE",function(){return 8},3]),R.prototype.fieldSpec.push(["fcn","writeUInt8",1]),R.prototype.fieldSpec.push(["iod","writeUInt8",1]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_GLO",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_GLO",P.prototype.msg_type=139,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").nest("common",{type:g.prototype.parser}).floatle("gamma").floatle("tau").floatle("d_tau").array("pos",{length:3,type:"doublele"}).array("vel",{length:3,type:"doublele"}).array("acc",{length:3,type:"floatle"}).uint8("fcn").uint8("iod"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["common",g.prototype.fieldSpec]),P.prototype.fieldSpec.push(["gamma","writeFloatLE",4]),P.prototype.fieldSpec.push(["tau","writeFloatLE",4]),P.prototype.fieldSpec.push(["d_tau","writeFloatLE",4]),P.prototype.fieldSpec.push(["pos","array","writeDoubleLE",function(){return 8},3]),P.prototype.fieldSpec.push(["vel","array","writeDoubleLE",function(){return 8},3]),P.prototype.fieldSpec.push(["acc","array","writeFloatLE",function(){return 4},3]),P.prototype.fieldSpec.push(["fcn","writeUInt8",1]),P.prototype.fieldSpec.push(["iod","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_D",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_D",N.prototype.msg_type=128,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").nest("sid",{type:n.prototype.parser}).uint8("iode").uint16("iodc").uint32("reserved"),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),N.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),N.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),N.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),N.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),N.prototype.fieldSpec.push(["w","writeDoubleLE",8]),N.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),N.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),N.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),N.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),N.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),N.prototype.fieldSpec.push(["valid","writeUInt8",1]),N.prototype.fieldSpec.push(["healthy","writeUInt8",1]),N.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),N.prototype.fieldSpec.push(["iode","writeUInt8",1]),N.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),N.prototype.fieldSpec.push(["reserved","writeUInt32LE",4]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_A",j.prototype.msg_type=26,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").uint8("prn"),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),j.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),j.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),j.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),j.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),j.prototype.fieldSpec.push(["w","writeDoubleLE",8]),j.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),j.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),j.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),j.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),j.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),j.prototype.fieldSpec.push(["valid","writeUInt8",1]),j.prototype.fieldSpec.push(["healthy","writeUInt8",1]),j.prototype.fieldSpec.push(["prn","writeUInt8",1]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_B",x.prototype.msg_type=70,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").uint8("prn").uint8("iode"),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),x.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),x.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),x.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),x.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),x.prototype.fieldSpec.push(["w","writeDoubleLE",8]),x.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),x.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),x.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),x.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),x.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),x.prototype.fieldSpec.push(["valid","writeUInt8",1]),x.prototype.fieldSpec.push(["healthy","writeUInt8",1]),x.prototype.fieldSpec.push(["prn","writeUInt8",1]),x.prototype.fieldSpec.push(["iode","writeUInt8",1]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_EPHEMERIS_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_EPHEMERIS_DEP_C",F.prototype.msg_type=71,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").doublele("tgd").doublele("c_rs").doublele("c_rc").doublele("c_uc").doublele("c_us").doublele("c_ic").doublele("c_is").doublele("dn").doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("inc_dot").doublele("af0").doublele("af1").doublele("af2").doublele("toe_tow").uint16("toe_wn").doublele("toc_tow").uint16("toc_wn").uint8("valid").uint8("healthy").nest("sid",{type:n.prototype.parser}).uint8("iode").uint16("iodc").uint32("reserved"),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["tgd","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_rs","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_rc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_uc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_us","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_ic","writeDoubleLE",8]),F.prototype.fieldSpec.push(["c_is","writeDoubleLE",8]),F.prototype.fieldSpec.push(["dn","writeDoubleLE",8]),F.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),F.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),F.prototype.fieldSpec.push(["w","writeDoubleLE",8]),F.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),F.prototype.fieldSpec.push(["inc_dot","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af1","writeDoubleLE",8]),F.prototype.fieldSpec.push(["af2","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toe_tow","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toe_wn","writeUInt16LE",2]),F.prototype.fieldSpec.push(["toc_tow","writeDoubleLE",8]),F.prototype.fieldSpec.push(["toc_wn","writeUInt16LE",2]),F.prototype.fieldSpec.push(["valid","writeUInt8",1]),F.prototype.fieldSpec.push(["healthy","writeUInt8",1]),F.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),F.prototype.fieldSpec.push(["iode","writeUInt8",1]),F.prototype.fieldSpec.push(["iodc","writeUInt16LE",2]),F.prototype.fieldSpec.push(["reserved","writeUInt32LE",4]);let k=function(e,t){return r.call(this,e),this.messageType="ObservationHeaderDep",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="ObservationHeaderDep",k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").nest("t",{type:l.prototype.parser}).uint8("n_obs"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["t",l.prototype.fieldSpec]),k.prototype.fieldSpec.push(["n_obs","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="CarrierPhaseDepA",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="CarrierPhaseDepA",B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").int32("i").uint8("f"),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["i","writeInt32LE",4]),B.prototype.fieldSpec.push(["f","writeUInt8",1]);let q=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepA",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepA",q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:B.prototype.parser}).uint8("cn0").uint16("lock").uint8("prn"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["P","writeUInt32LE",4]),q.prototype.fieldSpec.push(["L",B.prototype.fieldSpec]),q.prototype.fieldSpec.push(["cn0","writeUInt8",1]),q.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),q.prototype.fieldSpec.push(["prn","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepB",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepB",z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:B.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["P","writeUInt32LE",4]),z.prototype.fieldSpec.push(["L",B.prototype.fieldSpec]),z.prototype.fieldSpec.push(["cn0","writeUInt8",1]),z.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),z.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]);let H=function(e,t){return r.call(this,e),this.messageType="PackedObsContentDepC",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="PackedObsContentDepC",H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").uint32("P").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["P","writeUInt32LE",4]),H.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),H.prototype.fieldSpec.push(["cn0","writeUInt8",1]),H.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),H.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_A",V.prototype.msg_type=69,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:q.prototype.parser,readUntil:"eof"}),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),V.prototype.fieldSpec.push(["obs","array",q.prototype.fieldSpec,function(){return this.fields.array.length},null]);let Y=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(Y.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_B",Y.prototype.msg_type=67,Y.prototype.constructor=Y,Y.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:z.prototype.parser,readUntil:"eof"}),Y.prototype.fieldSpec=[],Y.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),Y.prototype.fieldSpec.push(["obs","array",z.prototype.fieldSpec,function(){return this.fields.array.length},null]);let W=function(e,t){return r.call(this,e),this.messageType="MSG_OBS_DEP_C",this.fields=t||this.parser.parse(e.payload),this};(W.prototype=Object.create(r.prototype)).messageType="MSG_OBS_DEP_C",W.prototype.msg_type=73,W.prototype.constructor=W,W.prototype.parser=(new o).endianess("little").nest("header",{type:k.prototype.parser}).array("obs",{type:H.prototype.parser,readUntil:"eof"}),W.prototype.fieldSpec=[],W.prototype.fieldSpec.push(["header",k.prototype.fieldSpec]),W.prototype.fieldSpec.push(["obs","array",H.prototype.fieldSpec,function(){return this.fields.array.length},null]);let Q=function(e,t){return r.call(this,e),this.messageType="MSG_IONO",this.fields=t||this.parser.parse(e.payload),this};(Q.prototype=Object.create(r.prototype)).messageType="MSG_IONO",Q.prototype.msg_type=144,Q.prototype.constructor=Q,Q.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).doublele("a0").doublele("a1").doublele("a2").doublele("a3").doublele("b0").doublele("b1").doublele("b2").doublele("b3"),Q.prototype.fieldSpec=[],Q.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),Q.prototype.fieldSpec.push(["a0","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a1","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a2","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["a3","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b0","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b1","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b2","writeDoubleLE",8]),Q.prototype.fieldSpec.push(["b3","writeDoubleLE",8]);let K=function(e,t){return r.call(this,e),this.messageType="MSG_SV_CONFIGURATION_GPS_DEP",this.fields=t||this.parser.parse(e.payload),this};(K.prototype=Object.create(r.prototype)).messageType="MSG_SV_CONFIGURATION_GPS_DEP",K.prototype.msg_type=145,K.prototype.constructor=K,K.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).uint32("l2c_mask"),K.prototype.fieldSpec=[],K.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),K.prototype.fieldSpec.push(["l2c_mask","writeUInt32LE",4]);let X=function(e,t){return r.call(this,e),this.messageType="GnssCapb",this.fields=t||this.parser.parse(e.payload),this};(X.prototype=Object.create(r.prototype)).messageType="GnssCapb",X.prototype.constructor=X,X.prototype.parser=(new o).endianess("little").uint64("gps_active").uint64("gps_l2c").uint64("gps_l5").uint32("glo_active").uint32("glo_l2of").uint32("glo_l3").uint64("sbas_active").uint64("sbas_l5").uint64("bds_active").uint64("bds_d2nav").uint64("bds_b2").uint64("bds_b2a").uint32("qzss_active").uint64("gal_active").uint64("gal_e5"),X.prototype.fieldSpec=[],X.prototype.fieldSpec.push(["gps_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gps_l2c","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gps_l5","writeUInt64LE",8]),X.prototype.fieldSpec.push(["glo_active","writeUInt32LE",4]),X.prototype.fieldSpec.push(["glo_l2of","writeUInt32LE",4]),X.prototype.fieldSpec.push(["glo_l3","writeUInt32LE",4]),X.prototype.fieldSpec.push(["sbas_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["sbas_l5","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_d2nav","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_b2","writeUInt64LE",8]),X.prototype.fieldSpec.push(["bds_b2a","writeUInt64LE",8]),X.prototype.fieldSpec.push(["qzss_active","writeUInt32LE",4]),X.prototype.fieldSpec.push(["gal_active","writeUInt64LE",8]),X.prototype.fieldSpec.push(["gal_e5","writeUInt64LE",8]);let J=function(e,t){return r.call(this,e),this.messageType="MSG_GNSS_CAPB",this.fields=t||this.parser.parse(e.payload),this};(J.prototype=Object.create(r.prototype)).messageType="MSG_GNSS_CAPB",J.prototype.msg_type=150,J.prototype.constructor=J,J.prototype.parser=(new o).endianess("little").nest("t_nmct",{type:c.prototype.parser}).nest("gc",{type:X.prototype.parser}),J.prototype.fieldSpec=[],J.prototype.fieldSpec.push(["t_nmct",c.prototype.fieldSpec]),J.prototype.fieldSpec.push(["gc",X.prototype.fieldSpec]);let Z=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(Z.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY_DEP_A",Z.prototype.msg_type=146,Z.prototype.constructor=Z,Z.prototype.parser=(new o).endianess("little").nest("t_op",{type:l.prototype.parser}).uint8("prn").uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),Z.prototype.fieldSpec=[],Z.prototype.fieldSpec.push(["t_op",l.prototype.fieldSpec]),Z.prototype.fieldSpec.push(["prn","writeUInt8",1]),Z.prototype.fieldSpec.push(["valid","writeUInt8",1]),Z.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),Z.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),Z.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let $=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY_DEP_B",this.fields=t||this.parser.parse(e.payload),this};($.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY_DEP_B",$.prototype.msg_type=147,$.prototype.constructor=$,$.prototype.parser=(new o).endianess("little").nest("t_op",{type:c.prototype.parser}).nest("sid",{type:n.prototype.parser}).uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),$.prototype.fieldSpec=[],$.prototype.fieldSpec.push(["t_op",c.prototype.fieldSpec]),$.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),$.prototype.fieldSpec.push(["valid","writeUInt8",1]),$.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),$.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),$.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let ee=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_DELAY",this.fields=t||this.parser.parse(e.payload),this};(ee.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_DELAY",ee.prototype.msg_type=148,ee.prototype.constructor=ee,ee.prototype.parser=(new o).endianess("little").nest("t_op",{type:c.prototype.parser}).nest("sid",{type:s.prototype.parser}).uint8("valid").int16("tgd").int16("isc_l1ca").int16("isc_l2c"),ee.prototype.fieldSpec=[],ee.prototype.fieldSpec.push(["t_op",c.prototype.fieldSpec]),ee.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),ee.prototype.fieldSpec.push(["valid","writeUInt8",1]),ee.prototype.fieldSpec.push(["tgd","writeInt16LE",2]),ee.prototype.fieldSpec.push(["isc_l1ca","writeInt16LE",2]),ee.prototype.fieldSpec.push(["isc_l2c","writeInt16LE",2]);let te=function(e,t){return r.call(this,e),this.messageType="AlmanacCommonContent",this.fields=t||this.parser.parse(e.payload),this};(te.prototype=Object.create(r.prototype)).messageType="AlmanacCommonContent",te.prototype.constructor=te,te.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).nest("toa",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),te.prototype.fieldSpec=[],te.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),te.prototype.fieldSpec.push(["toa",c.prototype.fieldSpec]),te.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),te.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),te.prototype.fieldSpec.push(["valid","writeUInt8",1]),te.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let pe=function(e,t){return r.call(this,e),this.messageType="AlmanacCommonContentDep",this.fields=t||this.parser.parse(e.payload),this};(pe.prototype=Object.create(r.prototype)).messageType="AlmanacCommonContentDep",pe.prototype.constructor=pe,pe.prototype.parser=(new o).endianess("little").nest("sid",{type:n.prototype.parser}).nest("toa",{type:c.prototype.parser}).doublele("ura").uint32("fit_interval").uint8("valid").uint8("health_bits"),pe.prototype.fieldSpec=[],pe.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),pe.prototype.fieldSpec.push(["toa",c.prototype.fieldSpec]),pe.prototype.fieldSpec.push(["ura","writeDoubleLE",8]),pe.prototype.fieldSpec.push(["fit_interval","writeUInt32LE",4]),pe.prototype.fieldSpec.push(["valid","writeUInt8",1]),pe.prototype.fieldSpec.push(["health_bits","writeUInt8",1]);let re=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GPS_DEP",this.fields=t||this.parser.parse(e.payload),this};(re.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GPS_DEP",re.prototype.msg_type=112,re.prototype.constructor=re,re.prototype.parser=(new o).endianess("little").nest("common",{type:pe.prototype.parser}).doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("af0").doublele("af1"),re.prototype.fieldSpec=[],re.prototype.fieldSpec.push(["common",pe.prototype.fieldSpec]),re.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),re.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),re.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),re.prototype.fieldSpec.push(["w","writeDoubleLE",8]),re.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),re.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),re.prototype.fieldSpec.push(["af1","writeDoubleLE",8]);let oe=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GPS",this.fields=t||this.parser.parse(e.payload),this};(oe.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GPS",oe.prototype.msg_type=114,oe.prototype.constructor=oe,oe.prototype.parser=(new o).endianess("little").nest("common",{type:te.prototype.parser}).doublele("m0").doublele("ecc").doublele("sqrta").doublele("omega0").doublele("omegadot").doublele("w").doublele("inc").doublele("af0").doublele("af1"),oe.prototype.fieldSpec=[],oe.prototype.fieldSpec.push(["common",te.prototype.fieldSpec]),oe.prototype.fieldSpec.push(["m0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["ecc","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["sqrta","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["omega0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["omegadot","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["w","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["inc","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["af0","writeDoubleLE",8]),oe.prototype.fieldSpec.push(["af1","writeDoubleLE",8]);let ie=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GLO_DEP",this.fields=t||this.parser.parse(e.payload),this};(ie.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GLO_DEP",ie.prototype.msg_type=113,ie.prototype.constructor=ie,ie.prototype.parser=(new o).endianess("little").nest("common",{type:pe.prototype.parser}).doublele("lambda_na").doublele("t_lambda_na").doublele("i").doublele("t").doublele("t_dot").doublele("epsilon").doublele("omega"),ie.prototype.fieldSpec=[],ie.prototype.fieldSpec.push(["common",pe.prototype.fieldSpec]),ie.prototype.fieldSpec.push(["lambda_na","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t_lambda_na","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["i","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["t_dot","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["epsilon","writeDoubleLE",8]),ie.prototype.fieldSpec.push(["omega","writeDoubleLE",8]);let se=function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC_GLO",this.fields=t||this.parser.parse(e.payload),this};(se.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC_GLO",se.prototype.msg_type=115,se.prototype.constructor=se,se.prototype.parser=(new o).endianess("little").nest("common",{type:te.prototype.parser}).doublele("lambda_na").doublele("t_lambda_na").doublele("i").doublele("t").doublele("t_dot").doublele("epsilon").doublele("omega"),se.prototype.fieldSpec=[],se.prototype.fieldSpec.push(["common",te.prototype.fieldSpec]),se.prototype.fieldSpec.push(["lambda_na","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t_lambda_na","writeDoubleLE",8]),se.prototype.fieldSpec.push(["i","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t","writeDoubleLE",8]),se.prototype.fieldSpec.push(["t_dot","writeDoubleLE",8]),se.prototype.fieldSpec.push(["epsilon","writeDoubleLE",8]),se.prototype.fieldSpec.push(["omega","writeDoubleLE",8]);let ne=function(e,t){return r.call(this,e),this.messageType="MSG_GLO_BIASES",this.fields=t||this.parser.parse(e.payload),this};(ne.prototype=Object.create(r.prototype)).messageType="MSG_GLO_BIASES",ne.prototype.msg_type=117,ne.prototype.constructor=ne,ne.prototype.parser=(new o).endianess("little").uint8("mask").int16("l1ca_bias").int16("l1p_bias").int16("l2ca_bias").int16("l2p_bias"),ne.prototype.fieldSpec=[],ne.prototype.fieldSpec.push(["mask","writeUInt8",1]),ne.prototype.fieldSpec.push(["l1ca_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l1p_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l2ca_bias","writeInt16LE",2]),ne.prototype.fieldSpec.push(["l2p_bias","writeInt16LE",2]);let ae=function(e,t){return r.call(this,e),this.messageType="SvAzEl",this.fields=t||this.parser.parse(e.payload),this};(ae.prototype=Object.create(r.prototype)).messageType="SvAzEl",ae.prototype.constructor=ae,ae.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).uint8("az").int8("el"),ae.prototype.fieldSpec=[],ae.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),ae.prototype.fieldSpec.push(["az","writeUInt8",1]),ae.prototype.fieldSpec.push(["el","writeInt8",1]);let le=function(e,t){return r.call(this,e),this.messageType="MSG_SV_AZ_EL",this.fields=t||this.parser.parse(e.payload),this};(le.prototype=Object.create(r.prototype)).messageType="MSG_SV_AZ_EL",le.prototype.msg_type=151,le.prototype.constructor=le,le.prototype.parser=(new o).endianess("little").array("azel",{type:ae.prototype.parser,readUntil:"eof"}),le.prototype.fieldSpec=[],le.prototype.fieldSpec.push(["azel","array",ae.prototype.fieldSpec,function(){return this.fields.array.length},null]);let ce=function(e,t){return r.call(this,e),this.messageType="MSG_OSR",this.fields=t||this.parser.parse(e.payload),this};(ce.prototype=Object.create(r.prototype)).messageType="MSG_OSR",ce.prototype.msg_type=1600,ce.prototype.constructor=ce,ce.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).array("obs",{type:h.prototype.parser,readUntil:"eof"}),ce.prototype.fieldSpec=[],ce.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),ce.prototype.fieldSpec.push(["obs","array",h.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={ObservationHeader:u,Doppler:y,PackedObsContent:f,PackedOsrContent:h,74:d,MsgObs:d,68:_,MsgBasePosLlh:_,72:S,MsgBasePosEcef:S,EphemerisCommonContent:g,EphemerisCommonContentDepB:w,EphemerisCommonContentDepA:E,129:m,MsgEphemerisGpsDepE:m,134:b,MsgEphemerisGpsDepF:b,138:I,MsgEphemerisGps:I,142:L,MsgEphemerisQzss:L,137:T,MsgEphemerisBds:T,149:v,MsgEphemerisGalDepA:v,141:U,MsgEphemerisGal:U,130:M,MsgEphemerisSbasDepA:M,131:D,MsgEphemerisGloDepA:D,132:O,MsgEphemerisSbasDepB:O,140:G,MsgEphemerisSbas:G,133:A,MsgEphemerisGloDepB:A,135:C,MsgEphemerisGloDepC:C,136:R,MsgEphemerisGloDepD:R,139:P,MsgEphemerisGlo:P,128:N,MsgEphemerisDepD:N,26:j,MsgEphemerisDepA:j,70:x,MsgEphemerisDepB:x,71:F,MsgEphemerisDepC:F,ObservationHeaderDep:k,CarrierPhaseDepA:B,PackedObsContentDepA:q,PackedObsContentDepB:z,PackedObsContentDepC:H,69:V,MsgObsDepA:V,67:Y,MsgObsDepB:Y,73:W,MsgObsDepC:W,144:Q,MsgIono:Q,145:K,MsgSvConfigurationGpsDep:K,GnssCapb:X,150:J,MsgGnssCapb:J,146:Z,MsgGroupDelayDepA:Z,147:$,MsgGroupDelayDepB:$,148:ee,MsgGroupDelay:ee,AlmanacCommonContent:te,AlmanacCommonContentDep:pe,112:re,MsgAlmanacGpsDep:re,114:oe,MsgAlmanacGps:oe,113:ie,MsgAlmanacGloDep:ie,115:se,MsgAlmanacGlo:se,117:ne,MsgGloBiases:ne,SvAzEl:ae,151:le,MsgSvAzEl:le,1600:ce,MsgOsr:ce}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_BASELINE_HEADING",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_BASELINE_HEADING",i.prototype.msg_type=527,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").uint32("heading").uint8("n_sats").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["heading","writeUInt32LE",4]),i.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_ORIENT_QUAT",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_ORIENT_QUAT",s.prototype.msg_type=544,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint32("tow").int32("w").int32("x").int32("y").int32("z").floatle("w_accuracy").floatle("x_accuracy").floatle("y_accuracy").floatle("z_accuracy").uint8("flags"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["w","writeInt32LE",4]),s.prototype.fieldSpec.push(["x","writeInt32LE",4]),s.prototype.fieldSpec.push(["y","writeInt32LE",4]),s.prototype.fieldSpec.push(["z","writeInt32LE",4]),s.prototype.fieldSpec.push(["w_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["x_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["y_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["z_accuracy","writeFloatLE",4]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_ORIENT_EULER",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_ORIENT_EULER",n.prototype.msg_type=545,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("tow").int32("roll").int32("pitch").int32("yaw").floatle("roll_accuracy").floatle("pitch_accuracy").floatle("yaw_accuracy").uint8("flags"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["roll","writeInt32LE",4]),n.prototype.fieldSpec.push(["pitch","writeInt32LE",4]),n.prototype.fieldSpec.push(["yaw","writeInt32LE",4]),n.prototype.fieldSpec.push(["roll_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["pitch_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["yaw_accuracy","writeFloatLE",4]),n.prototype.fieldSpec.push(["flags","writeUInt8",1]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_ANGULAR_RATE",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_ANGULAR_RATE",a.prototype.msg_type=546,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint32("tow").int32("x").int32("y").int32("z").uint8("flags"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),a.prototype.fieldSpec.push(["x","writeInt32LE",4]),a.prototype.fieldSpec.push(["y","writeInt32LE",4]),a.prototype.fieldSpec.push(["z","writeInt32LE",4]),a.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={527:i,MsgBaselineHeading:i,544:s,MsgOrientQuat:s,545:n,MsgOrientEuler:n,546:a,MsgAngularRate:a}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=p(0).GnssSignalDep,n=p(0).GPSTime,a=p(0).GPSTimeDep,l=(p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_ALMANAC",this.fields=t||this.parser.parse(e.payload),this});(l.prototype=Object.create(r.prototype)).messageType="MSG_ALMANAC",l.prototype.msg_type=105,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little"),l.prototype.fieldSpec=[];let c=function(e,t){return r.call(this,e),this.messageType="MSG_SET_TIME",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SET_TIME",c.prototype.msg_type=104,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little"),c.prototype.fieldSpec=[];let u=function(e,t){return r.call(this,e),this.messageType="MSG_RESET",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_RESET",u.prototype.msg_type=182,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint32("flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_RESET_DEP",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_RESET_DEP",y.prototype.msg_type=178,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_CW_RESULTS",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_CW_RESULTS",f.prototype.msg_type=192,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little"),f.prototype.fieldSpec=[];let h=function(e,t){return r.call(this,e),this.messageType="MSG_CW_START",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_CW_START",h.prototype.msg_type=193,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little"),h.prototype.fieldSpec=[];let d=function(e,t){return r.call(this,e),this.messageType="MSG_RESET_FILTERS",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_RESET_FILTERS",d.prototype.msg_type=34,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint8("filter"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["filter","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_INIT_BASE_DEP",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_INIT_BASE_DEP",_.prototype.msg_type=35,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little"),_.prototype.fieldSpec=[];let S=function(e,t){return r.call(this,e),this.messageType="MSG_THREAD_STATE",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_THREAD_STATE",S.prototype.msg_type=23,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").string("name",{length:20}).uint16("cpu").uint32("stack_free"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["name","string",20]),S.prototype.fieldSpec.push(["cpu","writeUInt16LE",2]),S.prototype.fieldSpec.push(["stack_free","writeUInt32LE",4]);let g=function(e,t){return r.call(this,e),this.messageType="UARTChannel",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="UARTChannel",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").floatle("tx_throughput").floatle("rx_throughput").uint16("crc_error_count").uint16("io_error_count").uint8("tx_buffer_level").uint8("rx_buffer_level"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["tx_throughput","writeFloatLE",4]),g.prototype.fieldSpec.push(["rx_throughput","writeFloatLE",4]),g.prototype.fieldSpec.push(["crc_error_count","writeUInt16LE",2]),g.prototype.fieldSpec.push(["io_error_count","writeUInt16LE",2]),g.prototype.fieldSpec.push(["tx_buffer_level","writeUInt8",1]),g.prototype.fieldSpec.push(["rx_buffer_level","writeUInt8",1]);let w=function(e,t){return r.call(this,e),this.messageType="Period",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="Period",w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").int32("avg").int32("pmin").int32("pmax").int32("current"),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["avg","writeInt32LE",4]),w.prototype.fieldSpec.push(["pmin","writeInt32LE",4]),w.prototype.fieldSpec.push(["pmax","writeInt32LE",4]),w.prototype.fieldSpec.push(["current","writeInt32LE",4]);let E=function(e,t){return r.call(this,e),this.messageType="Latency",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="Latency",E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").int32("avg").int32("lmin").int32("lmax").int32("current"),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["avg","writeInt32LE",4]),E.prototype.fieldSpec.push(["lmin","writeInt32LE",4]),E.prototype.fieldSpec.push(["lmax","writeInt32LE",4]),E.prototype.fieldSpec.push(["current","writeInt32LE",4]);let m=function(e,t){return r.call(this,e),this.messageType="MSG_UART_STATE",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="MSG_UART_STATE",m.prototype.msg_type=29,m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("uart_a",{type:g.prototype.parser}).nest("uart_b",{type:g.prototype.parser}).nest("uart_ftdi",{type:g.prototype.parser}).nest("latency",{type:E.prototype.parser}).nest("obs_period",{type:w.prototype.parser}),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["uart_a",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["uart_b",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["uart_ftdi",g.prototype.fieldSpec]),m.prototype.fieldSpec.push(["latency",E.prototype.fieldSpec]),m.prototype.fieldSpec.push(["obs_period",w.prototype.fieldSpec]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_UART_STATE_DEPA",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_UART_STATE_DEPA",b.prototype.msg_type=24,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("uart_a",{type:g.prototype.parser}).nest("uart_b",{type:g.prototype.parser}).nest("uart_ftdi",{type:g.prototype.parser}).nest("latency",{type:E.prototype.parser}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["uart_a",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["uart_b",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["uart_ftdi",g.prototype.fieldSpec]),b.prototype.fieldSpec.push(["latency",E.prototype.fieldSpec]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_IAR_STATE",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_IAR_STATE",I.prototype.msg_type=25,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint32("num_hyps"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["num_hyps","writeUInt32LE",4]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_MASK_SATELLITE",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_MASK_SATELLITE",L.prototype.msg_type=43,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").uint8("mask").nest("sid",{type:i.prototype.parser}),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["mask","writeUInt8",1]),L.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_MASK_SATELLITE_DEP",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_MASK_SATELLITE_DEP",T.prototype.msg_type=27,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").uint8("mask").nest("sid",{type:s.prototype.parser}),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["mask","writeUInt8",1]),T.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_DEVICE_MONITOR",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_DEVICE_MONITOR",v.prototype.msg_type=181,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").int16("dev_vin").int16("cpu_vint").int16("cpu_vaux").int16("cpu_temperature").int16("fe_temperature"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["dev_vin","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_vint","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_vaux","writeInt16LE",2]),v.prototype.fieldSpec.push(["cpu_temperature","writeInt16LE",2]),v.prototype.fieldSpec.push(["fe_temperature","writeInt16LE",2]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_REQ",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_REQ",U.prototype.msg_type=184,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint32("sequence").string("command",{greedy:!0}),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),U.prototype.fieldSpec.push(["command","string",null]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_RESP",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_RESP",M.prototype.msg_type=185,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").uint32("sequence").int32("code"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),M.prototype.fieldSpec.push(["code","writeInt32LE",4]);let D=function(e,t){return r.call(this,e),this.messageType="MSG_COMMAND_OUTPUT",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="MSG_COMMAND_OUTPUT",D.prototype.msg_type=188,D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").uint32("sequence").string("line",{greedy:!0}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),D.prototype.fieldSpec.push(["line","string",null]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_STATE_REQ",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_STATE_REQ",O.prototype.msg_type=186,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little"),O.prototype.fieldSpec=[];let G=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_STATE_RESP",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_STATE_RESP",G.prototype.msg_type=187,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").array("ipv4_address",{length:4,type:"uint8"}).uint8("ipv4_mask_size").array("ipv6_address",{length:16,type:"uint8"}).uint8("ipv6_mask_size").uint32("rx_bytes").uint32("tx_bytes").string("interface_name",{length:16}).uint32("flags"),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["ipv4_address","array","writeUInt8",function(){return 1},4]),G.prototype.fieldSpec.push(["ipv4_mask_size","writeUInt8",1]),G.prototype.fieldSpec.push(["ipv6_address","array","writeUInt8",function(){return 1},16]),G.prototype.fieldSpec.push(["ipv6_mask_size","writeUInt8",1]),G.prototype.fieldSpec.push(["rx_bytes","writeUInt32LE",4]),G.prototype.fieldSpec.push(["tx_bytes","writeUInt32LE",4]),G.prototype.fieldSpec.push(["interface_name","string",16]),G.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let A=function(e,t){return r.call(this,e),this.messageType="NetworkUsage",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="NetworkUsage",A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").uint64("duration").uint64("total_bytes").uint32("rx_bytes").uint32("tx_bytes").string("interface_name",{length:16}),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["duration","writeUInt64LE",8]),A.prototype.fieldSpec.push(["total_bytes","writeUInt64LE",8]),A.prototype.fieldSpec.push(["rx_bytes","writeUInt32LE",4]),A.prototype.fieldSpec.push(["tx_bytes","writeUInt32LE",4]),A.prototype.fieldSpec.push(["interface_name","string",16]);let C=function(e,t){return r.call(this,e),this.messageType="MSG_NETWORK_BANDWIDTH_USAGE",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="MSG_NETWORK_BANDWIDTH_USAGE",C.prototype.msg_type=189,C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").array("interfaces",{type:A.prototype.parser,readUntil:"eof"}),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["interfaces","array",A.prototype.fieldSpec,function(){return this.fields.array.length},null]);let R=function(e,t){return r.call(this,e),this.messageType="MSG_CELL_MODEM_STATUS",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="MSG_CELL_MODEM_STATUS",R.prototype.msg_type=190,R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").int8("signal_strength").floatle("signal_error_rate").array("reserved",{type:"uint8",readUntil:"eof"}),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["signal_strength","writeInt8",1]),R.prototype.fieldSpec.push(["signal_error_rate","writeFloatLE",4]),R.prototype.fieldSpec.push(["reserved","array","writeUInt8",function(){return 1},null]);let P=function(e,t){return r.call(this,e),this.messageType="MSG_SPECAN_DEP",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="MSG_SPECAN_DEP",P.prototype.msg_type=80,P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint16("channel_tag").nest("t",{type:a.prototype.parser}).floatle("freq_ref").floatle("freq_step").floatle("amplitude_ref").floatle("amplitude_unit").array("amplitude_value",{type:"uint8",readUntil:"eof"}),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["channel_tag","writeUInt16LE",2]),P.prototype.fieldSpec.push(["t",a.prototype.fieldSpec]),P.prototype.fieldSpec.push(["freq_ref","writeFloatLE",4]),P.prototype.fieldSpec.push(["freq_step","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_ref","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_unit","writeFloatLE",4]),P.prototype.fieldSpec.push(["amplitude_value","array","writeUInt8",function(){return 1},null]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_SPECAN",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_SPECAN",N.prototype.msg_type=81,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").uint16("channel_tag").nest("t",{type:n.prototype.parser}).floatle("freq_ref").floatle("freq_step").floatle("amplitude_ref").floatle("amplitude_unit").array("amplitude_value",{type:"uint8",readUntil:"eof"}),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["channel_tag","writeUInt16LE",2]),N.prototype.fieldSpec.push(["t",n.prototype.fieldSpec]),N.prototype.fieldSpec.push(["freq_ref","writeFloatLE",4]),N.prototype.fieldSpec.push(["freq_step","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_ref","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_unit","writeFloatLE",4]),N.prototype.fieldSpec.push(["amplitude_value","array","writeUInt8",function(){return 1},null]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_FRONT_END_GAIN",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_FRONT_END_GAIN",j.prototype.msg_type=191,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").array("rf_gain",{length:8,type:"int8"}).array("if_gain",{length:8,type:"int8"}),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["rf_gain","array","writeInt8",function(){return 1},8]),j.prototype.fieldSpec.push(["if_gain","array","writeInt8",function(){return 1},8]),e.exports={105:l,MsgAlmanac:l,104:c,MsgSetTime:c,182:u,MsgReset:u,178:y,MsgResetDep:y,192:f,MsgCwResults:f,193:h,MsgCwStart:h,34:d,MsgResetFilters:d,35:_,MsgInitBaseDep:_,23:S,MsgThreadState:S,UARTChannel:g,Period:w,Latency:E,29:m,MsgUartState:m,24:b,MsgUartStateDepa:b,25:I,MsgIarState:I,43:L,MsgMaskSatellite:L,27:T,MsgMaskSatelliteDep:T,181:v,MsgDeviceMonitor:v,184:U,MsgCommandReq:U,185:M,MsgCommandResp:M,188:D,MsgCommandOutput:D,186:O,MsgNetworkStateReq:O,187:G,MsgNetworkStateResp:G,NetworkUsage:A,189:C,MsgNetworkBandwidthUsage:C,190:R,MsgCellModemStatus:R,80:P,MsgSpecanDep:P,81:N,MsgSpecan:N,191:j,MsgFrontEndGain:j}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_SBAS_RAW",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="MSG_SBAS_RAW",s.prototype.msg_type=30583,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").nest("sid",{type:i.prototype.parser}).uint32("tow").uint8("message_type").array("data",{length:27,type:"uint8"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),s.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["message_type","writeUInt8",1]),s.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},27]),e.exports={30583:s,MsgSbasRaw:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_SAVE",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_SAVE",i.prototype.msg_type=161,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little"),i.prototype.fieldSpec=[];let s=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_WRITE",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_WRITE",s.prototype.msg_type=160,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["setting","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_WRITE_RESP",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_WRITE_RESP",n.prototype.msg_type=175,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("status").string("setting",{greedy:!0}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["status","writeUInt8",1]),n.prototype.fieldSpec.push(["setting","string",null]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_REQ",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_REQ",a.prototype.msg_type=164,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["setting","string",null]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_RESP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_RESP",l.prototype.msg_type=165,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["setting","string",null]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_REQ",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_REQ",c.prototype.msg_type=162,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint16("index"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["index","writeUInt16LE",2]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_RESP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_RESP",u.prototype.msg_type=167,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("index").string("setting",{greedy:!0}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["index","writeUInt16LE",2]),u.prototype.fieldSpec.push(["setting","string",null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_READ_BY_INDEX_DONE",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_READ_BY_INDEX_DONE",y.prototype.msg_type=166,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little"),y.prototype.fieldSpec=[];let f=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_REGISTER",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_REGISTER",f.prototype.msg_type=174,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").string("setting",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["setting","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_SETTINGS_REGISTER_RESP",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_SETTINGS_REGISTER_RESP",h.prototype.msg_type=431,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("status").string("setting",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["status","writeUInt8",1]),h.prototype.fieldSpec.push(["setting","string",null]),e.exports={161:i,MsgSettingsSave:i,160:s,MsgSettingsWrite:s,175:n,MsgSettingsWriteResp:n,164:a,MsgSettingsReadReq:a,165:l,MsgSettingsReadResp:l,162:c,MsgSettingsReadByIndexReq:c,167:u,MsgSettingsReadByIndexResp:u,166:y,MsgSettingsReadByIndexDone:y,174:f,MsgSettingsRegister:f,431:h,MsgSettingsRegisterResp:h}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="UtcTime",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="UtcTime",i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint16("year").uint8("month").uint8("day").uint8("hours").uint8("minutes").uint8("seconds").uint32("ns"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["year","writeUInt16LE",2]),i.prototype.fieldSpec.push(["month","writeUInt8",1]),i.prototype.fieldSpec.push(["day","writeUInt8",1]),i.prototype.fieldSpec.push(["hours","writeUInt8",1]),i.prototype.fieldSpec.push(["minutes","writeUInt8",1]),i.prototype.fieldSpec.push(["seconds","writeUInt8",1]),i.prototype.fieldSpec.push(["ns","writeUInt32LE",4]);let s=function(e,t){return r.call(this,e),this.messageType="ECDSASignature",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="ECDSASignature",s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("len").array("data",{length:72,type:"uint8"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["len","writeUInt8",1]),s.prototype.fieldSpec.push(["data","array","writeUInt8",function(){return 1},72]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_CERTIFICATE",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_CERTIFICATE",n.prototype.msg_type=3076,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint8("n_msg").array("certificate_id",{length:4,type:"uint8"}).uint8("flags").array("certificate_bytes",{type:"uint8",readUntil:"eof"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["n_msg","writeUInt8",1]),n.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),n.prototype.fieldSpec.push(["flags","writeUInt8",1]),n.prototype.fieldSpec.push(["certificate_bytes","array","writeUInt8",function(){return 1},null]);let a=function(e,t){return r.call(this,e),this.messageType="MSG_CERTIFICATE_CHAIN",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="MSG_CERTIFICATE_CHAIN",a.prototype.msg_type=3081,a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").array("root_certificate",{length:20,type:"uint8"}).array("intermediate_certificate",{length:20,type:"uint8"}).array("corrections_certificate",{length:20,type:"uint8"}).nest("expiration",{type:i.prototype.parser}).nest("signature",{type:s.prototype.parser}),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["root_certificate","array","writeUInt8",function(){return 1},20]),a.prototype.fieldSpec.push(["intermediate_certificate","array","writeUInt8",function(){return 1},20]),a.prototype.fieldSpec.push(["corrections_certificate","array","writeUInt8",function(){return 1},20]),a.prototype.fieldSpec.push(["expiration",i.prototype.fieldSpec]),a.prototype.fieldSpec.push(["signature",s.prototype.fieldSpec]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_CERTIFICATE_CHAIN_DEP",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_CERTIFICATE_CHAIN_DEP",l.prototype.msg_type=3077,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").array("root_certificate",{length:20,type:"uint8"}).array("intermediate_certificate",{length:20,type:"uint8"}).array("corrections_certificate",{length:20,type:"uint8"}).nest("expiration",{type:i.prototype.parser}).array("signature",{length:64,type:"uint8"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["root_certificate","array","writeUInt8",function(){return 1},20]),l.prototype.fieldSpec.push(["intermediate_certificate","array","writeUInt8",function(){return 1},20]),l.prototype.fieldSpec.push(["corrections_certificate","array","writeUInt8",function(){return 1},20]),l.prototype.fieldSpec.push(["expiration",i.prototype.fieldSpec]),l.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]);let c=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_SIGNATURE",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_SIGNATURE",c.prototype.msg_type=3080,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint8("flags").uint8("stream_counter").uint8("on_demand_counter").array("certificate_id",{length:4,type:"uint8"}).nest("signature",{type:s.prototype.parser}).array("signed_messages",{type:"uint8",readUntil:"eof"}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["flags","writeUInt8",1]),c.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),c.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),c.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),c.prototype.fieldSpec.push(["signature",s.prototype.fieldSpec]),c.prototype.fieldSpec.push(["signed_messages","array","writeUInt8",function(){return 1},null]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_SIGNATURE_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_SIGNATURE_DEP_B",u.prototype.msg_type=3079,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint8("flags").uint8("stream_counter").uint8("on_demand_counter").array("certificate_id",{length:4,type:"uint8"}).uint8("n_signature_bytes").array("signature",{length:72,type:"uint8"}).array("signed_messages",{type:"uint8",readUntil:"eof"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["flags","writeUInt8",1]),u.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),u.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),u.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),u.prototype.fieldSpec.push(["n_signature_bytes","writeUInt8",1]),u.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},72]),u.prototype.fieldSpec.push(["signed_messages","array","writeUInt8",function(){return 1},null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_ECDSA_SIGNATURE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_ECDSA_SIGNATURE_DEP_A",y.prototype.msg_type=3078,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint8("flags").uint8("stream_counter").uint8("on_demand_counter").array("certificate_id",{length:4,type:"uint8"}).array("signature",{length:64,type:"uint8"}).array("signed_messages",{type:"uint8",readUntil:"eof"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["flags","writeUInt8",1]),y.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),y.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),y.prototype.fieldSpec.push(["certificate_id","array","writeUInt8",function(){return 1},4]),y.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),y.prototype.fieldSpec.push(["signed_messages","array","writeUInt8",function(){return 1},null]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_CERTIFICATE_DEP",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_CERTIFICATE_DEP",f.prototype.msg_type=3074,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint8("n_msg").array("fingerprint",{length:20,type:"uint8"}).array("certificate_bytes",{type:"uint8",readUntil:"eof"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["n_msg","writeUInt8",1]),f.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),f.prototype.fieldSpec.push(["certificate_bytes","array","writeUInt8",function(){return 1},null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_SIGNATURE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_SIGNATURE_DEP_A",h.prototype.msg_type=3073,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").array("signature",{length:64,type:"uint8"}).array("fingerprint",{length:20,type:"uint8"}).array("signed_messages",{type:"uint32le",readUntil:"eof"}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),h.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),h.prototype.fieldSpec.push(["signed_messages","array","writeUInt32LE",function(){return 4},null]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_ED25519_SIGNATURE_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_ED25519_SIGNATURE_DEP_B",d.prototype.msg_type=3075,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint8("stream_counter").uint8("on_demand_counter").array("signature",{length:64,type:"uint8"}).array("fingerprint",{length:20,type:"uint8"}).array("signed_messages",{type:"uint32le",readUntil:"eof"}),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["stream_counter","writeUInt8",1]),d.prototype.fieldSpec.push(["on_demand_counter","writeUInt8",1]),d.prototype.fieldSpec.push(["signature","array","writeUInt8",function(){return 1},64]),d.prototype.fieldSpec.push(["fingerprint","array","writeUInt8",function(){return 1},20]),d.prototype.fieldSpec.push(["signed_messages","array","writeUInt32LE",function(){return 4},null]),e.exports={UtcTime:i,ECDSASignature:s,3076:n,MsgEcdsaCertificate:n,3081:a,MsgCertificateChain:a,3077:l,MsgCertificateChainDep:l,3080:c,MsgEcdsaSignature:c,3079:u,MsgEcdsaSignatureDepB:u,3078:y,MsgEcdsaSignatureDepA:y,3074:f,MsgEd25519CertificateDep:f,3073:h,MsgEd25519SignatureDepA:h,3075:d,MsgEd25519SignatureDepB:d}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="SolutionInputType",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="SolutionInputType",i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("sensor_type").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["sensor_type","writeUInt8",1]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_SOLN_META_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_SOLN_META_DEP_A",s.prototype.msg_type=65295,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint16("pdop").uint16("hdop").uint16("vdop").uint8("n_sats").uint16("age_corrections").uint8("alignment_status").uint32("last_used_gnss_pos_tow").uint32("last_used_gnss_vel_tow").array("sol_in",{type:i.prototype.parser,readUntil:"eof"}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),s.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),s.prototype.fieldSpec.push(["age_corrections","writeUInt16LE",2]),s.prototype.fieldSpec.push(["alignment_status","writeUInt8",1]),s.prototype.fieldSpec.push(["last_used_gnss_pos_tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["last_used_gnss_vel_tow","writeUInt32LE",4]),s.prototype.fieldSpec.push(["sol_in","array",i.prototype.fieldSpec,function(){return this.fields.array.length},null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_SOLN_META",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_SOLN_META",n.prototype.msg_type=65294,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("tow").uint16("pdop").uint16("hdop").uint16("vdop").uint16("age_corrections").uint32("age_gnss").array("sol_in",{type:i.prototype.parser,readUntil:"eof"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["pdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["hdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["vdop","writeUInt16LE",2]),n.prototype.fieldSpec.push(["age_corrections","writeUInt16LE",2]),n.prototype.fieldSpec.push(["age_gnss","writeUInt32LE",4]),n.prototype.fieldSpec.push(["sol_in","array",i.prototype.fieldSpec,function(){return this.fields.array.length},null]);let a=function(e,t){return r.call(this,e),this.messageType="GNSSInputType",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="GNSSInputType",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("flags"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["flags","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="IMUInputType",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="IMUInputType",l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("flags"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["flags","writeUInt8",1]);let c=function(e,t){return r.call(this,e),this.messageType="OdoInputType",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="OdoInputType",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint8("flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["flags","writeUInt8",1]),e.exports={SolutionInputType:i,65295:s,MsgSolnMetaDepA:s,65294:n,MsgSolnMeta:n,GNSSInputType:a,IMUInputType:l,OdoInputType:c}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec),n=p(0).SvId,a=function(e,t){return r.call(this,e),this.messageType="CodeBiasesContent",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="CodeBiasesContent",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint8("code").int16("value"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["code","writeUInt8",1]),a.prototype.fieldSpec.push(["value","writeInt16LE",2]);let l=function(e,t){return r.call(this,e),this.messageType="PhaseBiasesContent",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="PhaseBiasesContent",l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint8("code").uint8("integer_indicator").uint8("widelane_integer_indicator").uint8("discontinuity_counter").int32("bias"),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["code","writeUInt8",1]),l.prototype.fieldSpec.push(["integer_indicator","writeUInt8",1]),l.prototype.fieldSpec.push(["widelane_integer_indicator","writeUInt8",1]),l.prototype.fieldSpec.push(["discontinuity_counter","writeUInt8",1]),l.prototype.fieldSpec.push(["bias","writeInt32LE",4]);let c=function(e,t){return r.call(this,e),this.messageType="STECHeader",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="STECHeader",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("iod_atmo"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),c.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),c.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),c.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),c.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),c.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),c.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="GriddedCorrectionHeader",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="GriddedCorrectionHeader",u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").nest("time",{type:s.prototype.parser}).uint16("num_msgs").uint16("seq_num").uint8("update_interval").uint8("iod_atmo").uint8("tropo_quality_indicator"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),u.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),u.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),u.prototype.fieldSpec.push(["num_msgs","writeUInt16LE",2]),u.prototype.fieldSpec.push(["seq_num","writeUInt16LE",2]),u.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),u.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),u.prototype.fieldSpec.push(["tropo_quality_indicator","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="STECSatElement",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="STECSatElement",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).uint8("stec_quality_indicator").array("stec_coeff",{length:4,type:"int16le"}),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),y.prototype.fieldSpec.push(["stec_quality_indicator","writeUInt8",1]),y.prototype.fieldSpec.push(["stec_coeff","array","writeInt16LE",function(){return 2},4]);let f=function(e,t){return r.call(this,e),this.messageType="TroposphericDelayCorrectionNoStd",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="TroposphericDelayCorrectionNoStd",f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").int16("hydro").int8("wet"),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["hydro","writeInt16LE",2]),f.prototype.fieldSpec.push(["wet","writeInt8",1]);let h=function(e,t){return r.call(this,e),this.messageType="TroposphericDelayCorrection",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="TroposphericDelayCorrection",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").int16("hydro").int8("wet").uint8("stddev"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["hydro","writeInt16LE",2]),h.prototype.fieldSpec.push(["wet","writeInt8",1]),h.prototype.fieldSpec.push(["stddev","writeUInt8",1]);let d=function(e,t){return r.call(this,e),this.messageType="STECResidualNoStd",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="STECResidualNoStd",d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).int16("residual"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),d.prototype.fieldSpec.push(["residual","writeInt16LE",2]);let _=function(e,t){return r.call(this,e),this.messageType="STECResidual",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="STECResidual",_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").nest("sv_id",{type:n.prototype.parser}).int16("residual").uint8("stddev"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["sv_id",n.prototype.fieldSpec]),_.prototype.fieldSpec.push(["residual","writeInt16LE",2]),_.prototype.fieldSpec.push(["stddev","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK",S.prototype.msg_type=1501,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint32("iod").int32("radial").int32("along").int32("cross").int32("dot_radial").int32("dot_along").int32("dot_cross").int32("c0").int32("c1").int32("c2"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),S.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),S.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),S.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),S.prototype.fieldSpec.push(["iod","writeUInt32LE",4]),S.prototype.fieldSpec.push(["radial","writeInt32LE",4]),S.prototype.fieldSpec.push(["along","writeInt32LE",4]),S.prototype.fieldSpec.push(["cross","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_radial","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_along","writeInt32LE",4]),S.prototype.fieldSpec.push(["dot_cross","writeInt32LE",4]),S.prototype.fieldSpec.push(["c0","writeInt32LE",4]),S.prototype.fieldSpec.push(["c1","writeInt32LE",4]),S.prototype.fieldSpec.push(["c2","writeInt32LE",4]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_CODE_BIASES",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_SSR_CODE_BIASES",g.prototype.msg_type=1505,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").array("biases",{type:a.prototype.parser,readUntil:"eof"}),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),g.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),g.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),g.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),g.prototype.fieldSpec.push(["biases","array",a.prototype.fieldSpec,function(){return this.fields.array.length},null]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_PHASE_BIASES",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_SSR_PHASE_BIASES",w.prototype.msg_type=1510,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint8("dispersive_bias").uint8("mw_consistency").uint16("yaw").int8("yaw_rate").array("biases",{type:l.prototype.parser,readUntil:"eof"}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),w.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),w.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),w.prototype.fieldSpec.push(["dispersive_bias","writeUInt8",1]),w.prototype.fieldSpec.push(["mw_consistency","writeUInt8",1]),w.prototype.fieldSpec.push(["yaw","writeUInt16LE",2]),w.prototype.fieldSpec.push(["yaw_rate","writeInt8",1]),w.prototype.fieldSpec.push(["biases","array",l.prototype.fieldSpec,function(){return this.fields.array.length},null]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION_DEP",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION_DEP",E.prototype.msg_type=1531,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").nest("header",{type:c.prototype.parser}).array("stec_sat_list",{type:y.prototype.parser,readUntil:"eof"}),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["header",c.prototype.fieldSpec]),E.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let m=function(e,t){return r.call(this,e),this.messageType="BoundsHeader",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="BoundsHeader",m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("sol_id"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),m.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),m.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),m.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),m.prototype.fieldSpec.push(["sol_id","writeUInt8",1]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION",b.prototype.msg_type=1533,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod_atmo").uint16("tile_set_id").uint16("tile_id").uint8("n_sats").array("stec_sat_list",{type:y.prototype.parser,length:"n_sats"}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),b.prototype.fieldSpec.push(["ssr_iod_atmo","writeUInt8",1]),b.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),b.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),b.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),b.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let I=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION",I.prototype.msg_type=1532,I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").nest("header",{type:u.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:h.prototype.parser}).array("stec_residuals",{type:_.prototype.parser,readUntil:"eof"}),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["header",u.prototype.fieldSpec]),I.prototype.fieldSpec.push(["index","writeUInt16LE",2]),I.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),I.prototype.fieldSpec.push(["stec_residuals","array",_.prototype.fieldSpec,function(){return this.fields.array.length},null]);let L=function(e,t){return r.call(this,e),this.messageType="STECSatElementIntegrity",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="STECSatElementIntegrity",L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").nest("stec_residual",{type:_.prototype.parser}).uint8("stec_bound_mu").uint8("stec_bound_sig").uint8("stec_bound_mu_dot").uint8("stec_bound_sig_dot"),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["stec_residual",_.prototype.fieldSpec]),L.prototype.fieldSpec.push(["stec_bound_mu","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_sig","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_mu_dot","writeUInt8",1]),L.prototype.fieldSpec.push(["stec_bound_sig_dot","writeUInt8",1]);let T=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(T.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_BOUNDS",T.prototype.msg_type=1534,T.prototype.constructor=T,T.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod_atmo").uint16("tile_set_id").uint16("tile_id").uint8("tropo_qi").uint16("grid_point_id").nest("tropo_delay_correction",{type:h.prototype.parser}).uint8("tropo_v_hydro_bound_mu").uint8("tropo_v_hydro_bound_sig").uint8("tropo_v_wet_bound_mu").uint8("tropo_v_wet_bound_sig").uint8("n_sats").array("stec_sat_list",{type:L.prototype.parser,length:"n_sats"}),T.prototype.fieldSpec=[],T.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),T.prototype.fieldSpec.push(["ssr_iod_atmo","writeUInt8",1]),T.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tropo_qi","writeUInt8",1]),T.prototype.fieldSpec.push(["grid_point_id","writeUInt16LE",2]),T.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),T.prototype.fieldSpec.push(["tropo_v_hydro_bound_mu","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_hydro_bound_sig","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_wet_bound_mu","writeUInt8",1]),T.prototype.fieldSpec.push(["tropo_v_wet_bound_sig","writeUInt8",1]),T.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),T.prototype.fieldSpec.push(["stec_sat_list","array",L.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let v=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(v.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION_DEP_A",v.prototype.msg_type=1526,v.prototype.constructor=v,v.prototype.parser=(new o).endianess("little").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),v.prototype.fieldSpec=[],v.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),v.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),v.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),v.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),v.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),v.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),v.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),v.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),v.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let U=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(U.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION_DEP_B",U.prototype.msg_type=1527,U.prototype.constructor=U,U.prototype.parser=(new o).endianess("little").uint8("ssr_sol_id").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),U.prototype.fieldSpec=[],U.prototype.fieldSpec.push(["ssr_sol_id","writeUInt8",1]),U.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),U.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),U.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),U.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),U.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),U.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),U.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),U.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),U.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let M=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_TILE_DEFINITION",this.fields=t||this.parser.parse(e.payload),this};(M.prototype=Object.create(r.prototype)).messageType="MSG_SSR_TILE_DEFINITION",M.prototype.msg_type=1528,M.prototype.constructor=M,M.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("update_interval").uint8("sol_id").uint8("iod_atmo").uint16("tile_set_id").uint16("tile_id").int16("corner_nw_lat").int16("corner_nw_lon").uint16("spacing_lat").uint16("spacing_lon").uint16("rows").uint16("cols").uint64("bitmask"),M.prototype.fieldSpec=[],M.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),M.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),M.prototype.fieldSpec.push(["sol_id","writeUInt8",1]),M.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),M.prototype.fieldSpec.push(["tile_set_id","writeUInt16LE",2]),M.prototype.fieldSpec.push(["tile_id","writeUInt16LE",2]),M.prototype.fieldSpec.push(["corner_nw_lat","writeInt16LE",2]),M.prototype.fieldSpec.push(["corner_nw_lon","writeInt16LE",2]),M.prototype.fieldSpec.push(["spacing_lat","writeUInt16LE",2]),M.prototype.fieldSpec.push(["spacing_lon","writeUInt16LE",2]),M.prototype.fieldSpec.push(["rows","writeUInt16LE",2]),M.prototype.fieldSpec.push(["cols","writeUInt16LE",2]),M.prototype.fieldSpec.push(["bitmask","writeUInt64LE",8]);let D=function(e,t){return r.call(this,e),this.messageType="SatelliteAPC",this.fields=t||this.parser.parse(e.payload),this};(D.prototype=Object.create(r.prototype)).messageType="SatelliteAPC",D.prototype.constructor=D,D.prototype.parser=(new o).endianess("little").nest("sid",{type:i.prototype.parser}).uint8("sat_info").uint16("svn").array("pco",{length:3,type:"int16le"}).array("pcv",{length:21,type:"int8"}),D.prototype.fieldSpec=[],D.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),D.prototype.fieldSpec.push(["sat_info","writeUInt8",1]),D.prototype.fieldSpec.push(["svn","writeUInt16LE",2]),D.prototype.fieldSpec.push(["pco","array","writeInt16LE",function(){return 2},3]),D.prototype.fieldSpec.push(["pcv","array","writeInt8",function(){return 1},21]);let O=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_SATELLITE_APC_DEP",this.fields=t||this.parser.parse(e.payload),this};(O.prototype=Object.create(r.prototype)).messageType="MSG_SSR_SATELLITE_APC_DEP",O.prototype.msg_type=1540,O.prototype.constructor=O,O.prototype.parser=(new o).endianess("little").array("apc",{type:D.prototype.parser,readUntil:"eof"}),O.prototype.fieldSpec=[],O.prototype.fieldSpec.push(["apc","array",D.prototype.fieldSpec,function(){return this.fields.array.length},null]);let G=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_SATELLITE_APC",this.fields=t||this.parser.parse(e.payload),this};(G.prototype=Object.create(r.prototype)).messageType="MSG_SSR_SATELLITE_APC",G.prototype.msg_type=1541,G.prototype.constructor=G,G.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("update_interval").uint8("sol_id").uint8("iod_ssr").array("apc",{type:D.prototype.parser,readUntil:"eof"}),G.prototype.fieldSpec=[],G.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),G.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),G.prototype.fieldSpec.push(["sol_id","writeUInt8",1]),G.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),G.prototype.fieldSpec.push(["apc","array",D.prototype.fieldSpec,function(){return this.fields.array.length},null]);let A=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(A.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_DEP_A",A.prototype.msg_type=1500,A.prototype.constructor=A,A.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).nest("sid",{type:i.prototype.parser}).uint8("update_interval").uint8("iod_ssr").uint8("iod").int32("radial").int32("along").int32("cross").int32("dot_radial").int32("dot_along").int32("dot_cross").int32("c0").int32("c1").int32("c2"),A.prototype.fieldSpec=[],A.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),A.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]),A.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),A.prototype.fieldSpec.push(["iod_ssr","writeUInt8",1]),A.prototype.fieldSpec.push(["iod","writeUInt8",1]),A.prototype.fieldSpec.push(["radial","writeInt32LE",4]),A.prototype.fieldSpec.push(["along","writeInt32LE",4]),A.prototype.fieldSpec.push(["cross","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_radial","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_along","writeInt32LE",4]),A.prototype.fieldSpec.push(["dot_cross","writeInt32LE",4]),A.prototype.fieldSpec.push(["c0","writeInt32LE",4]),A.prototype.fieldSpec.push(["c1","writeInt32LE",4]),A.prototype.fieldSpec.push(["c2","writeInt32LE",4]);let C=function(e,t){return r.call(this,e),this.messageType="STECHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(C.prototype=Object.create(r.prototype)).messageType="STECHeaderDepA",C.prototype.constructor=C,C.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint8("num_msgs").uint8("seq_num").uint8("update_interval").uint8("iod_atmo"),C.prototype.fieldSpec=[],C.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),C.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),C.prototype.fieldSpec.push(["seq_num","writeUInt8",1]),C.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),C.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]);let R=function(e,t){return r.call(this,e),this.messageType="GriddedCorrectionHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(R.prototype=Object.create(r.prototype)).messageType="GriddedCorrectionHeaderDepA",R.prototype.constructor=R,R.prototype.parser=(new o).endianess("little").nest("time",{type:s.prototype.parser}).uint16("num_msgs").uint16("seq_num").uint8("update_interval").uint8("iod_atmo").uint8("tropo_quality_indicator"),R.prototype.fieldSpec=[],R.prototype.fieldSpec.push(["time",s.prototype.fieldSpec]),R.prototype.fieldSpec.push(["num_msgs","writeUInt16LE",2]),R.prototype.fieldSpec.push(["seq_num","writeUInt16LE",2]),R.prototype.fieldSpec.push(["update_interval","writeUInt8",1]),R.prototype.fieldSpec.push(["iod_atmo","writeUInt8",1]),R.prototype.fieldSpec.push(["tropo_quality_indicator","writeUInt8",1]);let P=function(e,t){return r.call(this,e),this.messageType="GridDefinitionHeaderDepA",this.fields=t||this.parser.parse(e.payload),this};(P.prototype=Object.create(r.prototype)).messageType="GridDefinitionHeaderDepA",P.prototype.constructor=P,P.prototype.parser=(new o).endianess("little").uint8("region_size_inverse").uint16("area_width").uint16("lat_nw_corner_enc").uint16("lon_nw_corner_enc").uint8("num_msgs").uint8("seq_num"),P.prototype.fieldSpec=[],P.prototype.fieldSpec.push(["region_size_inverse","writeUInt8",1]),P.prototype.fieldSpec.push(["area_width","writeUInt16LE",2]),P.prototype.fieldSpec.push(["lat_nw_corner_enc","writeUInt16LE",2]),P.prototype.fieldSpec.push(["lon_nw_corner_enc","writeUInt16LE",2]),P.prototype.fieldSpec.push(["num_msgs","writeUInt8",1]),P.prototype.fieldSpec.push(["seq_num","writeUInt8",1]);let N=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_STEC_CORRECTION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(N.prototype=Object.create(r.prototype)).messageType="MSG_SSR_STEC_CORRECTION_DEP_A",N.prototype.msg_type=1515,N.prototype.constructor=N,N.prototype.parser=(new o).endianess("little").nest("header",{type:C.prototype.parser}).array("stec_sat_list",{type:y.prototype.parser,readUntil:"eof"}),N.prototype.fieldSpec=[],N.prototype.fieldSpec.push(["header",C.prototype.fieldSpec]),N.prototype.fieldSpec.push(["stec_sat_list","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let j=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(j.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_NO_STD_DEP_A",j.prototype.msg_type=1520,j.prototype.constructor=j,j.prototype.parser=(new o).endianess("little").nest("header",{type:R.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:f.prototype.parser}).array("stec_residuals",{type:d.prototype.parser,readUntil:"eof"}),j.prototype.fieldSpec=[],j.prototype.fieldSpec.push(["header",R.prototype.fieldSpec]),j.prototype.fieldSpec.push(["index","writeUInt16LE",2]),j.prototype.fieldSpec.push(["tropo_delay_correction",f.prototype.fieldSpec]),j.prototype.fieldSpec.push(["stec_residuals","array",d.prototype.fieldSpec,function(){return this.fields.array.length},null]);let x=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRIDDED_CORRECTION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(x.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRIDDED_CORRECTION_DEP_A",x.prototype.msg_type=1530,x.prototype.constructor=x,x.prototype.parser=(new o).endianess("little").nest("header",{type:R.prototype.parser}).uint16("index").nest("tropo_delay_correction",{type:h.prototype.parser}).array("stec_residuals",{type:_.prototype.parser,readUntil:"eof"}),x.prototype.fieldSpec=[],x.prototype.fieldSpec.push(["header",R.prototype.fieldSpec]),x.prototype.fieldSpec.push(["index","writeUInt16LE",2]),x.prototype.fieldSpec.push(["tropo_delay_correction",h.prototype.fieldSpec]),x.prototype.fieldSpec.push(["stec_residuals","array",_.prototype.fieldSpec,function(){return this.fields.array.length},null]);let F=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_GRID_DEFINITION_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(F.prototype=Object.create(r.prototype)).messageType="MSG_SSR_GRID_DEFINITION_DEP_A",F.prototype.msg_type=1525,F.prototype.constructor=F,F.prototype.parser=(new o).endianess("little").nest("header",{type:P.prototype.parser}).array("rle_list",{type:"uint8",readUntil:"eof"}),F.prototype.fieldSpec=[],F.prototype.fieldSpec.push(["header",P.prototype.fieldSpec]),F.prototype.fieldSpec.push(["rle_list","array","writeUInt8",function(){return 1},null]);let k=function(e,t){return r.call(this,e),this.messageType="OrbitClockBound",this.fields=t||this.parser.parse(e.payload),this};(k.prototype=Object.create(r.prototype)).messageType="OrbitClockBound",k.prototype.constructor=k,k.prototype.parser=(new o).endianess("little").uint8("sat_id").uint8("orb_radial_bound_mu").uint8("orb_along_bound_mu").uint8("orb_cross_bound_mu").uint8("orb_radial_bound_sig").uint8("orb_along_bound_sig").uint8("orb_cross_bound_sig").uint8("clock_bound_mu").uint8("clock_bound_sig"),k.prototype.fieldSpec=[],k.prototype.fieldSpec.push(["sat_id","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_radial_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_along_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_cross_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_radial_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_along_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["orb_cross_bound_sig","writeUInt8",1]),k.prototype.fieldSpec.push(["clock_bound_mu","writeUInt8",1]),k.prototype.fieldSpec.push(["clock_bound_sig","writeUInt8",1]);let B=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(B.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS",B.prototype.msg_type=1502,B.prototype.constructor=B,B.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint8("n_sats").array("orbit_clock_bounds",{type:k.prototype.parser,length:"n_sats"}),B.prototype.fieldSpec=[],B.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),B.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),B.prototype.fieldSpec.push(["const_id","writeUInt8",1]),B.prototype.fieldSpec.push(["n_sats","writeUInt8",1]),B.prototype.fieldSpec.push(["orbit_clock_bounds","array",k.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats"]);let q=function(e,t){return r.call(this,e),this.messageType="CodePhaseBiasesSatSig",this.fields=t||this.parser.parse(e.payload),this};(q.prototype=Object.create(r.prototype)).messageType="CodePhaseBiasesSatSig",q.prototype.constructor=q,q.prototype.parser=(new o).endianess("little").uint8("sat_id").uint8("signal_id").uint8("code_bias_bound_mu").uint8("code_bias_bound_sig").uint8("phase_bias_bound_mu").uint8("phase_bias_bound_sig"),q.prototype.fieldSpec=[],q.prototype.fieldSpec.push(["sat_id","writeUInt8",1]),q.prototype.fieldSpec.push(["signal_id","writeUInt8",1]),q.prototype.fieldSpec.push(["code_bias_bound_mu","writeUInt8",1]),q.prototype.fieldSpec.push(["code_bias_bound_sig","writeUInt8",1]),q.prototype.fieldSpec.push(["phase_bias_bound_mu","writeUInt8",1]),q.prototype.fieldSpec.push(["phase_bias_bound_sig","writeUInt8",1]);let z=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_CODE_PHASE_BIASES_BOUNDS",this.fields=t||this.parser.parse(e.payload),this};(z.prototype=Object.create(r.prototype)).messageType="MSG_SSR_CODE_PHASE_BIASES_BOUNDS",z.prototype.msg_type=1516,z.prototype.constructor=z,z.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint8("n_sats_signals").array("satellites_signals",{type:q.prototype.parser,length:"n_sats_signals"}),z.prototype.fieldSpec=[],z.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),z.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),z.prototype.fieldSpec.push(["const_id","writeUInt8",1]),z.prototype.fieldSpec.push(["n_sats_signals","writeUInt8",1]),z.prototype.fieldSpec.push(["satellites_signals","array",q.prototype.fieldSpec,function(){return this.fields.array.length},"n_sats_signals"]);let H=function(e,t){return r.call(this,e),this.messageType="OrbitClockBoundDegradation",this.fields=t||this.parser.parse(e.payload),this};(H.prototype=Object.create(r.prototype)).messageType="OrbitClockBoundDegradation",H.prototype.constructor=H,H.prototype.parser=(new o).endianess("little").uint8("orb_radial_bound_mu_dot").uint8("orb_along_bound_mu_dot").uint8("orb_cross_bound_mu_dot").uint8("orb_radial_bound_sig_dot").uint8("orb_along_bound_sig_dot").uint8("orb_cross_bound_sig_dot").uint8("clock_bound_mu_dot").uint8("clock_bound_sig_dot"),H.prototype.fieldSpec=[],H.prototype.fieldSpec.push(["orb_radial_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_along_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_cross_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_radial_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_along_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["orb_cross_bound_sig_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["clock_bound_mu_dot","writeUInt8",1]),H.prototype.fieldSpec.push(["clock_bound_sig_dot","writeUInt8",1]);let V=function(e,t){return r.call(this,e),this.messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION",this.fields=t||this.parser.parse(e.payload),this};(V.prototype=Object.create(r.prototype)).messageType="MSG_SSR_ORBIT_CLOCK_BOUNDS_DEGRADATION",V.prototype.msg_type=1503,V.prototype.constructor=V,V.prototype.parser=(new o).endianess("little").nest("header",{type:m.prototype.parser}).uint8("ssr_iod").uint8("const_id").uint64("sat_bitmask").nest("orbit_clock_bounds_degradation",{type:H.prototype.parser}),V.prototype.fieldSpec=[],V.prototype.fieldSpec.push(["header",m.prototype.fieldSpec]),V.prototype.fieldSpec.push(["ssr_iod","writeUInt8",1]),V.prototype.fieldSpec.push(["const_id","writeUInt8",1]),V.prototype.fieldSpec.push(["sat_bitmask","writeUInt64LE",8]),V.prototype.fieldSpec.push(["orbit_clock_bounds_degradation",H.prototype.fieldSpec]),e.exports={CodeBiasesContent:a,PhaseBiasesContent:l,STECHeader:c,GriddedCorrectionHeader:u,STECSatElement:y,TroposphericDelayCorrectionNoStd:f,TroposphericDelayCorrection:h,STECResidualNoStd:d,STECResidual:_,1501:S,MsgSsrOrbitClock:S,1505:g,MsgSsrCodeBiases:g,1510:w,MsgSsrPhaseBiases:w,1531:E,MsgSsrStecCorrectionDep:E,BoundsHeader:m,1533:b,MsgSsrStecCorrection:b,1532:I,MsgSsrGriddedCorrection:I,STECSatElementIntegrity:L,1534:T,MsgSsrGriddedCorrectionBounds:T,1526:v,MsgSsrTileDefinitionDepA:v,1527:U,MsgSsrTileDefinitionDepB:U,1528:M,MsgSsrTileDefinition:M,SatelliteAPC:D,1540:O,MsgSsrSatelliteApcDep:O,1541:G,MsgSsrSatelliteApc:G,1500:A,MsgSsrOrbitClockDepA:A,STECHeaderDepA:C,GriddedCorrectionHeaderDepA:R,GridDefinitionHeaderDepA:P,1515:N,MsgSsrStecCorrectionDepA:N,1520:j,MsgSsrGriddedCorrectionNoStdDepA:j,1530:x,MsgSsrGriddedCorrectionDepA:x,1525:F,MsgSsrGridDefinitionDepA:F,OrbitClockBound:k,1502:B,MsgSsrOrbitClockBounds:B,CodePhaseBiasesSatSig:q,1516:z,MsgSsrCodePhaseBiasesBounds:z,OrbitClockBoundDegradation:H,1503:V,MsgSsrOrbitClockBoundsDegradation:V}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_STARTUP",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_STARTUP",i.prototype.msg_type=65280,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint8("cause").uint8("startup_type").uint16("reserved"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["cause","writeUInt8",1]),i.prototype.fieldSpec.push(["startup_type","writeUInt8",1]),i.prototype.fieldSpec.push(["reserved","writeUInt16LE",2]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_DGNSS_STATUS",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_DGNSS_STATUS",s.prototype.msg_type=65282,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("flags").uint16("latency").uint8("num_signals").string("source",{greedy:!0}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["flags","writeUInt8",1]),s.prototype.fieldSpec.push(["latency","writeUInt16LE",2]),s.prototype.fieldSpec.push(["num_signals","writeUInt8",1]),s.prototype.fieldSpec.push(["source","string",null]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_HEARTBEAT",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_HEARTBEAT",n.prototype.msg_type=65535,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint32("flags"),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let a=function(e,t){return r.call(this,e),this.messageType="SubSystemReport",this.fields=t||this.parser.parse(e.payload),this};(a.prototype=Object.create(r.prototype)).messageType="SubSystemReport",a.prototype.constructor=a,a.prototype.parser=(new o).endianess("little").uint16("component").uint8("generic").uint8("specific"),a.prototype.fieldSpec=[],a.prototype.fieldSpec.push(["component","writeUInt16LE",2]),a.prototype.fieldSpec.push(["generic","writeUInt8",1]),a.prototype.fieldSpec.push(["specific","writeUInt8",1]);let l=function(e,t){return r.call(this,e),this.messageType="MSG_STATUS_REPORT",this.fields=t||this.parser.parse(e.payload),this};(l.prototype=Object.create(r.prototype)).messageType="MSG_STATUS_REPORT",l.prototype.msg_type=65534,l.prototype.constructor=l,l.prototype.parser=(new o).endianess("little").uint16("reporting_system").uint16("sbp_version").uint32("sequence").uint32("uptime").array("status",{type:a.prototype.parser,readUntil:"eof"}),l.prototype.fieldSpec=[],l.prototype.fieldSpec.push(["reporting_system","writeUInt16LE",2]),l.prototype.fieldSpec.push(["sbp_version","writeUInt16LE",2]),l.prototype.fieldSpec.push(["sequence","writeUInt32LE",4]),l.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),l.prototype.fieldSpec.push(["status","array",a.prototype.fieldSpec,function(){return this.fields.array.length},null]);let c=function(e,t){return r.call(this,e),this.messageType="StatusJournalItem",this.fields=t||this.parser.parse(e.payload),this};(c.prototype=Object.create(r.prototype)).messageType="StatusJournalItem",c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint32("uptime").nest("report",{type:a.prototype.parser}),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),c.prototype.fieldSpec.push(["report",a.prototype.fieldSpec]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_STATUS_JOURNAL",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_STATUS_JOURNAL",u.prototype.msg_type=65533,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint16("reporting_system").uint16("sbp_version").uint32("total_status_reports").uint8("sequence_descriptor").array("journal",{type:c.prototype.parser,readUntil:"eof"}),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["reporting_system","writeUInt16LE",2]),u.prototype.fieldSpec.push(["sbp_version","writeUInt16LE",2]),u.prototype.fieldSpec.push(["total_status_reports","writeUInt32LE",4]),u.prototype.fieldSpec.push(["sequence_descriptor","writeUInt8",1]),u.prototype.fieldSpec.push(["journal","array",c.prototype.fieldSpec,function(){return this.fields.array.length},null]);let y=function(e,t){return r.call(this,e),this.messageType="MSG_INS_STATUS",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="MSG_INS_STATUS",y.prototype.msg_type=65283,y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").uint32("flags"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_CSAC_TELEMETRY",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_CSAC_TELEMETRY",f.prototype.msg_type=65284,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").uint8("id").string("telemetry",{greedy:!0}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["id","writeUInt8",1]),f.prototype.fieldSpec.push(["telemetry","string",null]);let h=function(e,t){return r.call(this,e),this.messageType="MSG_CSAC_TELEMETRY_LABELS",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MSG_CSAC_TELEMETRY_LABELS",h.prototype.msg_type=65285,h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").uint8("id").string("telemetry_labels",{greedy:!0}),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["id","writeUInt8",1]),h.prototype.fieldSpec.push(["telemetry_labels","string",null]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_INS_UPDATES",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_INS_UPDATES",d.prototype.msg_type=65286,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").uint32("tow").uint8("gnsspos").uint8("gnssvel").uint8("wheelticks").uint8("speed").uint8("nhc").uint8("zerovel"),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),d.prototype.fieldSpec.push(["gnsspos","writeUInt8",1]),d.prototype.fieldSpec.push(["gnssvel","writeUInt8",1]),d.prototype.fieldSpec.push(["wheelticks","writeUInt8",1]),d.prototype.fieldSpec.push(["speed","writeUInt8",1]),d.prototype.fieldSpec.push(["nhc","writeUInt8",1]),d.prototype.fieldSpec.push(["zerovel","writeUInt8",1]);let _=function(e,t){return r.call(this,e),this.messageType="MSG_GNSS_TIME_OFFSET",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="MSG_GNSS_TIME_OFFSET",_.prototype.msg_type=65287,_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").int16("weeks").int32("milliseconds").int16("microseconds").uint8("flags"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["weeks","writeInt16LE",2]),_.prototype.fieldSpec.push(["milliseconds","writeInt32LE",4]),_.prototype.fieldSpec.push(["microseconds","writeInt16LE",2]),_.prototype.fieldSpec.push(["flags","writeUInt8",1]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_PPS_TIME",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_PPS_TIME",S.prototype.msg_type=65288,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint64("time").uint8("flags"),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["time","writeUInt64LE",8]),S.prototype.fieldSpec.push(["flags","writeUInt8",1]);let g=function(e,t){return r.call(this,e),this.messageType="MSG_SENSOR_AID_EVENT",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="MSG_SENSOR_AID_EVENT",g.prototype.msg_type=65289,g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").uint32("time").uint8("sensor_type").uint16("sensor_id").uint8("sensor_state").uint8("n_available_meas").uint8("n_attempted_meas").uint8("n_accepted_meas").uint32("flags"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["time","writeUInt32LE",4]),g.prototype.fieldSpec.push(["sensor_type","writeUInt8",1]),g.prototype.fieldSpec.push(["sensor_id","writeUInt16LE",2]),g.prototype.fieldSpec.push(["sensor_state","writeUInt8",1]),g.prototype.fieldSpec.push(["n_available_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["n_attempted_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["n_accepted_meas","writeUInt8",1]),g.prototype.fieldSpec.push(["flags","writeUInt32LE",4]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_GROUP_META",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_GROUP_META",w.prototype.msg_type=65290,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint8("group_id").uint8("flags").uint8("n_group_msgs").array("group_msgs",{type:"uint16le",length:"n_group_msgs"}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["group_id","writeUInt8",1]),w.prototype.fieldSpec.push(["flags","writeUInt8",1]),w.prototype.fieldSpec.push(["n_group_msgs","writeUInt8",1]),w.prototype.fieldSpec.push(["group_msgs","array","writeUInt16LE",function(){return 2},"n_group_msgs"]),e.exports={65280:i,MsgStartup:i,65282:s,MsgDgnssStatus:s,65535:n,MsgHeartbeat:n,SubSystemReport:a,65534:l,MsgStatusReport:l,StatusJournalItem:c,65533:u,MsgStatusJournal:u,65283:y,MsgInsStatus:y,65284:f,MsgCsacTelemetry:f,65285:h,MsgCsacTelemetryLabels:h,65286:d,MsgInsUpdates:d,65287:_,MsgGnssTimeOffset:_,65288:S,MsgPpsTime:S,65289:g,MsgSensorAidEvent:g,65290:w,MsgGroupMeta:w}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase),s=p(0).GnssSignal,n=p(0).GnssSignalDep,a=p(0).GPSTime,l=p(0).GPSTimeDep,c=(p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DETAILED_DEP_A",this.fields=t||this.parser.parse(e.payload),this});(c.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DETAILED_DEP_A",c.prototype.msg_type=33,c.prototype.constructor=c,c.prototype.parser=(new o).endianess("little").uint64("recv_time").nest("tot",{type:a.prototype.parser}).uint32("P").uint16("P_std").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:s.prototype.parser}).int32("doppler").uint16("doppler_std").uint32("uptime").int16("clock_offset").int16("clock_drift").uint16("corr_spacing").int8("acceleration").uint8("sync_flags").uint8("tow_flags").uint8("track_flags").uint8("nav_flags").uint8("pset_flags").uint8("misc_flags"),c.prototype.fieldSpec=[],c.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),c.prototype.fieldSpec.push(["tot",a.prototype.fieldSpec]),c.prototype.fieldSpec.push(["P","writeUInt32LE",4]),c.prototype.fieldSpec.push(["P_std","writeUInt16LE",2]),c.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),c.prototype.fieldSpec.push(["cn0","writeUInt8",1]),c.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),c.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),c.prototype.fieldSpec.push(["doppler","writeInt32LE",4]),c.prototype.fieldSpec.push(["doppler_std","writeUInt16LE",2]),c.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),c.prototype.fieldSpec.push(["clock_offset","writeInt16LE",2]),c.prototype.fieldSpec.push(["clock_drift","writeInt16LE",2]),c.prototype.fieldSpec.push(["corr_spacing","writeUInt16LE",2]),c.prototype.fieldSpec.push(["acceleration","writeInt8",1]),c.prototype.fieldSpec.push(["sync_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["tow_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["track_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["nav_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["pset_flags","writeUInt8",1]),c.prototype.fieldSpec.push(["misc_flags","writeUInt8",1]);let u=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DETAILED_DEP",this.fields=t||this.parser.parse(e.payload),this};(u.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DETAILED_DEP",u.prototype.msg_type=17,u.prototype.constructor=u,u.prototype.parser=(new o).endianess("little").uint64("recv_time").nest("tot",{type:l.prototype.parser}).uint32("P").uint16("P_std").nest("L",{type:i.prototype.parser}).uint8("cn0").uint16("lock").nest("sid",{type:n.prototype.parser}).int32("doppler").uint16("doppler_std").uint32("uptime").int16("clock_offset").int16("clock_drift").uint16("corr_spacing").int8("acceleration").uint8("sync_flags").uint8("tow_flags").uint8("track_flags").uint8("nav_flags").uint8("pset_flags").uint8("misc_flags"),u.prototype.fieldSpec=[],u.prototype.fieldSpec.push(["recv_time","writeUInt64LE",8]),u.prototype.fieldSpec.push(["tot",l.prototype.fieldSpec]),u.prototype.fieldSpec.push(["P","writeUInt32LE",4]),u.prototype.fieldSpec.push(["P_std","writeUInt16LE",2]),u.prototype.fieldSpec.push(["L",i.prototype.fieldSpec]),u.prototype.fieldSpec.push(["cn0","writeUInt8",1]),u.prototype.fieldSpec.push(["lock","writeUInt16LE",2]),u.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),u.prototype.fieldSpec.push(["doppler","writeInt32LE",4]),u.prototype.fieldSpec.push(["doppler_std","writeUInt16LE",2]),u.prototype.fieldSpec.push(["uptime","writeUInt32LE",4]),u.prototype.fieldSpec.push(["clock_offset","writeInt16LE",2]),u.prototype.fieldSpec.push(["clock_drift","writeInt16LE",2]),u.prototype.fieldSpec.push(["corr_spacing","writeUInt16LE",2]),u.prototype.fieldSpec.push(["acceleration","writeInt8",1]),u.prototype.fieldSpec.push(["sync_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["tow_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["track_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["nav_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["pset_flags","writeUInt8",1]),u.prototype.fieldSpec.push(["misc_flags","writeUInt8",1]);let y=function(e,t){return r.call(this,e),this.messageType="TrackingChannelState",this.fields=t||this.parser.parse(e.payload),this};(y.prototype=Object.create(r.prototype)).messageType="TrackingChannelState",y.prototype.constructor=y,y.prototype.parser=(new o).endianess("little").nest("sid",{type:s.prototype.parser}).uint8("fcn").uint8("cn0"),y.prototype.fieldSpec=[],y.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),y.prototype.fieldSpec.push(["fcn","writeUInt8",1]),y.prototype.fieldSpec.push(["cn0","writeUInt8",1]);let f=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE",this.fields=t||this.parser.parse(e.payload),this};(f.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE",f.prototype.msg_type=65,f.prototype.constructor=f,f.prototype.parser=(new o).endianess("little").array("states",{type:y.prototype.parser,readUntil:"eof"}),f.prototype.fieldSpec=[],f.prototype.fieldSpec.push(["states","array",y.prototype.fieldSpec,function(){return this.fields.array.length},null]);let h=function(e,t){return r.call(this,e),this.messageType="MeasurementState",this.fields=t||this.parser.parse(e.payload),this};(h.prototype=Object.create(r.prototype)).messageType="MeasurementState",h.prototype.constructor=h,h.prototype.parser=(new o).endianess("little").nest("mesid",{type:s.prototype.parser}).uint8("cn0"),h.prototype.fieldSpec=[],h.prototype.fieldSpec.push(["mesid",s.prototype.fieldSpec]),h.prototype.fieldSpec.push(["cn0","writeUInt8",1]);let d=function(e,t){return r.call(this,e),this.messageType="MSG_MEASUREMENT_STATE",this.fields=t||this.parser.parse(e.payload),this};(d.prototype=Object.create(r.prototype)).messageType="MSG_MEASUREMENT_STATE",d.prototype.msg_type=97,d.prototype.constructor=d,d.prototype.parser=(new o).endianess("little").array("states",{type:h.prototype.parser,readUntil:"eof"}),d.prototype.fieldSpec=[],d.prototype.fieldSpec.push(["states","array",h.prototype.fieldSpec,function(){return this.fields.array.length},null]);let _=function(e,t){return r.call(this,e),this.messageType="TrackingChannelCorrelation",this.fields=t||this.parser.parse(e.payload),this};(_.prototype=Object.create(r.prototype)).messageType="TrackingChannelCorrelation",_.prototype.constructor=_,_.prototype.parser=(new o).endianess("little").int16("I").int16("Q"),_.prototype.fieldSpec=[],_.prototype.fieldSpec.push(["I","writeInt16LE",2]),_.prototype.fieldSpec.push(["Q","writeInt16LE",2]);let S=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ",this.fields=t||this.parser.parse(e.payload),this};(S.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ",S.prototype.msg_type=45,S.prototype.constructor=S,S.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:s.prototype.parser}).array("corrs",{length:3,type:_.prototype.parser}),S.prototype.fieldSpec=[],S.prototype.fieldSpec.push(["channel","writeUInt8",1]),S.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),S.prototype.fieldSpec.push(["corrs","array",_.prototype.fieldSpec,function(){return this.fields.array.length},3]);let g=function(e,t){return r.call(this,e),this.messageType="TrackingChannelCorrelationDep",this.fields=t||this.parser.parse(e.payload),this};(g.prototype=Object.create(r.prototype)).messageType="TrackingChannelCorrelationDep",g.prototype.constructor=g,g.prototype.parser=(new o).endianess("little").int32("I").int32("Q"),g.prototype.fieldSpec=[],g.prototype.fieldSpec.push(["I","writeInt32LE",4]),g.prototype.fieldSpec.push(["Q","writeInt32LE",4]);let w=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(w.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ_DEP_B",w.prototype.msg_type=44,w.prototype.constructor=w,w.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:s.prototype.parser}).array("corrs",{length:3,type:g.prototype.parser}),w.prototype.fieldSpec=[],w.prototype.fieldSpec.push(["channel","writeUInt8",1]),w.prototype.fieldSpec.push(["sid",s.prototype.fieldSpec]),w.prototype.fieldSpec.push(["corrs","array",g.prototype.fieldSpec,function(){return this.fields.array.length},3]);let E=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_IQ_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(E.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_IQ_DEP_A",E.prototype.msg_type=28,E.prototype.constructor=E,E.prototype.parser=(new o).endianess("little").uint8("channel").nest("sid",{type:n.prototype.parser}).array("corrs",{length:3,type:g.prototype.parser}),E.prototype.fieldSpec=[],E.prototype.fieldSpec.push(["channel","writeUInt8",1]),E.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),E.prototype.fieldSpec.push(["corrs","array",g.prototype.fieldSpec,function(){return this.fields.array.length},3]);let m=function(e,t){return r.call(this,e),this.messageType="TrackingChannelStateDepA",this.fields=t||this.parser.parse(e.payload),this};(m.prototype=Object.create(r.prototype)).messageType="TrackingChannelStateDepA",m.prototype.constructor=m,m.prototype.parser=(new o).endianess("little").uint8("state").uint8("prn").floatle("cn0"),m.prototype.fieldSpec=[],m.prototype.fieldSpec.push(["state","writeUInt8",1]),m.prototype.fieldSpec.push(["prn","writeUInt8",1]),m.prototype.fieldSpec.push(["cn0","writeFloatLE",4]);let b=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DEP_A",this.fields=t||this.parser.parse(e.payload),this};(b.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DEP_A",b.prototype.msg_type=22,b.prototype.constructor=b,b.prototype.parser=(new o).endianess("little").array("states",{type:m.prototype.parser,readUntil:"eof"}),b.prototype.fieldSpec=[],b.prototype.fieldSpec.push(["states","array",m.prototype.fieldSpec,function(){return this.fields.array.length},null]);let I=function(e,t){return r.call(this,e),this.messageType="TrackingChannelStateDepB",this.fields=t||this.parser.parse(e.payload),this};(I.prototype=Object.create(r.prototype)).messageType="TrackingChannelStateDepB",I.prototype.constructor=I,I.prototype.parser=(new o).endianess("little").uint8("state").nest("sid",{type:n.prototype.parser}).floatle("cn0"),I.prototype.fieldSpec=[],I.prototype.fieldSpec.push(["state","writeUInt8",1]),I.prototype.fieldSpec.push(["sid",n.prototype.fieldSpec]),I.prototype.fieldSpec.push(["cn0","writeFloatLE",4]);let L=function(e,t){return r.call(this,e),this.messageType="MSG_TRACKING_STATE_DEP_B",this.fields=t||this.parser.parse(e.payload),this};(L.prototype=Object.create(r.prototype)).messageType="MSG_TRACKING_STATE_DEP_B",L.prototype.msg_type=19,L.prototype.constructor=L,L.prototype.parser=(new o).endianess("little").array("states",{type:I.prototype.parser,readUntil:"eof"}),L.prototype.fieldSpec=[],L.prototype.fieldSpec.push(["states","array",I.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={33:c,MsgTrackingStateDetailedDepA:c,17:u,MsgTrackingStateDetailedDep:u,TrackingChannelState:y,65:f,MsgTrackingState:f,MeasurementState:h,97:d,MsgMeasurementState:d,TrackingChannelCorrelation:_,45:S,MsgTrackingIq:S,TrackingChannelCorrelationDep:g,44:w,MsgTrackingIqDepB:w,28:E,MsgTrackingIqDepA:E,TrackingChannelStateDepA:m,22:b,MsgTrackingStateDepA:b,TrackingChannelStateDepB:I,19:L,MsgTrackingStateDepB:L}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_USER_DATA",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_USER_DATA",i.prototype.msg_type=2048,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").array("contents",{type:"uint8",readUntil:"eof"}),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["contents","array","writeUInt8",function(){return 1},null]),e.exports={2048:i,MsgUserData:i}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,function(e,t){return r.call(this,e),this.messageType="MSG_ODOMETRY",this.fields=t||this.parser.parse(e.payload),this});(i.prototype=Object.create(r.prototype)).messageType="MSG_ODOMETRY",i.prototype.msg_type=2307,i.prototype.constructor=i,i.prototype.parser=(new o).endianess("little").uint32("tow").int32("velocity").uint8("flags"),i.prototype.fieldSpec=[],i.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),i.prototype.fieldSpec.push(["velocity","writeInt32LE",4]),i.prototype.fieldSpec.push(["flags","writeUInt8",1]);let s=function(e,t){return r.call(this,e),this.messageType="MSG_WHEELTICK",this.fields=t||this.parser.parse(e.payload),this};(s.prototype=Object.create(r.prototype)).messageType="MSG_WHEELTICK",s.prototype.msg_type=2308,s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint64("time").uint8("flags").uint8("source").int32("ticks"),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["time","writeUInt64LE",8]),s.prototype.fieldSpec.push(["flags","writeUInt8",1]),s.prototype.fieldSpec.push(["source","writeUInt8",1]),s.prototype.fieldSpec.push(["ticks","writeInt32LE",4]),e.exports={2307:i,MsgOdometry:i,2308:s,MsgWheeltick:s}},function(e,t,p){let r=p(2),o=p(4),i=(p(3),p(1).UINT64,p(0).CarrierPhase,p(0).GnssSignal),s=(p(0).GnssSignalDep,p(0).GPSTime,p(0).GPSTimeDep,p(0).GPSTimeSec,p(0).SvId,function(e,t){return r.call(this,e),this.messageType="TelemetrySV",this.fields=t||this.parser.parse(e.payload),this});(s.prototype=Object.create(r.prototype)).messageType="TelemetrySV",s.prototype.constructor=s,s.prototype.parser=(new o).endianess("little").uint8("az").int8("el").uint8("availability_flags").int16("pseudorange_residual").int16("phase_residual").uint8("outlier_flags").uint8("ephemeris_flags").uint8("correction_flags").nest("sid",{type:i.prototype.parser}),s.prototype.fieldSpec=[],s.prototype.fieldSpec.push(["az","writeUInt8",1]),s.prototype.fieldSpec.push(["el","writeInt8",1]),s.prototype.fieldSpec.push(["availability_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["pseudorange_residual","writeInt16LE",2]),s.prototype.fieldSpec.push(["phase_residual","writeInt16LE",2]),s.prototype.fieldSpec.push(["outlier_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["ephemeris_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["correction_flags","writeUInt8",1]),s.prototype.fieldSpec.push(["sid",i.prototype.fieldSpec]);let n=function(e,t){return r.call(this,e),this.messageType="MSG_TEL_SV",this.fields=t||this.parser.parse(e.payload),this};(n.prototype=Object.create(r.prototype)).messageType="MSG_TEL_SV",n.prototype.msg_type=288,n.prototype.constructor=n,n.prototype.parser=(new o).endianess("little").uint16("wn").uint32("tow").uint8("n_obs").uint8("origin_flags").array("sv_tel",{type:s.prototype.parser,readUntil:"eof"}),n.prototype.fieldSpec=[],n.prototype.fieldSpec.push(["wn","writeUInt16LE",2]),n.prototype.fieldSpec.push(["tow","writeUInt32LE",4]),n.prototype.fieldSpec.push(["n_obs","writeUInt8",1]),n.prototype.fieldSpec.push(["origin_flags","writeUInt8",1]),n.prototype.fieldSpec.push(["sv_tel","array",s.prototype.fieldSpec,function(){return this.fields.array.length},null]),e.exports={TelemetrySV:s,288:n,MsgTelSv:n}}]); \ No newline at end of file diff --git a/javascript/sbp/signing.js b/javascript/sbp/signing.js index 54aa1744f2..55977881b6 100644 --- a/javascript/sbp/signing.js +++ b/javascript/sbp/signing.js @@ -66,6 +66,36 @@ UtcTime.prototype.fieldSpec.push(['minutes', 'writeUInt8', 1]); UtcTime.prototype.fieldSpec.push(['seconds', 'writeUInt8', 1]); UtcTime.prototype.fieldSpec.push(['ns', 'writeUInt32LE', 4]); +/** + * SBP class for message fragment ECDSASignature + * + + * Fields in the SBP payload (`sbp.payload`): + * @field len number (unsigned 8-bit int, 1 byte) Number of bytes to use of the signature field. The DER encoded signature has a + * maximum size of 72 bytes but can vary between 70 and 72 bytes in length. + * @field data array DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. + * + * @param sbp An SBP object with a payload to be decoded. + */ +let ECDSASignature = function (sbp, fields) { + SBP.call(this, sbp); + this.messageType = "ECDSASignature"; + this.fields = (fields || this.parser.parse(sbp.payload)); + + return this; +}; +ECDSASignature.prototype = Object.create(SBP.prototype); +ECDSASignature.prototype.messageType = "ECDSASignature"; +ECDSASignature.prototype.constructor = ECDSASignature; +ECDSASignature.prototype.parser = new Parser() + .endianess('little') + .uint8('len') + .array('data', { length: 72, type: 'uint8' }); +ECDSASignature.prototype.fieldSpec = []; +ECDSASignature.prototype.fieldSpec.push(['len', 'writeUInt8', 1]); +ECDSASignature.prototype.fieldSpec.push(['data', 'array', 'writeUInt8', function () { return 1; }, 72]); + /** * SBP class for message MSG_ECDSA_CERTIFICATE (0x0C04). * @@ -105,7 +135,7 @@ MsgEcdsaCertificate.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]); MsgEcdsaCertificate.prototype.fieldSpec.push(['certificate_bytes', 'array', 'writeUInt8', function () { return 1; }, null]); /** - * SBP class for message MSG_CERTIFICATE_CHAIN (0x0C05). + * SBP class for message MSG_CERTIFICATE_CHAIN (0x0C09). * * Fields in the SBP payload (`sbp.payload`): @@ -114,8 +144,8 @@ MsgEcdsaCertificate.prototype.fieldSpec.push(['certificate_bytes', 'array', 'wri * @field corrections_certificate array SHA-1 fingerprint of the corrections certificate * @field expiration UtcTime The certificate chain comprised of three fingerprints: root certificate, * intermediate certificate and corrections certificate. - * @field signature array An ECDSA signature (created by the root certificate) over the concatenation of - * the SBP payload bytes preceding this field. That is, the concatenation of + * @field signature ECDSASignature Signature (created by the root certificate) over the concatenation of the SBP + * payload bytes preceding this field. That is, the concatenation of * `root_certificate`, `intermediate_certificate`, `corrections_certificate` and * `expiration`. This certificate chain (allow list) can also be validated by * fetching it from `http(s)://certs.swiftnav.com/chain`. @@ -131,7 +161,7 @@ let MsgCertificateChain = function (sbp, fields) { }; MsgCertificateChain.prototype = Object.create(SBP.prototype); MsgCertificateChain.prototype.messageType = "MSG_CERTIFICATE_CHAIN"; -MsgCertificateChain.prototype.msg_type = 0x0C05; +MsgCertificateChain.prototype.msg_type = 0x0C09; MsgCertificateChain.prototype.constructor = MsgCertificateChain; MsgCertificateChain.prototype.parser = new Parser() .endianess('little') @@ -139,16 +169,59 @@ MsgCertificateChain.prototype.parser = new Parser() .array('intermediate_certificate', { length: 20, type: 'uint8' }) .array('corrections_certificate', { length: 20, type: 'uint8' }) .nest('expiration', { type: UtcTime.prototype.parser }) - .array('signature', { length: 64, type: 'uint8' }); + .nest('signature', { type: ECDSASignature.prototype.parser }); MsgCertificateChain.prototype.fieldSpec = []; MsgCertificateChain.prototype.fieldSpec.push(['root_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); MsgCertificateChain.prototype.fieldSpec.push(['intermediate_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); MsgCertificateChain.prototype.fieldSpec.push(['corrections_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); MsgCertificateChain.prototype.fieldSpec.push(['expiration', UtcTime.prototype.fieldSpec]); -MsgCertificateChain.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 64]); +MsgCertificateChain.prototype.fieldSpec.push(['signature', ECDSASignature.prototype.fieldSpec]); + +/** + * SBP class for message MSG_CERTIFICATE_CHAIN_DEP (0x0C05). + * + + * Fields in the SBP payload (`sbp.payload`): + * @field root_certificate array SHA-1 fingerprint of the root certificate + * @field intermediate_certificate array SHA-1 fingerprint of the intermediate certificate + * @field corrections_certificate array SHA-1 fingerprint of the corrections certificate + * @field expiration UtcTime The certificate chain comprised of three fingerprints: root certificate, + * intermediate certificate and corrections certificate. + * @field signature array An ECDSA signature (created by the root certificate) over the concatenation of + * the SBP payload bytes preceding this field. That is, the concatenation of + * `root_certificate`, `intermediate_certificate`, `corrections_certificate` and + * `expiration`. This certificate chain (allow list) can also be validated by + * fetching it from `http(s)://certs.swiftnav.com/chain`. + * + * @param sbp An SBP object with a payload to be decoded. + */ +let MsgCertificateChainDep = function (sbp, fields) { + SBP.call(this, sbp); + this.messageType = "MSG_CERTIFICATE_CHAIN_DEP"; + this.fields = (fields || this.parser.parse(sbp.payload)); + + return this; +}; +MsgCertificateChainDep.prototype = Object.create(SBP.prototype); +MsgCertificateChainDep.prototype.messageType = "MSG_CERTIFICATE_CHAIN_DEP"; +MsgCertificateChainDep.prototype.msg_type = 0x0C05; +MsgCertificateChainDep.prototype.constructor = MsgCertificateChainDep; +MsgCertificateChainDep.prototype.parser = new Parser() + .endianess('little') + .array('root_certificate', { length: 20, type: 'uint8' }) + .array('intermediate_certificate', { length: 20, type: 'uint8' }) + .array('corrections_certificate', { length: 20, type: 'uint8' }) + .nest('expiration', { type: UtcTime.prototype.parser }) + .array('signature', { length: 64, type: 'uint8' }); +MsgCertificateChainDep.prototype.fieldSpec = []; +MsgCertificateChainDep.prototype.fieldSpec.push(['root_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); +MsgCertificateChainDep.prototype.fieldSpec.push(['intermediate_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); +MsgCertificateChainDep.prototype.fieldSpec.push(['corrections_certificate', 'array', 'writeUInt8', function () { return 1; }, 20]); +MsgCertificateChainDep.prototype.fieldSpec.push(['expiration', UtcTime.prototype.fieldSpec]); +MsgCertificateChainDep.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 64]); /** - * SBP class for message MSG_ECDSA_SIGNATURE (0x0C07). + * SBP class for message MSG_ECDSA_SIGNATURE (0x0C08). * * An ECDSA-256 signature using SHA-256 as the message digest algorithm. * @@ -163,10 +236,7 @@ MsgCertificateChain.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8' * after 256 messages. Upon connection, the value of the counter may not initially * be zero. * @field certificate_id array The last 4 bytes of the certificate's SHA-1 fingerprint - * @field n_signature_bytes number (unsigned 8-bit int, 1 byte) Number of bytes to use of the signature field. The DER encoded signature has a - * maximum size of 72 bytes but can vary between 70 and 72 bytes in length. - * @field signature array DER encoded ECDSA signature for the messages using SHA-256 as the digest - * algorithm. + * @field signature ECDSASignature Signature over the frames of this message group. * @field signed_messages array CRCs of the messages covered by this signature. For Skylark, which delivers SBP * messages wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs * from the RTCM message framing. For SBP only streams, this will be 16-bit CRCs @@ -184,7 +254,7 @@ let MsgEcdsaSignature = function (sbp, fields) { }; MsgEcdsaSignature.prototype = Object.create(SBP.prototype); MsgEcdsaSignature.prototype.messageType = "MSG_ECDSA_SIGNATURE"; -MsgEcdsaSignature.prototype.msg_type = 0x0C07; +MsgEcdsaSignature.prototype.msg_type = 0x0C08; MsgEcdsaSignature.prototype.constructor = MsgEcdsaSignature; MsgEcdsaSignature.prototype.parser = new Parser() .endianess('little') @@ -192,20 +262,75 @@ MsgEcdsaSignature.prototype.parser = new Parser() .uint8('stream_counter') .uint8('on_demand_counter') .array('certificate_id', { length: 4, type: 'uint8' }) - .uint8('n_signature_bytes') - .array('signature', { length: 72, type: 'uint8' }) + .nest('signature', { type: ECDSASignature.prototype.parser }) .array('signed_messages', { type: 'uint8', readUntil: 'eof' }); MsgEcdsaSignature.prototype.fieldSpec = []; MsgEcdsaSignature.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]); MsgEcdsaSignature.prototype.fieldSpec.push(['stream_counter', 'writeUInt8', 1]); MsgEcdsaSignature.prototype.fieldSpec.push(['on_demand_counter', 'writeUInt8', 1]); MsgEcdsaSignature.prototype.fieldSpec.push(['certificate_id', 'array', 'writeUInt8', function () { return 1; }, 4]); -MsgEcdsaSignature.prototype.fieldSpec.push(['n_signature_bytes', 'writeUInt8', 1]); -MsgEcdsaSignature.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 72]); +MsgEcdsaSignature.prototype.fieldSpec.push(['signature', ECDSASignature.prototype.fieldSpec]); MsgEcdsaSignature.prototype.fieldSpec.push(['signed_messages', 'array', 'writeUInt8', function () { return 1; }, null]); /** - * SBP class for message MSG_ECDSA_SIGNATURE_DEP (0x0C06). + * SBP class for message MSG_ECDSA_SIGNATURE_DEP_B (0x0C07). + * + * An ECDSA-256 signature using SHA-256 as the message digest algorithm. + * + * Fields in the SBP payload (`sbp.payload`): + * @field flags number (unsigned 8-bit int, 1 byte) Describes the format of the `signed\_messages` field below. + * @field stream_counter number (unsigned 8-bit int, 1 byte) Signature message counter. Zero indexed and incremented with each signature + * message. The counter will not increment if this message was in response to an + * on demand request. The counter will roll over after 256 messages. Upon + * connection, the value of the counter may not initially be zero. + * @field on_demand_counter number (unsigned 8-bit int, 1 byte) On demand message counter. Zero indexed and incremented with each signature + * message sent in response to an on demand message. The counter will roll over + * after 256 messages. Upon connection, the value of the counter may not initially + * be zero. + * @field certificate_id array The last 4 bytes of the certificate's SHA-1 fingerprint + * @field n_signature_bytes number (unsigned 8-bit int, 1 byte) Number of bytes to use of the signature field. The DER encoded signature has a + * maximum size of 72 bytes but can vary between 70 and 72 bytes in length. + * @field signature array DER encoded ECDSA signature for the messages using SHA-256 as the digest + * algorithm. + * @field signed_messages array CRCs of the messages covered by this signature. For Skylark, which delivers SBP + * messages wrapped in Swift's proprietary RTCM message, these are the 24-bit CRCs + * from the RTCM message framing. For SBP only streams, this will be 16-bit CRCs + * from the SBP framing. See the `flags` field to determine the type of CRCs + * covered. + * + * @param sbp An SBP object with a payload to be decoded. + */ +let MsgEcdsaSignatureDepB = function (sbp, fields) { + SBP.call(this, sbp); + this.messageType = "MSG_ECDSA_SIGNATURE_DEP_B"; + this.fields = (fields || this.parser.parse(sbp.payload)); + + return this; +}; +MsgEcdsaSignatureDepB.prototype = Object.create(SBP.prototype); +MsgEcdsaSignatureDepB.prototype.messageType = "MSG_ECDSA_SIGNATURE_DEP_B"; +MsgEcdsaSignatureDepB.prototype.msg_type = 0x0C07; +MsgEcdsaSignatureDepB.prototype.constructor = MsgEcdsaSignatureDepB; +MsgEcdsaSignatureDepB.prototype.parser = new Parser() + .endianess('little') + .uint8('flags') + .uint8('stream_counter') + .uint8('on_demand_counter') + .array('certificate_id', { length: 4, type: 'uint8' }) + .uint8('n_signature_bytes') + .array('signature', { length: 72, type: 'uint8' }) + .array('signed_messages', { type: 'uint8', readUntil: 'eof' }); +MsgEcdsaSignatureDepB.prototype.fieldSpec = []; +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['stream_counter', 'writeUInt8', 1]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['on_demand_counter', 'writeUInt8', 1]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['certificate_id', 'array', 'writeUInt8', function () { return 1; }, 4]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['n_signature_bytes', 'writeUInt8', 1]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 72]); +MsgEcdsaSignatureDepB.prototype.fieldSpec.push(['signed_messages', 'array', 'writeUInt8', function () { return 1; }, null]); + +/** + * SBP class for message MSG_ECDSA_SIGNATURE_DEP_A (0x0C06). * * An ECDSA-256 signature using SHA-256 as the message digest algorithm. * @@ -229,18 +354,18 @@ MsgEcdsaSignature.prototype.fieldSpec.push(['signed_messages', 'array', 'writeUI * * @param sbp An SBP object with a payload to be decoded. */ -let MsgEcdsaSignatureDep = function (sbp, fields) { +let MsgEcdsaSignatureDepA = function (sbp, fields) { SBP.call(this, sbp); - this.messageType = "MSG_ECDSA_SIGNATURE_DEP"; + this.messageType = "MSG_ECDSA_SIGNATURE_DEP_A"; this.fields = (fields || this.parser.parse(sbp.payload)); return this; }; -MsgEcdsaSignatureDep.prototype = Object.create(SBP.prototype); -MsgEcdsaSignatureDep.prototype.messageType = "MSG_ECDSA_SIGNATURE_DEP"; -MsgEcdsaSignatureDep.prototype.msg_type = 0x0C06; -MsgEcdsaSignatureDep.prototype.constructor = MsgEcdsaSignatureDep; -MsgEcdsaSignatureDep.prototype.parser = new Parser() +MsgEcdsaSignatureDepA.prototype = Object.create(SBP.prototype); +MsgEcdsaSignatureDepA.prototype.messageType = "MSG_ECDSA_SIGNATURE_DEP_A"; +MsgEcdsaSignatureDepA.prototype.msg_type = 0x0C06; +MsgEcdsaSignatureDepA.prototype.constructor = MsgEcdsaSignatureDepA; +MsgEcdsaSignatureDepA.prototype.parser = new Parser() .endianess('little') .uint8('flags') .uint8('stream_counter') @@ -248,13 +373,13 @@ MsgEcdsaSignatureDep.prototype.parser = new Parser() .array('certificate_id', { length: 4, type: 'uint8' }) .array('signature', { length: 64, type: 'uint8' }) .array('signed_messages', { type: 'uint8', readUntil: 'eof' }); -MsgEcdsaSignatureDep.prototype.fieldSpec = []; -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]); -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['stream_counter', 'writeUInt8', 1]); -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['on_demand_counter', 'writeUInt8', 1]); -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['certificate_id', 'array', 'writeUInt8', function () { return 1; }, 4]); -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 64]); -MsgEcdsaSignatureDep.prototype.fieldSpec.push(['signed_messages', 'array', 'writeUInt8', function () { return 1; }, null]); +MsgEcdsaSignatureDepA.prototype.fieldSpec = []; +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['flags', 'writeUInt8', 1]); +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['stream_counter', 'writeUInt8', 1]); +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['on_demand_counter', 'writeUInt8', 1]); +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['certificate_id', 'array', 'writeUInt8', function () { return 1; }, 4]); +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['signature', 'array', 'writeUInt8', function () { return 1; }, 64]); +MsgEcdsaSignatureDepA.prototype.fieldSpec.push(['signed_messages', 'array', 'writeUInt8', function () { return 1; }, null]); /** * SBP class for message MSG_ED25519_CERTIFICATE_DEP (0x0C02). @@ -367,14 +492,19 @@ MsgEd25519SignatureDepB.prototype.fieldSpec.push(['signed_messages', 'array', 'w module.exports = { UtcTime: UtcTime, + ECDSASignature: ECDSASignature, 0x0C04: MsgEcdsaCertificate, MsgEcdsaCertificate: MsgEcdsaCertificate, - 0x0C05: MsgCertificateChain, + 0x0C09: MsgCertificateChain, MsgCertificateChain: MsgCertificateChain, - 0x0C07: MsgEcdsaSignature, + 0x0C05: MsgCertificateChainDep, + MsgCertificateChainDep: MsgCertificateChainDep, + 0x0C08: MsgEcdsaSignature, MsgEcdsaSignature: MsgEcdsaSignature, - 0x0C06: MsgEcdsaSignatureDep, - MsgEcdsaSignatureDep: MsgEcdsaSignatureDep, + 0x0C07: MsgEcdsaSignatureDepB, + MsgEcdsaSignatureDepB: MsgEcdsaSignatureDepB, + 0x0C06: MsgEcdsaSignatureDepA, + MsgEcdsaSignatureDepA: MsgEcdsaSignatureDepA, 0x0C02: MsgEd25519CertificateDep, MsgEd25519CertificateDep: MsgEd25519CertificateDep, 0x0C01: MsgEd25519SignatureDepA, diff --git a/jsonschema/ECDSASignature.json b/jsonschema/ECDSASignature.json new file mode 100644 index 0000000000..62a8b71be8 --- /dev/null +++ b/jsonschema/ECDSASignature.json @@ -0,0 +1,26 @@ +{ + "copyright": [ + "Copyright (C) 2019-2021 Swift Navigation Inc.", + "Contact: https://support.swiftnav.com", + "", + "This source is subject to the license found in the file 'LICENSE' which must", + "be be distributed together with this source. All other rights reserved.", + "", + "THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,", + "EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED", + "WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE." + ], + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "#ECDSASignature", + "title":"ECDSASignature", + "description":"", + "type": "object", + "properties": { + "len": {"type": "integer"}, + "data": {"type": "array", "items": {"type": "integer"}} + }, + "required": [ + "len", + "data" + ] +} \ No newline at end of file diff --git a/jsonschema/MsgCertificateChain.json b/jsonschema/MsgCertificateChain.json index 2b9d9c525a..ed488ecbf5 100644 --- a/jsonschema/MsgCertificateChain.json +++ b/jsonschema/MsgCertificateChain.json @@ -20,7 +20,7 @@ "intermediate_certificate": {"type": "array", "items": {"type": "integer"}}, "corrections_certificate": {"type": "array", "items": {"type": "integer"}}, "expiration": {"$ref": "UtcTime.json"}, - "signature": {"type": "array", "items": {"type": "integer"}} + "signature": {"$ref": "ECDSASignature.json"} }, "required": [ "root_certificate", diff --git a/jsonschema/MsgEcdsaSignature.json b/jsonschema/MsgEcdsaSignature.json index 8bc1056a5d..268659e528 100644 --- a/jsonschema/MsgEcdsaSignature.json +++ b/jsonschema/MsgEcdsaSignature.json @@ -20,8 +20,7 @@ "stream_counter": {"type": "integer"}, "on_demand_counter": {"type": "integer"}, "certificate_id": {"type": "array", "items": {"type": "integer"}}, - "n_signature_bytes": {"type": "integer"}, - "signature": {"type": "array", "items": {"type": "integer"}}, + "signature": {"$ref": "ECDSASignature.json"}, "signed_messages": {"type": "array", "items": {"type": "integer"}} }, "required": [ @@ -29,7 +28,6 @@ "stream_counter", "on_demand_counter", "certificate_id", - "n_signature_bytes", "signature", "signed_messages" ] diff --git a/proto/signing.proto b/proto/signing.proto index a0299e4206..83a6921d0e 100644 --- a/proto/signing.proto +++ b/proto/signing.proto @@ -34,6 +34,15 @@ message UtcTime { uint32 ns = 7; } +/** ECDSA signature + * +None + */ +message ECDSASignature { + uint32 len = 1; + repeated uint32 data = 2; +} + /** An ECDSA certificate split over multiple messages * * A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1). @@ -54,7 +63,7 @@ message MsgCertificateChain { repeated uint32 intermediate_certificate = 2; repeated uint32 corrections_certificate = 3; UtcTime expiration = 4; - repeated uint32 signature = 5; + ECDSASignature signature = 5; } /** An ECDSA signature @@ -66,7 +75,6 @@ message MsgEcdsaSignature { uint32 stream_counter = 2; uint32 on_demand_counter = 3; repeated uint32 certificate_id = 4; - uint32 n_signature_bytes = 5; - repeated uint32 signature = 6; - repeated uint32 signed_messages = 7; + ECDSASignature signature = 5; + repeated uint32 signed_messages = 6; } \ No newline at end of file diff --git a/python/sbp/signing.py b/python/sbp/signing.py index e9b851463d..c0de084329 100644 --- a/python/sbp/signing.py +++ b/python/sbp/signing.py @@ -85,6 +85,44 @@ def from_binary(self, d): for n in self.__class__.__slots__: setattr(self, n, getattr(p, n)) +class ECDSASignature(object): + """ECDSASignature. + + + Parameters + ---------- + len : int + Number of bytes to use of the signature field. The DER encoded signature + has a maximum size of 72 bytes but can vary between 70 and 72 bytes in + length. + data : array + DER encoded ECDSA signature for the messages using SHA-256 as the digest + algorithm. + + """ + _parser = construct.Struct( + 'len' / construct.Int8ul, + 'data' / construct.Array(72, construct.Int8ul),) + __slots__ = [ + 'len', + 'data', + ] + + def __init__(self, payload=None, **kwargs): + if payload: + self.from_binary(payload) + else: + self.len = kwargs.pop('len') + self.data = kwargs.pop('data') + + def __repr__(self): + return fmt_repr(self) + + def from_binary(self, d): + p = ECDSASignature._parser.parse(d) + for n in self.__class__.__slots__: + setattr(self, n, getattr(p, n)) + SBP_MSG_ECDSA_CERTIFICATE = 0x0C04 class MsgEcdsaCertificate(SBP): """SBP class for message MSG_ECDSA_CERTIFICATE (0x0C04). @@ -196,9 +234,9 @@ def to_json_dict(self): d.update(j) return d -SBP_MSG_CERTIFICATE_CHAIN = 0x0C05 +SBP_MSG_CERTIFICATE_CHAIN = 0x0C09 class MsgCertificateChain(SBP): - """SBP class for message MSG_CERTIFICATE_CHAIN (0x0C05). + """SBP class for message MSG_CERTIFICATE_CHAIN (0x0C09). You can have MSG_CERTIFICATE_CHAIN inherit its fields directly from an inherited SBP object, or construct it inline using a dict @@ -219,13 +257,12 @@ class MsgCertificateChain(SBP): expiration : UtcTime The certificate chain comprised of three fingerprints: root certificate, intermediate certificate and corrections certificate. - signature : array - An ECDSA signature (created by the root certificate) over the - concatenation of the SBP payload bytes preceding this field. That is, the - concatenation of `root_certificate`, `intermediate_certificate`, - `corrections_certificate` and `expiration`. This certificate chain (allow - list) can also be validated by fetching it from - `http(s)://certs.swiftnav.com/chain`. + signature : ECDSASignature + Signature (created by the root certificate) over the concatenation of the + SBP payload bytes preceding this field. That is, the concatenation of + `root_certificate`, `intermediate_certificate`, `corrections_certificate` + and `expiration`. This certificate chain (allow list) can also be + validated by fetching it from `http(s)://certs.swiftnav.com/chain`. sender : int Optional sender ID, defaults to SENDER_ID (see sbp/msg.py). @@ -235,7 +272,7 @@ class MsgCertificateChain(SBP): 'intermediate_certificate' / construct.Array(20, construct.Int8ul), 'corrections_certificate' / construct.Array(20, construct.Int8ul), 'expiration' / UtcTime._parser, - 'signature' / construct.Array(64, construct.Int8ul),) + 'signature' / ECDSASignature._parser,) __slots__ = [ 'root_certificate', 'intermediate_certificate', @@ -316,15 +353,266 @@ def to_json_dict(self): d.update(j) return d -SBP_MSG_ECDSA_SIGNATURE = 0x0C07 +SBP_MSG_CERTIFICATE_CHAIN_DEP = 0x0C05 +class MsgCertificateChainDep(SBP): + """SBP class for message MSG_CERTIFICATE_CHAIN_DEP (0x0C05). + + You can have MSG_CERTIFICATE_CHAIN_DEP inherit its fields directly + from an inherited SBP object, or construct it inline using a dict + of its fields. + + + + Parameters + ---------- + sbp : SBP + SBP parent object to inherit from. + root_certificate : array + SHA-1 fingerprint of the root certificate + intermediate_certificate : array + SHA-1 fingerprint of the intermediate certificate + corrections_certificate : array + SHA-1 fingerprint of the corrections certificate + expiration : UtcTime + The certificate chain comprised of three fingerprints: root certificate, + intermediate certificate and corrections certificate. + signature : array + An ECDSA signature (created by the root certificate) over the + concatenation of the SBP payload bytes preceding this field. That is, the + concatenation of `root_certificate`, `intermediate_certificate`, + `corrections_certificate` and `expiration`. This certificate chain (allow + list) can also be validated by fetching it from + `http(s)://certs.swiftnav.com/chain`. + sender : int + Optional sender ID, defaults to SENDER_ID (see sbp/msg.py). + + """ + _parser = construct.Struct( + 'root_certificate' / construct.Array(20, construct.Int8ul), + 'intermediate_certificate' / construct.Array(20, construct.Int8ul), + 'corrections_certificate' / construct.Array(20, construct.Int8ul), + 'expiration' / UtcTime._parser, + 'signature' / construct.Array(64, construct.Int8ul),) + __slots__ = [ + 'root_certificate', + 'intermediate_certificate', + 'corrections_certificate', + 'expiration', + 'signature', + ] + + def __init__(self, sbp=None, **kwargs): + if sbp: + super( MsgCertificateChainDep, + self).__init__(sbp.msg_type, sbp.sender, sbp.length, + sbp.payload, sbp.crc) + self.from_binary(sbp.payload) + else: + super( MsgCertificateChainDep, self).__init__() + self.msg_type = SBP_MSG_CERTIFICATE_CHAIN_DEP + self.sender = kwargs.pop('sender', SENDER_ID) + self.root_certificate = kwargs.pop('root_certificate') + self.intermediate_certificate = kwargs.pop('intermediate_certificate') + self.corrections_certificate = kwargs.pop('corrections_certificate') + self.expiration = kwargs.pop('expiration') + self.signature = kwargs.pop('signature') + + def __repr__(self): + return fmt_repr(self) + + @staticmethod + def from_json(s): + """Given a JSON-encoded string s, build a message object. + + """ + d = json.loads(s) + return MsgCertificateChainDep.from_json_dict(d) + + @staticmethod + def from_json_dict(d): + sbp = SBP.from_json_dict(d) + return MsgCertificateChainDep(sbp, **d) + + + def from_binary(self, d): + """Given a binary payload d, update the appropriate payload fields of + the message. + + """ + p = MsgCertificateChainDep._parser.parse(d) + for n in self.__class__.__slots__: + setattr(self, n, getattr(p, n)) + + def to_binary(self): + """Produce a framed/packed SBP message. + + """ + c = containerize(exclude_fields(self)) + self.payload = MsgCertificateChainDep._parser.build(c) + return self.pack() + + def friendly_name(self): + """Produces friendly human-readable name for this message + + """ + return "CERTIFICATE CHAIN DEP" + + def into_buffer(self, buf, offset): + """Produce a framed/packed SBP message into the provided buffer and offset. + + """ + self.payload = containerize(exclude_fields(self)) + self.parser = MsgCertificateChainDep._parser + self.stream_payload.reset(buf, offset) + return self.pack_into(buf, offset, self._build_payload) + + def to_json_dict(self): + self.to_binary() + d = super( MsgCertificateChainDep, self).to_json_dict() + j = walk_json_dict(exclude_fields(self)) + d.update(j) + return d + +SBP_MSG_ECDSA_SIGNATURE = 0x0C08 class MsgEcdsaSignature(SBP): - """SBP class for message MSG_ECDSA_SIGNATURE (0x0C07). + """SBP class for message MSG_ECDSA_SIGNATURE (0x0C08). You can have MSG_ECDSA_SIGNATURE inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields. + An ECDSA-256 signature using SHA-256 as the message digest algorithm. + + Parameters + ---------- + sbp : SBP + SBP parent object to inherit from. + flags : int + Describes the format of the `signed\_messages` field below. + stream_counter : int + Signature message counter. Zero indexed and incremented with each + signature message. The counter will not increment if this message was in + response to an on demand request. The counter will roll over after 256 + messages. Upon connection, the value of the counter may not initially be + zero. + on_demand_counter : int + On demand message counter. Zero indexed and incremented with each + signature message sent in response to an on demand message. The counter + will roll over after 256 messages. Upon connection, the value of the + counter may not initially be zero. + certificate_id : array + The last 4 bytes of the certificate's SHA-1 fingerprint + signature : ECDSASignature + Signature over the frames of this message group. + signed_messages : array + CRCs of the messages covered by this signature. For Skylark, which + delivers SBP messages wrapped in Swift's proprietary RTCM message, these + are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + this will be 16-bit CRCs from the SBP framing. See the `flags` field to + determine the type of CRCs covered. + sender : int + Optional sender ID, defaults to SENDER_ID (see sbp/msg.py). + + """ + _parser = construct.Struct( + 'flags' / construct.Int8ul, + 'stream_counter' / construct.Int8ul, + 'on_demand_counter' / construct.Int8ul, + 'certificate_id' / construct.Array(4, construct.Int8ul), + 'signature' / ECDSASignature._parser, + 'signed_messages' / construct.GreedyRange(construct.Int8ul),) + __slots__ = [ + 'flags', + 'stream_counter', + 'on_demand_counter', + 'certificate_id', + 'signature', + 'signed_messages', + ] + + def __init__(self, sbp=None, **kwargs): + if sbp: + super( MsgEcdsaSignature, + self).__init__(sbp.msg_type, sbp.sender, sbp.length, + sbp.payload, sbp.crc) + self.from_binary(sbp.payload) + else: + super( MsgEcdsaSignature, self).__init__() + self.msg_type = SBP_MSG_ECDSA_SIGNATURE + self.sender = kwargs.pop('sender', SENDER_ID) + self.flags = kwargs.pop('flags') + self.stream_counter = kwargs.pop('stream_counter') + self.on_demand_counter = kwargs.pop('on_demand_counter') + self.certificate_id = kwargs.pop('certificate_id') + self.signature = kwargs.pop('signature') + self.signed_messages = kwargs.pop('signed_messages') + + def __repr__(self): + return fmt_repr(self) + + @staticmethod + def from_json(s): + """Given a JSON-encoded string s, build a message object. + + """ + d = json.loads(s) + return MsgEcdsaSignature.from_json_dict(d) + + @staticmethod + def from_json_dict(d): + sbp = SBP.from_json_dict(d) + return MsgEcdsaSignature(sbp, **d) + + + def from_binary(self, d): + """Given a binary payload d, update the appropriate payload fields of + the message. + + """ + p = MsgEcdsaSignature._parser.parse(d) + for n in self.__class__.__slots__: + setattr(self, n, getattr(p, n)) + + def to_binary(self): + """Produce a framed/packed SBP message. + + """ + c = containerize(exclude_fields(self)) + self.payload = MsgEcdsaSignature._parser.build(c) + return self.pack() + + def friendly_name(self): + """Produces friendly human-readable name for this message + + """ + return "ECDSA SIGNATURE" + + def into_buffer(self, buf, offset): + """Produce a framed/packed SBP message into the provided buffer and offset. + + """ + self.payload = containerize(exclude_fields(self)) + self.parser = MsgEcdsaSignature._parser + self.stream_payload.reset(buf, offset) + return self.pack_into(buf, offset, self._build_payload) + + def to_json_dict(self): + self.to_binary() + d = super( MsgEcdsaSignature, self).to_json_dict() + j = walk_json_dict(exclude_fields(self)) + d.update(j) + return d + +SBP_MSG_ECDSA_SIGNATURE_DEP_B = 0x0C07 +class MsgEcdsaSignatureDepB(SBP): + """SBP class for message MSG_ECDSA_SIGNATURE_DEP_B (0x0C07). + + You can have MSG_ECDSA_SIGNATURE_DEP_B inherit its fields directly + from an inherited SBP object, or construct it inline using a dict + of its fields. + + An ECDSA-256 signature using SHA-256 as the message digest algorithm. Parameters @@ -383,13 +671,13 @@ class MsgEcdsaSignature(SBP): def __init__(self, sbp=None, **kwargs): if sbp: - super( MsgEcdsaSignature, + super( MsgEcdsaSignatureDepB, self).__init__(sbp.msg_type, sbp.sender, sbp.length, sbp.payload, sbp.crc) self.from_binary(sbp.payload) else: - super( MsgEcdsaSignature, self).__init__() - self.msg_type = SBP_MSG_ECDSA_SIGNATURE + super( MsgEcdsaSignatureDepB, self).__init__() + self.msg_type = SBP_MSG_ECDSA_SIGNATURE_DEP_B self.sender = kwargs.pop('sender', SENDER_ID) self.flags = kwargs.pop('flags') self.stream_counter = kwargs.pop('stream_counter') @@ -408,12 +696,12 @@ def from_json(s): """ d = json.loads(s) - return MsgEcdsaSignature.from_json_dict(d) + return MsgEcdsaSignatureDepB.from_json_dict(d) @staticmethod def from_json_dict(d): sbp = SBP.from_json_dict(d) - return MsgEcdsaSignature(sbp, **d) + return MsgEcdsaSignatureDepB(sbp, **d) def from_binary(self, d): @@ -421,7 +709,7 @@ def from_binary(self, d): the message. """ - p = MsgEcdsaSignature._parser.parse(d) + p = MsgEcdsaSignatureDepB._parser.parse(d) for n in self.__class__.__slots__: setattr(self, n, getattr(p, n)) @@ -430,36 +718,36 @@ def to_binary(self): """ c = containerize(exclude_fields(self)) - self.payload = MsgEcdsaSignature._parser.build(c) + self.payload = MsgEcdsaSignatureDepB._parser.build(c) return self.pack() def friendly_name(self): """Produces friendly human-readable name for this message """ - return "ECDSA SIGNATURE" + return "ECDSA SIGNATURE DEP B" def into_buffer(self, buf, offset): """Produce a framed/packed SBP message into the provided buffer and offset. """ self.payload = containerize(exclude_fields(self)) - self.parser = MsgEcdsaSignature._parser + self.parser = MsgEcdsaSignatureDepB._parser self.stream_payload.reset(buf, offset) return self.pack_into(buf, offset, self._build_payload) def to_json_dict(self): self.to_binary() - d = super( MsgEcdsaSignature, self).to_json_dict() + d = super( MsgEcdsaSignatureDepB, self).to_json_dict() j = walk_json_dict(exclude_fields(self)) d.update(j) return d -SBP_MSG_ECDSA_SIGNATURE_DEP = 0x0C06 -class MsgEcdsaSignatureDep(SBP): - """SBP class for message MSG_ECDSA_SIGNATURE_DEP (0x0C06). +SBP_MSG_ECDSA_SIGNATURE_DEP_A = 0x0C06 +class MsgEcdsaSignatureDepA(SBP): + """SBP class for message MSG_ECDSA_SIGNATURE_DEP_A (0x0C06). - You can have MSG_ECDSA_SIGNATURE_DEP inherit its fields directly + You can have MSG_ECDSA_SIGNATURE_DEP_A inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields. @@ -515,13 +803,13 @@ class MsgEcdsaSignatureDep(SBP): def __init__(self, sbp=None, **kwargs): if sbp: - super( MsgEcdsaSignatureDep, + super( MsgEcdsaSignatureDepA, self).__init__(sbp.msg_type, sbp.sender, sbp.length, sbp.payload, sbp.crc) self.from_binary(sbp.payload) else: - super( MsgEcdsaSignatureDep, self).__init__() - self.msg_type = SBP_MSG_ECDSA_SIGNATURE_DEP + super( MsgEcdsaSignatureDepA, self).__init__() + self.msg_type = SBP_MSG_ECDSA_SIGNATURE_DEP_A self.sender = kwargs.pop('sender', SENDER_ID) self.flags = kwargs.pop('flags') self.stream_counter = kwargs.pop('stream_counter') @@ -539,12 +827,12 @@ def from_json(s): """ d = json.loads(s) - return MsgEcdsaSignatureDep.from_json_dict(d) + return MsgEcdsaSignatureDepA.from_json_dict(d) @staticmethod def from_json_dict(d): sbp = SBP.from_json_dict(d) - return MsgEcdsaSignatureDep(sbp, **d) + return MsgEcdsaSignatureDepA(sbp, **d) def from_binary(self, d): @@ -552,7 +840,7 @@ def from_binary(self, d): the message. """ - p = MsgEcdsaSignatureDep._parser.parse(d) + p = MsgEcdsaSignatureDepA._parser.parse(d) for n in self.__class__.__slots__: setattr(self, n, getattr(p, n)) @@ -561,27 +849,27 @@ def to_binary(self): """ c = containerize(exclude_fields(self)) - self.payload = MsgEcdsaSignatureDep._parser.build(c) + self.payload = MsgEcdsaSignatureDepA._parser.build(c) return self.pack() def friendly_name(self): """Produces friendly human-readable name for this message """ - return "ECDSA SIGNATURE DEP" + return "ECDSA SIGNATURE DEP A" def into_buffer(self, buf, offset): """Produce a framed/packed SBP message into the provided buffer and offset. """ self.payload = containerize(exclude_fields(self)) - self.parser = MsgEcdsaSignatureDep._parser + self.parser = MsgEcdsaSignatureDepA._parser self.stream_payload.reset(buf, offset) return self.pack_into(buf, offset, self._build_payload) def to_json_dict(self): self.to_binary() - d = super( MsgEcdsaSignatureDep, self).to_json_dict() + d = super( MsgEcdsaSignatureDepA, self).to_json_dict() j = walk_json_dict(exclude_fields(self)) d.update(j) return d @@ -920,9 +1208,11 @@ def to_json_dict(self): msg_classes = { 0x0C04: MsgEcdsaCertificate, - 0x0C05: MsgCertificateChain, - 0x0C07: MsgEcdsaSignature, - 0x0C06: MsgEcdsaSignatureDep, + 0x0C09: MsgCertificateChain, + 0x0C05: MsgCertificateChainDep, + 0x0C08: MsgEcdsaSignature, + 0x0C07: MsgEcdsaSignatureDepB, + 0x0C06: MsgEcdsaSignatureDepA, 0x0C02: MsgEd25519CertificateDep, 0x0C01: MsgEd25519SignatureDepA, 0x0C03: MsgEd25519SignatureDepB, diff --git a/python/tests/sbp/test_table.py b/python/tests/sbp/test_table.py index 85a69fefd6..9eecdd784f 100644 --- a/python/tests/sbp/test_table.py +++ b/python/tests/sbp/test_table.py @@ -43,7 +43,7 @@ def test_table_count(): Test number of available messages to deserialize. """ - number_of_messages = 231 + number_of_messages = 233 assert len(_SBP_TABLE) == number_of_messages def test_table_unqiue_count(): diff --git a/rust/sbp/src/messages/mod.rs b/rust/sbp/src/messages/mod.rs index 29c360d11f..1f53875f9f 100644 --- a/rust/sbp/src/messages/mod.rs +++ b/rust/sbp/src/messages/mod.rs @@ -212,9 +212,11 @@ use self::settings::msg_settings_save::MsgSettingsSave; use self::settings::msg_settings_write::MsgSettingsWrite; use self::settings::msg_settings_write_resp::MsgSettingsWriteResp; use self::signing::msg_certificate_chain::MsgCertificateChain; +use self::signing::msg_certificate_chain_dep::MsgCertificateChainDep; use self::signing::msg_ecdsa_certificate::MsgEcdsaCertificate; use self::signing::msg_ecdsa_signature::MsgEcdsaSignature; -use self::signing::msg_ecdsa_signature_dep::MsgEcdsaSignatureDep; +use self::signing::msg_ecdsa_signature_dep_a::MsgEcdsaSignatureDepA; +use self::signing::msg_ecdsa_signature_dep_b::MsgEcdsaSignatureDepB; use self::signing::msg_ed25519_certificate_dep::MsgEd25519CertificateDep; use self::signing::msg_ed25519_signature_dep_a::MsgEd25519SignatureDepA; use self::signing::msg_ed25519_signature_dep_b::MsgEd25519SignatureDepB; @@ -766,11 +768,15 @@ pub enum Sbp { /// An ECDSA certificate split over multiple messages MsgEcdsaCertificate(MsgEcdsaCertificate), /// The certificate chain - MsgCertificateChain(MsgCertificateChain), + MsgCertificateChainDep(MsgCertificateChainDep), + /// An ECDSA signature + MsgEcdsaSignatureDepA(MsgEcdsaSignatureDepA), /// An ECDSA signature - MsgEcdsaSignatureDep(MsgEcdsaSignatureDep), + MsgEcdsaSignatureDepB(MsgEcdsaSignatureDepB), /// An ECDSA signature MsgEcdsaSignature(MsgEcdsaSignature), + /// The certificate chain + MsgCertificateChain(MsgCertificateChain), /// Request advice on the optimal configuration for FileIO MsgFileioConfigReq(MsgFileioConfigReq), /// Response with advice on the optimal configuration for FileIO. @@ -1472,15 +1478,24 @@ impl<'de> serde::Deserialize<'de> for Sbp { Some(MsgEcdsaCertificate::MESSAGE_TYPE) => { serde_json::from_value::(value).map(Sbp::MsgEcdsaCertificate) } - Some(MsgCertificateChain::MESSAGE_TYPE) => { - serde_json::from_value::(value).map(Sbp::MsgCertificateChain) + Some(MsgCertificateChainDep::MESSAGE_TYPE) => { + serde_json::from_value::(value) + .map(Sbp::MsgCertificateChainDep) + } + Some(MsgEcdsaSignatureDepA::MESSAGE_TYPE) => { + serde_json::from_value::(value) + .map(Sbp::MsgEcdsaSignatureDepA) } - Some(MsgEcdsaSignatureDep::MESSAGE_TYPE) => { - serde_json::from_value::(value).map(Sbp::MsgEcdsaSignatureDep) + Some(MsgEcdsaSignatureDepB::MESSAGE_TYPE) => { + serde_json::from_value::(value) + .map(Sbp::MsgEcdsaSignatureDepB) } Some(MsgEcdsaSignature::MESSAGE_TYPE) => { serde_json::from_value::(value).map(Sbp::MsgEcdsaSignature) } + Some(MsgCertificateChain::MESSAGE_TYPE) => { + serde_json::from_value::(value).map(Sbp::MsgCertificateChain) + } Some(MsgFileioConfigReq::MESSAGE_TYPE) => { serde_json::from_value::(value).map(Sbp::MsgFileioConfigReq) } @@ -2604,21 +2619,31 @@ impl Sbp { msg.set_sender_id(sender_id); Ok(Sbp::MsgEcdsaCertificate(msg)) } - MsgCertificateChain::MESSAGE_TYPE => { - let mut msg = MsgCertificateChain::parse(&mut payload)?; + MsgCertificateChainDep::MESSAGE_TYPE => { + let mut msg = MsgCertificateChainDep::parse(&mut payload)?; msg.set_sender_id(sender_id); - Ok(Sbp::MsgCertificateChain(msg)) + Ok(Sbp::MsgCertificateChainDep(msg)) } - MsgEcdsaSignatureDep::MESSAGE_TYPE => { - let mut msg = MsgEcdsaSignatureDep::parse(&mut payload)?; + MsgEcdsaSignatureDepA::MESSAGE_TYPE => { + let mut msg = MsgEcdsaSignatureDepA::parse(&mut payload)?; msg.set_sender_id(sender_id); - Ok(Sbp::MsgEcdsaSignatureDep(msg)) + Ok(Sbp::MsgEcdsaSignatureDepA(msg)) + } + MsgEcdsaSignatureDepB::MESSAGE_TYPE => { + let mut msg = MsgEcdsaSignatureDepB::parse(&mut payload)?; + msg.set_sender_id(sender_id); + Ok(Sbp::MsgEcdsaSignatureDepB(msg)) } MsgEcdsaSignature::MESSAGE_TYPE => { let mut msg = MsgEcdsaSignature::parse(&mut payload)?; msg.set_sender_id(sender_id); Ok(Sbp::MsgEcdsaSignature(msg)) } + MsgCertificateChain::MESSAGE_TYPE => { + let mut msg = MsgCertificateChain::parse(&mut payload)?; + msg.set_sender_id(sender_id); + Ok(Sbp::MsgCertificateChain(msg)) + } MsgFileioConfigReq::MESSAGE_TYPE => { let mut msg = MsgFileioConfigReq::parse(&mut payload)?; msg.set_sender_id(sender_id); @@ -2975,9 +3000,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.message_name(), Sbp::MsgEd25519SignatureDepB(msg) => msg.message_name(), Sbp::MsgEcdsaCertificate(msg) => msg.message_name(), - Sbp::MsgCertificateChain(msg) => msg.message_name(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.message_name(), + Sbp::MsgCertificateChainDep(msg) => msg.message_name(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.message_name(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.message_name(), Sbp::MsgEcdsaSignature(msg) => msg.message_name(), + Sbp::MsgCertificateChain(msg) => msg.message_name(), Sbp::MsgFileioConfigReq(msg) => msg.message_name(), Sbp::MsgFileioConfigResp(msg) => msg.message_name(), Sbp::MsgSbasRaw(msg) => msg.message_name(), @@ -3212,9 +3239,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.message_type(), Sbp::MsgEd25519SignatureDepB(msg) => msg.message_type(), Sbp::MsgEcdsaCertificate(msg) => msg.message_type(), - Sbp::MsgCertificateChain(msg) => msg.message_type(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.message_type(), + Sbp::MsgCertificateChainDep(msg) => msg.message_type(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.message_type(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.message_type(), Sbp::MsgEcdsaSignature(msg) => msg.message_type(), + Sbp::MsgCertificateChain(msg) => msg.message_type(), Sbp::MsgFileioConfigReq(msg) => msg.message_type(), Sbp::MsgFileioConfigResp(msg) => msg.message_type(), Sbp::MsgSbasRaw(msg) => msg.message_type(), @@ -3449,9 +3478,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.sender_id(), Sbp::MsgEd25519SignatureDepB(msg) => msg.sender_id(), Sbp::MsgEcdsaCertificate(msg) => msg.sender_id(), - Sbp::MsgCertificateChain(msg) => msg.sender_id(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.sender_id(), + Sbp::MsgCertificateChainDep(msg) => msg.sender_id(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.sender_id(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.sender_id(), Sbp::MsgEcdsaSignature(msg) => msg.sender_id(), + Sbp::MsgCertificateChain(msg) => msg.sender_id(), Sbp::MsgFileioConfigReq(msg) => msg.sender_id(), Sbp::MsgFileioConfigResp(msg) => msg.sender_id(), Sbp::MsgSbasRaw(msg) => msg.sender_id(), @@ -3686,9 +3717,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.set_sender_id(new_id), Sbp::MsgEd25519SignatureDepB(msg) => msg.set_sender_id(new_id), Sbp::MsgEcdsaCertificate(msg) => msg.set_sender_id(new_id), - Sbp::MsgCertificateChain(msg) => msg.set_sender_id(new_id), - Sbp::MsgEcdsaSignatureDep(msg) => msg.set_sender_id(new_id), + Sbp::MsgCertificateChainDep(msg) => msg.set_sender_id(new_id), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.set_sender_id(new_id), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.set_sender_id(new_id), Sbp::MsgEcdsaSignature(msg) => msg.set_sender_id(new_id), + Sbp::MsgCertificateChain(msg) => msg.set_sender_id(new_id), Sbp::MsgFileioConfigReq(msg) => msg.set_sender_id(new_id), Sbp::MsgFileioConfigResp(msg) => msg.set_sender_id(new_id), Sbp::MsgSbasRaw(msg) => msg.set_sender_id(new_id), @@ -3923,9 +3956,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.encoded_len(), Sbp::MsgEd25519SignatureDepB(msg) => msg.encoded_len(), Sbp::MsgEcdsaCertificate(msg) => msg.encoded_len(), - Sbp::MsgCertificateChain(msg) => msg.encoded_len(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.encoded_len(), + Sbp::MsgCertificateChainDep(msg) => msg.encoded_len(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.encoded_len(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.encoded_len(), Sbp::MsgEcdsaSignature(msg) => msg.encoded_len(), + Sbp::MsgCertificateChain(msg) => msg.encoded_len(), Sbp::MsgFileioConfigReq(msg) => msg.encoded_len(), Sbp::MsgFileioConfigResp(msg) => msg.encoded_len(), Sbp::MsgSbasRaw(msg) => msg.encoded_len(), @@ -4163,9 +4198,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.gps_time(), Sbp::MsgEd25519SignatureDepB(msg) => msg.gps_time(), Sbp::MsgEcdsaCertificate(msg) => msg.gps_time(), - Sbp::MsgCertificateChain(msg) => msg.gps_time(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.gps_time(), + Sbp::MsgCertificateChainDep(msg) => msg.gps_time(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.gps_time(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.gps_time(), Sbp::MsgEcdsaSignature(msg) => msg.gps_time(), + Sbp::MsgCertificateChain(msg) => msg.gps_time(), Sbp::MsgFileioConfigReq(msg) => msg.gps_time(), Sbp::MsgFileioConfigResp(msg) => msg.gps_time(), Sbp::MsgSbasRaw(msg) => msg.gps_time(), @@ -4400,9 +4437,11 @@ impl SbpMessage for Sbp { Sbp::MsgEd25519CertificateDep(msg) => msg.friendly_name(), Sbp::MsgEd25519SignatureDepB(msg) => msg.friendly_name(), Sbp::MsgEcdsaCertificate(msg) => msg.friendly_name(), - Sbp::MsgCertificateChain(msg) => msg.friendly_name(), - Sbp::MsgEcdsaSignatureDep(msg) => msg.friendly_name(), + Sbp::MsgCertificateChainDep(msg) => msg.friendly_name(), + Sbp::MsgEcdsaSignatureDepA(msg) => msg.friendly_name(), + Sbp::MsgEcdsaSignatureDepB(msg) => msg.friendly_name(), Sbp::MsgEcdsaSignature(msg) => msg.friendly_name(), + Sbp::MsgCertificateChain(msg) => msg.friendly_name(), Sbp::MsgFileioConfigReq(msg) => msg.friendly_name(), Sbp::MsgFileioConfigResp(msg) => msg.friendly_name(), Sbp::MsgSbasRaw(msg) => msg.friendly_name(), @@ -4645,9 +4684,11 @@ impl WireFormat for Sbp { Sbp::MsgEd25519CertificateDep(msg) => WireFormat::write(msg, buf), Sbp::MsgEd25519SignatureDepB(msg) => WireFormat::write(msg, buf), Sbp::MsgEcdsaCertificate(msg) => WireFormat::write(msg, buf), - Sbp::MsgCertificateChain(msg) => WireFormat::write(msg, buf), - Sbp::MsgEcdsaSignatureDep(msg) => WireFormat::write(msg, buf), + Sbp::MsgCertificateChainDep(msg) => WireFormat::write(msg, buf), + Sbp::MsgEcdsaSignatureDepA(msg) => WireFormat::write(msg, buf), + Sbp::MsgEcdsaSignatureDepB(msg) => WireFormat::write(msg, buf), Sbp::MsgEcdsaSignature(msg) => WireFormat::write(msg, buf), + Sbp::MsgCertificateChain(msg) => WireFormat::write(msg, buf), Sbp::MsgFileioConfigReq(msg) => WireFormat::write(msg, buf), Sbp::MsgFileioConfigResp(msg) => WireFormat::write(msg, buf), Sbp::MsgSbasRaw(msg) => WireFormat::write(msg, buf), @@ -4882,9 +4923,11 @@ impl WireFormat for Sbp { Sbp::MsgEd25519CertificateDep(msg) => WireFormat::len(msg), Sbp::MsgEd25519SignatureDepB(msg) => WireFormat::len(msg), Sbp::MsgEcdsaCertificate(msg) => WireFormat::len(msg), - Sbp::MsgCertificateChain(msg) => WireFormat::len(msg), - Sbp::MsgEcdsaSignatureDep(msg) => WireFormat::len(msg), + Sbp::MsgCertificateChainDep(msg) => WireFormat::len(msg), + Sbp::MsgEcdsaSignatureDepA(msg) => WireFormat::len(msg), + Sbp::MsgEcdsaSignatureDepB(msg) => WireFormat::len(msg), Sbp::MsgEcdsaSignature(msg) => WireFormat::len(msg), + Sbp::MsgCertificateChain(msg) => WireFormat::len(msg), Sbp::MsgFileioConfigReq(msg) => WireFormat::len(msg), Sbp::MsgFileioConfigResp(msg) => WireFormat::len(msg), Sbp::MsgSbasRaw(msg) => WireFormat::len(msg), @@ -6113,15 +6156,21 @@ impl From for Sbp { } } -impl From for Sbp { - fn from(msg: MsgCertificateChain) -> Self { - Sbp::MsgCertificateChain(msg) +impl From for Sbp { + fn from(msg: MsgCertificateChainDep) -> Self { + Sbp::MsgCertificateChainDep(msg) + } +} + +impl From for Sbp { + fn from(msg: MsgEcdsaSignatureDepA) -> Self { + Sbp::MsgEcdsaSignatureDepA(msg) } } -impl From for Sbp { - fn from(msg: MsgEcdsaSignatureDep) -> Self { - Sbp::MsgEcdsaSignatureDep(msg) +impl From for Sbp { + fn from(msg: MsgEcdsaSignatureDepB) -> Self { + Sbp::MsgEcdsaSignatureDepB(msg) } } @@ -6131,6 +6180,12 @@ impl From for Sbp { } } +impl From for Sbp { + fn from(msg: MsgCertificateChain) -> Self { + Sbp::MsgCertificateChain(msg) + } +} + impl From for Sbp { fn from(msg: MsgFileioConfigReq) -> Self { Sbp::MsgFileioConfigReq(msg) diff --git a/rust/sbp/src/messages/signing.rs b/rust/sbp/src/messages/signing.rs index 201772d3b8..e8ba4d238e 100644 --- a/rust/sbp/src/messages/signing.rs +++ b/rust/sbp/src/messages/signing.rs @@ -13,15 +13,57 @@ // with generate.py. Please do not hand edit! //****************************************************************************/ //! Messages relating to signatures +pub use ecdsa_signature::ECDSASignature; pub use msg_certificate_chain::MsgCertificateChain; +pub use msg_certificate_chain_dep::MsgCertificateChainDep; pub use msg_ecdsa_certificate::MsgEcdsaCertificate; pub use msg_ecdsa_signature::MsgEcdsaSignature; -pub use msg_ecdsa_signature_dep::MsgEcdsaSignatureDep; +pub use msg_ecdsa_signature_dep_a::MsgEcdsaSignatureDepA; +pub use msg_ecdsa_signature_dep_b::MsgEcdsaSignatureDepB; pub use msg_ed25519_certificate_dep::MsgEd25519CertificateDep; pub use msg_ed25519_signature_dep_a::MsgEd25519SignatureDepA; pub use msg_ed25519_signature_dep_b::MsgEd25519SignatureDepB; pub use utc_time::UtcTime; +pub mod ecdsa_signature { + #![allow(unused_imports)] + + use super::*; + use crate::messages::lib::*; + /// ECDSA signature + #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Debug, PartialEq, Clone)] + pub struct ECDSASignature { + /// Number of bytes to use of the signature field. The DER encoded + /// signature has a maximum size of 72 bytes but can vary between 70 and 72 + /// bytes in length. + #[cfg_attr(feature = "serde", serde(rename = "len"))] + pub len: u8, + /// DER encoded ECDSA signature for the messages using SHA-256 as the digest + /// algorithm. + #[cfg_attr(feature = "serde", serde(with = "BigArray", rename = "data"))] + pub data: [u8; 72], + } + + impl WireFormat for ECDSASignature { + const MIN_LEN: usize = ::MIN_LEN + <[u8; 72] as WireFormat>::MIN_LEN; + fn len(&self) -> usize { + WireFormat::len(&self.len) + WireFormat::len(&self.data) + } + fn write(&self, buf: &mut B) { + WireFormat::write(&self.len, buf); + WireFormat::write(&self.data, buf); + } + fn parse_unchecked(buf: &mut B) -> Self { + ECDSASignature { + len: WireFormat::parse_unchecked(buf), + data: WireFormat::parse_unchecked(buf), + } + } + } +} + pub mod msg_certificate_chain { #![allow(unused_imports)] @@ -48,18 +90,18 @@ pub mod msg_certificate_chain { /// intermediate certificate and corrections certificate. #[cfg_attr(feature = "serde", serde(rename = "expiration"))] pub expiration: UtcTime, - /// An ECDSA signature (created by the root certificate) over the - /// concatenation of the SBP payload bytes preceding this field. That is, - /// the concatenation of `root_certificate`, `intermediate_certificate`, + /// Signature (created by the root certificate) over the concatenation of + /// the SBP payload bytes preceding this field. That is, the concatenation + /// of `root_certificate`, `intermediate_certificate`, /// `corrections_certificate` and `expiration`. This certificate chain /// (allow list) can also be validated by fetching it from /// `http(s)://certs.swiftnav.com/chain`. - #[cfg_attr(feature = "serde", serde(with = "BigArray", rename = "signature"))] - pub signature: [u8; 64], + #[cfg_attr(feature = "serde", serde(rename = "signature"))] + pub signature: ECDSASignature, } impl ConcreteMessage for MsgCertificateChain { - const MESSAGE_TYPE: u16 = 3077; + const MESSAGE_TYPE: u16 = 3081; const MESSAGE_NAME: &'static str = "MSG_CERTIFICATE_CHAIN"; } @@ -102,7 +144,7 @@ pub mod msg_certificate_chain { + <[u8; 20] as WireFormat>::MIN_LEN + <[u8; 20] as WireFormat>::MIN_LEN + ::MIN_LEN - + <[u8; 64] as WireFormat>::MIN_LEN; + + ::MIN_LEN; fn len(&self) -> usize { WireFormat::len(&self.root_certificate) + WireFormat::len(&self.intermediate_certificate) @@ -130,6 +172,114 @@ pub mod msg_certificate_chain { } } +pub mod msg_certificate_chain_dep { + #![allow(unused_imports)] + + use super::*; + use crate::messages::lib::*; + /// The certificate chain + #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Debug, PartialEq, Clone)] + pub struct MsgCertificateChainDep { + /// The message sender_id + #[cfg_attr(feature = "serde", serde(skip_serializing, alias = "sender"))] + pub sender_id: Option, + /// SHA-1 fingerprint of the root certificate + #[cfg_attr(feature = "serde", serde(rename = "root_certificate"))] + pub root_certificate: [u8; 20], + /// SHA-1 fingerprint of the intermediate certificate + #[cfg_attr(feature = "serde", serde(rename = "intermediate_certificate"))] + pub intermediate_certificate: [u8; 20], + /// SHA-1 fingerprint of the corrections certificate + #[cfg_attr(feature = "serde", serde(rename = "corrections_certificate"))] + pub corrections_certificate: [u8; 20], + /// The certificate chain comprised of three fingerprints: root certificate, + /// intermediate certificate and corrections certificate. + #[cfg_attr(feature = "serde", serde(rename = "expiration"))] + pub expiration: UtcTime, + /// An ECDSA signature (created by the root certificate) over the + /// concatenation of the SBP payload bytes preceding this field. That is, + /// the concatenation of `root_certificate`, `intermediate_certificate`, + /// `corrections_certificate` and `expiration`. This certificate chain + /// (allow list) can also be validated by fetching it from + /// `http(s)://certs.swiftnav.com/chain`. + #[cfg_attr(feature = "serde", serde(with = "BigArray", rename = "signature"))] + pub signature: [u8; 64], + } + + impl ConcreteMessage for MsgCertificateChainDep { + const MESSAGE_TYPE: u16 = 3077; + const MESSAGE_NAME: &'static str = "MSG_CERTIFICATE_CHAIN_DEP"; + } + + impl SbpMessage for MsgCertificateChainDep { + fn message_name(&self) -> &'static str { + ::MESSAGE_NAME + } + fn message_type(&self) -> u16 { + ::MESSAGE_TYPE + } + fn sender_id(&self) -> Option { + self.sender_id + } + fn set_sender_id(&mut self, new_id: u16) { + self.sender_id = Some(new_id); + } + fn encoded_len(&self) -> usize { + WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN + } + } + + impl FriendlyName for MsgCertificateChainDep { + fn friendly_name() -> &'static str { + "CERTIFICATE CHAIN DEP" + } + } + + impl TryFrom for MsgCertificateChainDep { + type Error = TryFromSbpError; + fn try_from(msg: Sbp) -> Result { + match msg { + Sbp::MsgCertificateChainDep(m) => Ok(m), + _ => Err(TryFromSbpError(msg)), + } + } + } + + impl WireFormat for MsgCertificateChainDep { + const MIN_LEN: usize = <[u8; 20] as WireFormat>::MIN_LEN + + <[u8; 20] as WireFormat>::MIN_LEN + + <[u8; 20] as WireFormat>::MIN_LEN + + ::MIN_LEN + + <[u8; 64] as WireFormat>::MIN_LEN; + fn len(&self) -> usize { + WireFormat::len(&self.root_certificate) + + WireFormat::len(&self.intermediate_certificate) + + WireFormat::len(&self.corrections_certificate) + + WireFormat::len(&self.expiration) + + WireFormat::len(&self.signature) + } + fn write(&self, buf: &mut B) { + WireFormat::write(&self.root_certificate, buf); + WireFormat::write(&self.intermediate_certificate, buf); + WireFormat::write(&self.corrections_certificate, buf); + WireFormat::write(&self.expiration, buf); + WireFormat::write(&self.signature, buf); + } + fn parse_unchecked(buf: &mut B) -> Self { + MsgCertificateChainDep { + sender_id: None, + root_certificate: WireFormat::parse_unchecked(buf), + intermediate_certificate: WireFormat::parse_unchecked(buf), + corrections_certificate: WireFormat::parse_unchecked(buf), + expiration: WireFormat::parse_unchecked(buf), + signature: WireFormat::parse_unchecked(buf), + } + } + } +} + pub mod msg_ecdsa_certificate { #![allow(unused_imports)] @@ -317,15 +467,9 @@ pub mod msg_ecdsa_signature { /// The last 4 bytes of the certificate's SHA-1 fingerprint #[cfg_attr(feature = "serde", serde(rename = "certificate_id"))] pub certificate_id: [u8; 4], - /// Number of bytes to use of the signature field. The DER encoded - /// signature has a maximum size of 72 bytes but can vary between 70 and 72 - /// bytes in length. - #[cfg_attr(feature = "serde", serde(rename = "n_signature_bytes"))] - pub n_signature_bytes: u8, - /// DER encoded ECDSA signature for the messages using SHA-256 as the digest - /// algorithm. - #[cfg_attr(feature = "serde", serde(with = "BigArray", rename = "signature"))] - pub signature: [u8; 72], + /// Signature over the frames of this message group. + #[cfg_attr(feature = "serde", serde(rename = "signature"))] + pub signature: ECDSASignature, /// CRCs of the messages covered by this signature. For Skylark, which /// delivers SBP messages wrapped in Swift's proprietary RTCM message, these /// are the 24-bit CRCs from the RTCM message framing. For SBP only streams, @@ -352,7 +496,7 @@ pub mod msg_ecdsa_signature { } impl ConcreteMessage for MsgEcdsaSignature { - const MESSAGE_TYPE: u16 = 3079; + const MESSAGE_TYPE: u16 = 3080; const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE"; } @@ -395,15 +539,13 @@ pub mod msg_ecdsa_signature { + ::MIN_LEN + ::MIN_LEN + <[u8; 4] as WireFormat>::MIN_LEN - + ::MIN_LEN - + <[u8; 72] as WireFormat>::MIN_LEN + + ::MIN_LEN + as WireFormat>::MIN_LEN; fn len(&self) -> usize { WireFormat::len(&self.flags) + WireFormat::len(&self.stream_counter) + WireFormat::len(&self.on_demand_counter) + WireFormat::len(&self.certificate_id) - + WireFormat::len(&self.n_signature_bytes) + WireFormat::len(&self.signature) + WireFormat::len(&self.signed_messages) } @@ -412,7 +554,6 @@ pub mod msg_ecdsa_signature { WireFormat::write(&self.stream_counter, buf); WireFormat::write(&self.on_demand_counter, buf); WireFormat::write(&self.certificate_id, buf); - WireFormat::write(&self.n_signature_bytes, buf); WireFormat::write(&self.signature, buf); WireFormat::write(&self.signed_messages, buf); } @@ -423,7 +564,6 @@ pub mod msg_ecdsa_signature { stream_counter: WireFormat::parse_unchecked(buf), on_demand_counter: WireFormat::parse_unchecked(buf), certificate_id: WireFormat::parse_unchecked(buf), - n_signature_bytes: WireFormat::parse_unchecked(buf), signature: WireFormat::parse_unchecked(buf), signed_messages: WireFormat::parse_unchecked(buf), } @@ -461,7 +601,7 @@ pub mod msg_ecdsa_signature { } } -pub mod msg_ecdsa_signature_dep { +pub mod msg_ecdsa_signature_dep_a { #![allow(unused_imports)] use super::*; @@ -474,7 +614,7 @@ pub mod msg_ecdsa_signature_dep { #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Clone)] - pub struct MsgEcdsaSignatureDep { + pub struct MsgEcdsaSignatureDepA { /// The message sender_id #[cfg_attr(feature = "serde", serde(skip_serializing, alias = "sender"))] pub sender_id: Option, @@ -509,7 +649,7 @@ pub mod msg_ecdsa_signature_dep { pub signed_messages: Vec, } - impl MsgEcdsaSignatureDep { + impl MsgEcdsaSignatureDepA { /// Gets the [CrcType][self::CrcType] stored in the `flags` bitfield. /// /// Returns `Ok` if the bitrange contains a known `CrcType` variant. @@ -525,12 +665,12 @@ pub mod msg_ecdsa_signature_dep { } } - impl ConcreteMessage for MsgEcdsaSignatureDep { + impl ConcreteMessage for MsgEcdsaSignatureDepA { const MESSAGE_TYPE: u16 = 3078; - const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE_DEP"; + const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE_DEP_A"; } - impl SbpMessage for MsgEcdsaSignatureDep { + impl SbpMessage for MsgEcdsaSignatureDepA { fn message_name(&self) -> &'static str { ::MESSAGE_NAME } @@ -548,23 +688,23 @@ pub mod msg_ecdsa_signature_dep { } } - impl FriendlyName for MsgEcdsaSignatureDep { + impl FriendlyName for MsgEcdsaSignatureDepA { fn friendly_name() -> &'static str { - "ECDSA SIGNATURE DEP" + "ECDSA SIGNATURE DEP A" } } - impl TryFrom for MsgEcdsaSignatureDep { + impl TryFrom for MsgEcdsaSignatureDepA { type Error = TryFromSbpError; fn try_from(msg: Sbp) -> Result { match msg { - Sbp::MsgEcdsaSignatureDep(m) => Ok(m), + Sbp::MsgEcdsaSignatureDepA(m) => Ok(m), _ => Err(TryFromSbpError(msg)), } } } - impl WireFormat for MsgEcdsaSignatureDep { + impl WireFormat for MsgEcdsaSignatureDepA { const MIN_LEN: usize = ::MIN_LEN + ::MIN_LEN + ::MIN_LEN @@ -588,7 +728,7 @@ pub mod msg_ecdsa_signature_dep { WireFormat::write(&self.signed_messages, buf); } fn parse_unchecked(buf: &mut B) -> Self { - MsgEcdsaSignatureDep { + MsgEcdsaSignatureDepA { sender_id: None, flags: WireFormat::parse_unchecked(buf), stream_counter: WireFormat::parse_unchecked(buf), @@ -631,6 +771,186 @@ pub mod msg_ecdsa_signature_dep { } } +pub mod msg_ecdsa_signature_dep_b { + #![allow(unused_imports)] + + use super::*; + use crate::messages::lib::*; + + /// An ECDSA signature + /// + /// An ECDSA-256 signature using SHA-256 as the message digest algorithm. + /// + #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Debug, PartialEq, Clone)] + pub struct MsgEcdsaSignatureDepB { + /// The message sender_id + #[cfg_attr(feature = "serde", serde(skip_serializing, alias = "sender"))] + pub sender_id: Option, + /// Describes the format of the `signed\_messages` field below. + #[cfg_attr(feature = "serde", serde(rename = "flags"))] + pub flags: u8, + /// Signature message counter. Zero indexed and incremented with each + /// signature message. The counter will not increment if this message was + /// in response to an on demand request. The counter will roll over after + /// 256 messages. Upon connection, the value of the counter may not + /// initially be zero. + #[cfg_attr(feature = "serde", serde(rename = "stream_counter"))] + pub stream_counter: u8, + /// On demand message counter. Zero indexed and incremented with each + /// signature message sent in response to an on demand message. The counter + /// will roll over after 256 messages. Upon connection, the value of the + /// counter may not initially be zero. + #[cfg_attr(feature = "serde", serde(rename = "on_demand_counter"))] + pub on_demand_counter: u8, + /// The last 4 bytes of the certificate's SHA-1 fingerprint + #[cfg_attr(feature = "serde", serde(rename = "certificate_id"))] + pub certificate_id: [u8; 4], + /// Number of bytes to use of the signature field. The DER encoded + /// signature has a maximum size of 72 bytes but can vary between 70 and 72 + /// bytes in length. + #[cfg_attr(feature = "serde", serde(rename = "n_signature_bytes"))] + pub n_signature_bytes: u8, + /// DER encoded ECDSA signature for the messages using SHA-256 as the digest + /// algorithm. + #[cfg_attr(feature = "serde", serde(with = "BigArray", rename = "signature"))] + pub signature: [u8; 72], + /// CRCs of the messages covered by this signature. For Skylark, which + /// delivers SBP messages wrapped in Swift's proprietary RTCM message, these + /// are the 24-bit CRCs from the RTCM message framing. For SBP only streams, + /// this will be 16-bit CRCs from the SBP framing. See the `flags` field to + /// determine the type of CRCs covered. + #[cfg_attr(feature = "serde", serde(rename = "signed_messages"))] + pub signed_messages: Vec, + } + + impl MsgEcdsaSignatureDepB { + /// Gets the [CrcType][self::CrcType] stored in the `flags` bitfield. + /// + /// Returns `Ok` if the bitrange contains a known `CrcType` variant. + /// Otherwise the value of the bitrange is returned as an `Err(u8)`. This may be because of a malformed message, + /// or because new variants of `CrcType` were added. + pub fn crc_type(&self) -> Result { + get_bit_range!(self.flags, u8, u8, 1, 0).try_into() + } + + /// Set the bitrange corresponding to the [CrcType][CrcType] of the `flags` bitfield. + pub fn set_crc_type(&mut self, crc_type: CrcType) { + set_bit_range!(&mut self.flags, crc_type, u8, u8, 1, 0); + } + } + + impl ConcreteMessage for MsgEcdsaSignatureDepB { + const MESSAGE_TYPE: u16 = 3079; + const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE_DEP_B"; + } + + impl SbpMessage for MsgEcdsaSignatureDepB { + fn message_name(&self) -> &'static str { + ::MESSAGE_NAME + } + fn message_type(&self) -> u16 { + ::MESSAGE_TYPE + } + fn sender_id(&self) -> Option { + self.sender_id + } + fn set_sender_id(&mut self, new_id: u16) { + self.sender_id = Some(new_id); + } + fn encoded_len(&self) -> usize { + WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN + } + } + + impl FriendlyName for MsgEcdsaSignatureDepB { + fn friendly_name() -> &'static str { + "ECDSA SIGNATURE DEP B" + } + } + + impl TryFrom for MsgEcdsaSignatureDepB { + type Error = TryFromSbpError; + fn try_from(msg: Sbp) -> Result { + match msg { + Sbp::MsgEcdsaSignatureDepB(m) => Ok(m), + _ => Err(TryFromSbpError(msg)), + } + } + } + + impl WireFormat for MsgEcdsaSignatureDepB { + const MIN_LEN: usize = ::MIN_LEN + + ::MIN_LEN + + ::MIN_LEN + + <[u8; 4] as WireFormat>::MIN_LEN + + ::MIN_LEN + + <[u8; 72] as WireFormat>::MIN_LEN + + as WireFormat>::MIN_LEN; + fn len(&self) -> usize { + WireFormat::len(&self.flags) + + WireFormat::len(&self.stream_counter) + + WireFormat::len(&self.on_demand_counter) + + WireFormat::len(&self.certificate_id) + + WireFormat::len(&self.n_signature_bytes) + + WireFormat::len(&self.signature) + + WireFormat::len(&self.signed_messages) + } + fn write(&self, buf: &mut B) { + WireFormat::write(&self.flags, buf); + WireFormat::write(&self.stream_counter, buf); + WireFormat::write(&self.on_demand_counter, buf); + WireFormat::write(&self.certificate_id, buf); + WireFormat::write(&self.n_signature_bytes, buf); + WireFormat::write(&self.signature, buf); + WireFormat::write(&self.signed_messages, buf); + } + fn parse_unchecked(buf: &mut B) -> Self { + MsgEcdsaSignatureDepB { + sender_id: None, + flags: WireFormat::parse_unchecked(buf), + stream_counter: WireFormat::parse_unchecked(buf), + on_demand_counter: WireFormat::parse_unchecked(buf), + certificate_id: WireFormat::parse_unchecked(buf), + n_signature_bytes: WireFormat::parse_unchecked(buf), + signature: WireFormat::parse_unchecked(buf), + signed_messages: WireFormat::parse_unchecked(buf), + } + } + } + + /// CRC type + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] + pub enum CrcType { + /// 24-bit CRCs from RTCM framing + _24BitCrcsFromRtcmFraming = 0, + + /// 16-bit CRCs from SBP framing + _16BitCrcsFromSbpFraming = 1, + } + + impl std::fmt::Display for CrcType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + CrcType::_24BitCrcsFromRtcmFraming => f.write_str("24-bit CRCs from RTCM framing"), + CrcType::_16BitCrcsFromSbpFraming => f.write_str("16-bit CRCs from SBP framing"), + } + } + } + + impl TryFrom for CrcType { + type Error = u8; + fn try_from(i: u8) -> Result { + match i { + 0 => Ok(CrcType::_24BitCrcsFromRtcmFraming), + 1 => Ok(CrcType::_16BitCrcsFromSbpFraming), + i => Err(i), + } + } + } +} + pub mod msg_ed25519_certificate_dep { #![allow(unused_imports)] diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain.rs index 98fbab638c..c1f2dedf45 100644 --- a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain.rs +++ b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain.rs @@ -22,12 +22,13 @@ use crate::*; fn test_auto_check_sbp_signing_msg_certificate_chain() { { let mut payload = Cursor::new(vec![ - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, 3, 30, - 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, - 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, - 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, ]); // Test the round trip payload parsing @@ -41,8 +42,8 @@ fn test_auto_check_sbp_signing_msg_certificate_chain() { sbp::messages::Sbp::MsgCertificateChain(msg) => { assert_eq!( msg.message_type(), - 0xC05, - "Incorrect message type, expected 0xC05, is {}", + 0xC09, + "Incorrect message type, expected 0xC09, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -386,324 +387,369 @@ fn test_auto_check_sbp_signing_msg_certificate_chain() { msg.root_certificate[19] ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] ); assert_eq!( - msg.signature[8], 0, - "incorrect value for signature[8], expected 0, is {}", - msg.signature[8] + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] ); assert_eq!( - msg.signature[9], 1, - "incorrect value for signature[9], expected 1, is {}", - msg.signature[9] + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[10], 2, - "incorrect value for signature[10], expected 2, is {}", - msg.signature[10] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[11], 3, - "incorrect value for signature[11], expected 3, is {}", - msg.signature[11] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[12], 4, - "incorrect value for signature[12], expected 4, is {}", - msg.signature[12] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[13], 5, - "incorrect value for signature[13], expected 5, is {}", - msg.signature[13] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[14], 6, - "incorrect value for signature[14], expected 6, is {}", - msg.signature[14] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[15], 7, - "incorrect value for signature[15], expected 7, is {}", - msg.signature[15] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[16], 0, - "incorrect value for signature[16], expected 0, is {}", - msg.signature[16] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[17], 1, - "incorrect value for signature[17], expected 1, is {}", - msg.signature[17] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[18], 2, - "incorrect value for signature[18], expected 2, is {}", - msg.signature[18] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[19], 3, - "incorrect value for signature[19], expected 3, is {}", - msg.signature[19] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[20], 4, - "incorrect value for signature[20], expected 4, is {}", - msg.signature[20] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[21], 5, - "incorrect value for signature[21], expected 5, is {}", - msg.signature[21] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[22], 6, - "incorrect value for signature[22], expected 6, is {}", - msg.signature[22] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[23], 7, - "incorrect value for signature[23], expected 7, is {}", - msg.signature[23] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[24], 0, - "incorrect value for signature[24], expected 0, is {}", - msg.signature[24] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[25], 1, - "incorrect value for signature[25], expected 1, is {}", - msg.signature[25] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[26], 2, - "incorrect value for signature[26], expected 2, is {}", - msg.signature[26] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[27], 3, - "incorrect value for signature[27], expected 3, is {}", - msg.signature[27] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[28], 4, - "incorrect value for signature[28], expected 4, is {}", - msg.signature[28] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[29], 5, - "incorrect value for signature[29], expected 5, is {}", - msg.signature[29] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[30], 6, - "incorrect value for signature[30], expected 6, is {}", - msg.signature[30] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[31], 7, - "incorrect value for signature[31], expected 7, is {}", - msg.signature[31] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[32], 0, - "incorrect value for signature[32], expected 0, is {}", - msg.signature[32] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[33], 1, - "incorrect value for signature[33], expected 1, is {}", - msg.signature[33] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[34], 2, - "incorrect value for signature[34], expected 2, is {}", - msg.signature[34] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[35], 3, - "incorrect value for signature[35], expected 3, is {}", - msg.signature[35] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[36], 4, - "incorrect value for signature[36], expected 4, is {}", - msg.signature[36] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[37], 5, - "incorrect value for signature[37], expected 5, is {}", - msg.signature[37] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[38], 6, - "incorrect value for signature[38], expected 6, is {}", - msg.signature[38] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[39], 7, - "incorrect value for signature[39], expected 7, is {}", - msg.signature[39] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[40], 0, - "incorrect value for signature[40], expected 0, is {}", - msg.signature[40] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[41], 1, - "incorrect value for signature[41], expected 1, is {}", - msg.signature[41] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[42], 2, - "incorrect value for signature[42], expected 2, is {}", - msg.signature[42] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[43], 3, - "incorrect value for signature[43], expected 3, is {}", - msg.signature[43] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[44], 4, - "incorrect value for signature[44], expected 4, is {}", - msg.signature[44] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[45], 5, - "incorrect value for signature[45], expected 5, is {}", - msg.signature[45] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[46], 6, - "incorrect value for signature[46], expected 6, is {}", - msg.signature[46] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[47], 7, - "incorrect value for signature[47], expected 7, is {}", - msg.signature[47] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[48], 0, - "incorrect value for signature[48], expected 0, is {}", - msg.signature[48] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[49], 1, - "incorrect value for signature[49], expected 1, is {}", - msg.signature[49] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[50], 2, - "incorrect value for signature[50], expected 2, is {}", - msg.signature[50] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[51], 3, - "incorrect value for signature[51], expected 3, is {}", - msg.signature[51] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[52], 4, - "incorrect value for signature[52], expected 4, is {}", - msg.signature[52] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[53], 5, - "incorrect value for signature[53], expected 5, is {}", - msg.signature[53] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[54], 6, - "incorrect value for signature[54], expected 6, is {}", - msg.signature[54] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[55], 7, - "incorrect value for signature[55], expected 7, is {}", - msg.signature[55] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[56], 0, - "incorrect value for signature[56], expected 0, is {}", - msg.signature[56] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[57], 1, - "incorrect value for signature[57], expected 1, is {}", - msg.signature[57] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[58], 2, - "incorrect value for signature[58], expected 2, is {}", - msg.signature[58] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[59], 3, - "incorrect value for signature[59], expected 3, is {}", - msg.signature[59] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[60], 4, - "incorrect value for signature[60], expected 4, is {}", - msg.signature[60] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[61], 5, - "incorrect value for signature[61], expected 5, is {}", - msg.signature[61] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[62], 6, - "incorrect value for signature[62], expected 6, is {}", - msg.signature[62] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[63], 7, - "incorrect value for signature[63], expected 7, is {}", - msg.signature[63] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] + ); + assert_eq!( + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] + ); + assert_eq!( + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] + ); + assert_eq!( + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] + ); + assert_eq!( + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] + ); + assert_eq!( + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] + ); + assert_eq!( + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] + ); + assert_eq!( + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] + ); + assert_eq!( + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] + ); + assert_eq!( + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); } _ => panic!("Invalid message type! Expected a MsgCertificateChain"), @@ -724,7 +770,7 @@ fn test_auto_check_sbp_signing_msg_certificate_chain() { #[cfg(feature = "json")] fn test_json2sbp_auto_check_sbp_signing_msg_certificate_chain() { { - let json_input = r#"{"preamble": 85, "msg_type": 3077, "sender": 66, "length": 135, "payload": "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH", "crc": 25712, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "intermediate_certificate": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "corrections_certificate": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "expiration": {"year": 2024, "month": 3, "day": 30, "hours": 12, "minutes": 34, "seconds": 59, "ns": 123456789}, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]}"#.as_bytes(); + let json_input = r#"{"preamble": 85, "msg_type": 3081, "sender": 66, "length": 144, "payload": "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwdIAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH", "crc": 57571, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "intermediate_certificate": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "corrections_certificate": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "expiration": {"year": 2024, "month": 3, "day": 30, "hours": 12, "minutes": 34, "seconds": 59, "ns": 123456789}, "signature": {"len": 72, "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]}}"#.as_bytes(); let sbp_msg = { // JSON to SBP message from payload @@ -748,8 +794,8 @@ fn test_json2sbp_auto_check_sbp_signing_msg_certificate_chain() { sbp::messages::Sbp::MsgCertificateChain(msg) => { assert_eq!( msg.message_type(), - 0xC05, - "Incorrect message type, expected 0xC05, is {}", + 0xC09, + "Incorrect message type, expected 0xC09, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -1093,324 +1139,369 @@ fn test_json2sbp_auto_check_sbp_signing_msg_certificate_chain() { msg.root_certificate[19] ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] + ); + assert_eq!( + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] + ); + assert_eq!( + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] + ); + assert_eq!( + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] + ); + assert_eq!( + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] + ); + assert_eq!( + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] + ); + assert_eq!( + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] + ); + assert_eq!( + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] + ); + assert_eq!( + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[8], 0, - "incorrect value for signature[8], expected 0, is {}", - msg.signature[8] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[9], 1, - "incorrect value for signature[9], expected 1, is {}", - msg.signature[9] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[10], 2, - "incorrect value for signature[10], expected 2, is {}", - msg.signature[10] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[11], 3, - "incorrect value for signature[11], expected 3, is {}", - msg.signature[11] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[12], 4, - "incorrect value for signature[12], expected 4, is {}", - msg.signature[12] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[13], 5, - "incorrect value for signature[13], expected 5, is {}", - msg.signature[13] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[14], 6, - "incorrect value for signature[14], expected 6, is {}", - msg.signature[14] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[15], 7, - "incorrect value for signature[15], expected 7, is {}", - msg.signature[15] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[16], 0, - "incorrect value for signature[16], expected 0, is {}", - msg.signature[16] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[17], 1, - "incorrect value for signature[17], expected 1, is {}", - msg.signature[17] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[18], 2, - "incorrect value for signature[18], expected 2, is {}", - msg.signature[18] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[19], 3, - "incorrect value for signature[19], expected 3, is {}", - msg.signature[19] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[20], 4, - "incorrect value for signature[20], expected 4, is {}", - msg.signature[20] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[21], 5, - "incorrect value for signature[21], expected 5, is {}", - msg.signature[21] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[22], 6, - "incorrect value for signature[22], expected 6, is {}", - msg.signature[22] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[23], 7, - "incorrect value for signature[23], expected 7, is {}", - msg.signature[23] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[24], 0, - "incorrect value for signature[24], expected 0, is {}", - msg.signature[24] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[25], 1, - "incorrect value for signature[25], expected 1, is {}", - msg.signature[25] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[26], 2, - "incorrect value for signature[26], expected 2, is {}", - msg.signature[26] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[27], 3, - "incorrect value for signature[27], expected 3, is {}", - msg.signature[27] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[28], 4, - "incorrect value for signature[28], expected 4, is {}", - msg.signature[28] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[29], 5, - "incorrect value for signature[29], expected 5, is {}", - msg.signature[29] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[30], 6, - "incorrect value for signature[30], expected 6, is {}", - msg.signature[30] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[31], 7, - "incorrect value for signature[31], expected 7, is {}", - msg.signature[31] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[32], 0, - "incorrect value for signature[32], expected 0, is {}", - msg.signature[32] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[33], 1, - "incorrect value for signature[33], expected 1, is {}", - msg.signature[33] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[34], 2, - "incorrect value for signature[34], expected 2, is {}", - msg.signature[34] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[35], 3, - "incorrect value for signature[35], expected 3, is {}", - msg.signature[35] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[36], 4, - "incorrect value for signature[36], expected 4, is {}", - msg.signature[36] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[37], 5, - "incorrect value for signature[37], expected 5, is {}", - msg.signature[37] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[38], 6, - "incorrect value for signature[38], expected 6, is {}", - msg.signature[38] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[39], 7, - "incorrect value for signature[39], expected 7, is {}", - msg.signature[39] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[40], 0, - "incorrect value for signature[40], expected 0, is {}", - msg.signature[40] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[41], 1, - "incorrect value for signature[41], expected 1, is {}", - msg.signature[41] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[42], 2, - "incorrect value for signature[42], expected 2, is {}", - msg.signature[42] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[43], 3, - "incorrect value for signature[43], expected 3, is {}", - msg.signature[43] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[44], 4, - "incorrect value for signature[44], expected 4, is {}", - msg.signature[44] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[45], 5, - "incorrect value for signature[45], expected 5, is {}", - msg.signature[45] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[46], 6, - "incorrect value for signature[46], expected 6, is {}", - msg.signature[46] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[47], 7, - "incorrect value for signature[47], expected 7, is {}", - msg.signature[47] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[48], 0, - "incorrect value for signature[48], expected 0, is {}", - msg.signature[48] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[49], 1, - "incorrect value for signature[49], expected 1, is {}", - msg.signature[49] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[50], 2, - "incorrect value for signature[50], expected 2, is {}", - msg.signature[50] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[51], 3, - "incorrect value for signature[51], expected 3, is {}", - msg.signature[51] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[52], 4, - "incorrect value for signature[52], expected 4, is {}", - msg.signature[52] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[53], 5, - "incorrect value for signature[53], expected 5, is {}", - msg.signature[53] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[54], 6, - "incorrect value for signature[54], expected 6, is {}", - msg.signature[54] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[55], 7, - "incorrect value for signature[55], expected 7, is {}", - msg.signature[55] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] ); assert_eq!( - msg.signature[56], 0, - "incorrect value for signature[56], expected 0, is {}", - msg.signature[56] + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] ); assert_eq!( - msg.signature[57], 1, - "incorrect value for signature[57], expected 1, is {}", - msg.signature[57] + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] ); assert_eq!( - msg.signature[58], 2, - "incorrect value for signature[58], expected 2, is {}", - msg.signature[58] + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] ); assert_eq!( - msg.signature[59], 3, - "incorrect value for signature[59], expected 3, is {}", - msg.signature[59] + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] ); assert_eq!( - msg.signature[60], 4, - "incorrect value for signature[60], expected 4, is {}", - msg.signature[60] + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] ); assert_eq!( - msg.signature[61], 5, - "incorrect value for signature[61], expected 5, is {}", - msg.signature[61] + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] ); assert_eq!( - msg.signature[62], 6, - "incorrect value for signature[62], expected 6, is {}", - msg.signature[62] + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] ); assert_eq!( - msg.signature[63], 7, - "incorrect value for signature[63], expected 7, is {}", - msg.signature[63] + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] + ); + assert_eq!( + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); } _ => panic!("Invalid message type! Expected a MsgCertificateChain"), @@ -1431,12 +1522,13 @@ fn test_json2sbp_auto_check_sbp_signing_msg_certificate_chain() { fn test_sbp2json_auto_check_sbp_signing_msg_certificate_chain() { { let mut payload = Cursor::new(vec![ - 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 85, 9, 12, 66, 0, 144, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, 3, 30, - 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, - 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, - 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + 12, 34, 59, 21, 205, 91, 7, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 227, 224, ]); // Construct sbp message @@ -1467,8 +1559,8 @@ fn test_sbp2json_auto_check_sbp_signing_msg_certificate_chain() { sbp::messages::Sbp::MsgCertificateChain(msg) => { assert_eq!( msg.message_type(), - 0xC05, - "Incorrect message type, expected 0xC05, is {}", + 0xC09, + "Incorrect message type, expected 0xC09, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -1812,324 +1904,369 @@ fn test_sbp2json_auto_check_sbp_signing_msg_certificate_chain() { msg.root_certificate[19] ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] + ); + assert_eq!( + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] + ); + assert_eq!( + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] + ); + assert_eq!( + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] + ); + assert_eq!( + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] + ); + assert_eq!( + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] + ); + assert_eq!( + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] + ); + assert_eq!( + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] + ); + assert_eq!( + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] + ); + assert_eq!( + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[8], 0, - "incorrect value for signature[8], expected 0, is {}", - msg.signature[8] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[9], 1, - "incorrect value for signature[9], expected 1, is {}", - msg.signature[9] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[10], 2, - "incorrect value for signature[10], expected 2, is {}", - msg.signature[10] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[11], 3, - "incorrect value for signature[11], expected 3, is {}", - msg.signature[11] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[12], 4, - "incorrect value for signature[12], expected 4, is {}", - msg.signature[12] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[13], 5, - "incorrect value for signature[13], expected 5, is {}", - msg.signature[13] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[14], 6, - "incorrect value for signature[14], expected 6, is {}", - msg.signature[14] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[15], 7, - "incorrect value for signature[15], expected 7, is {}", - msg.signature[15] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[16], 0, - "incorrect value for signature[16], expected 0, is {}", - msg.signature[16] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[17], 1, - "incorrect value for signature[17], expected 1, is {}", - msg.signature[17] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[18], 2, - "incorrect value for signature[18], expected 2, is {}", - msg.signature[18] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[19], 3, - "incorrect value for signature[19], expected 3, is {}", - msg.signature[19] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[20], 4, - "incorrect value for signature[20], expected 4, is {}", - msg.signature[20] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[21], 5, - "incorrect value for signature[21], expected 5, is {}", - msg.signature[21] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[22], 6, - "incorrect value for signature[22], expected 6, is {}", - msg.signature[22] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[23], 7, - "incorrect value for signature[23], expected 7, is {}", - msg.signature[23] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[24], 0, - "incorrect value for signature[24], expected 0, is {}", - msg.signature[24] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[25], 1, - "incorrect value for signature[25], expected 1, is {}", - msg.signature[25] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[26], 2, - "incorrect value for signature[26], expected 2, is {}", - msg.signature[26] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[27], 3, - "incorrect value for signature[27], expected 3, is {}", - msg.signature[27] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[28], 4, - "incorrect value for signature[28], expected 4, is {}", - msg.signature[28] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[29], 5, - "incorrect value for signature[29], expected 5, is {}", - msg.signature[29] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[30], 6, - "incorrect value for signature[30], expected 6, is {}", - msg.signature[30] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[31], 7, - "incorrect value for signature[31], expected 7, is {}", - msg.signature[31] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[32], 0, - "incorrect value for signature[32], expected 0, is {}", - msg.signature[32] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[33], 1, - "incorrect value for signature[33], expected 1, is {}", - msg.signature[33] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[34], 2, - "incorrect value for signature[34], expected 2, is {}", - msg.signature[34] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[35], 3, - "incorrect value for signature[35], expected 3, is {}", - msg.signature[35] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[36], 4, - "incorrect value for signature[36], expected 4, is {}", - msg.signature[36] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[37], 5, - "incorrect value for signature[37], expected 5, is {}", - msg.signature[37] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[38], 6, - "incorrect value for signature[38], expected 6, is {}", - msg.signature[38] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[39], 7, - "incorrect value for signature[39], expected 7, is {}", - msg.signature[39] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[40], 0, - "incorrect value for signature[40], expected 0, is {}", - msg.signature[40] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[41], 1, - "incorrect value for signature[41], expected 1, is {}", - msg.signature[41] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[42], 2, - "incorrect value for signature[42], expected 2, is {}", - msg.signature[42] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[43], 3, - "incorrect value for signature[43], expected 3, is {}", - msg.signature[43] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[44], 4, - "incorrect value for signature[44], expected 4, is {}", - msg.signature[44] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[45], 5, - "incorrect value for signature[45], expected 5, is {}", - msg.signature[45] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[46], 6, - "incorrect value for signature[46], expected 6, is {}", - msg.signature[46] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[47], 7, - "incorrect value for signature[47], expected 7, is {}", - msg.signature[47] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[48], 0, - "incorrect value for signature[48], expected 0, is {}", - msg.signature[48] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[49], 1, - "incorrect value for signature[49], expected 1, is {}", - msg.signature[49] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[50], 2, - "incorrect value for signature[50], expected 2, is {}", - msg.signature[50] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[51], 3, - "incorrect value for signature[51], expected 3, is {}", - msg.signature[51] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[52], 4, - "incorrect value for signature[52], expected 4, is {}", - msg.signature[52] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[53], 5, - "incorrect value for signature[53], expected 5, is {}", - msg.signature[53] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[54], 6, - "incorrect value for signature[54], expected 6, is {}", - msg.signature[54] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] ); assert_eq!( - msg.signature[55], 7, - "incorrect value for signature[55], expected 7, is {}", - msg.signature[55] + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] ); assert_eq!( - msg.signature[56], 0, - "incorrect value for signature[56], expected 0, is {}", - msg.signature[56] + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] ); assert_eq!( - msg.signature[57], 1, - "incorrect value for signature[57], expected 1, is {}", - msg.signature[57] + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] ); assert_eq!( - msg.signature[58], 2, - "incorrect value for signature[58], expected 2, is {}", - msg.signature[58] + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] ); assert_eq!( - msg.signature[59], 3, - "incorrect value for signature[59], expected 3, is {}", - msg.signature[59] + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] ); assert_eq!( - msg.signature[60], 4, - "incorrect value for signature[60], expected 4, is {}", - msg.signature[60] + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] ); assert_eq!( - msg.signature[61], 5, - "incorrect value for signature[61], expected 5, is {}", - msg.signature[61] + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] ); assert_eq!( - msg.signature[62], 6, - "incorrect value for signature[62], expected 6, is {}", - msg.signature[62] + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] ); assert_eq!( - msg.signature[63], 7, - "incorrect value for signature[63], expected 7, is {}", - msg.signature[63] + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); } _ => panic!("Invalid message type! Expected a MsgCertificateChain"), diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain_dep.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain_dep.rs new file mode 100644 index 0000000000..36e25d4324 --- /dev/null +++ b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_certificate_chain_dep.rs @@ -0,0 +1,2142 @@ +// +// Copyright (C) 2019-2021 Swift Navigation Inc. +// Contact: https://support.swiftnav.com +// +// This source is subject to the license found in the file 'LICENSE' which must +// be be distributed together with this source. All other rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + +// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml by generate.py. Do not modify by hand! + +use crate::*; + +/// Tests [`sbp::iter_messages`], from payload into SBP messages +/// +/// Asserts: +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +fn test_auto_check_sbp_signing_msg_certificate_chain_dep() { + { + let mut payload = Cursor::new(vec![ + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, 3, 30, + 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, + 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + ]); + + // Test the round trip payload parsing + let sbp_msg = { + let mut msgs = iter_messages(&mut payload); + msgs.next() + .expect("no message found") + .expect("failed to parse message") + }; + match &sbp_msg { + sbp::messages::Sbp::MsgCertificateChainDep(msg) => { + assert_eq!( + msg.message_type(), + 0xC05, + "Incorrect message type, expected 0xC05, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.corrections_certificate[0], 20, + "incorrect value for corrections_certificate[0], expected 20, is {}", + msg.corrections_certificate[0] + ); + assert_eq!( + msg.corrections_certificate[1], 21, + "incorrect value for corrections_certificate[1], expected 21, is {}", + msg.corrections_certificate[1] + ); + assert_eq!( + msg.corrections_certificate[2], 22, + "incorrect value for corrections_certificate[2], expected 22, is {}", + msg.corrections_certificate[2] + ); + assert_eq!( + msg.corrections_certificate[3], 23, + "incorrect value for corrections_certificate[3], expected 23, is {}", + msg.corrections_certificate[3] + ); + assert_eq!( + msg.corrections_certificate[4], 24, + "incorrect value for corrections_certificate[4], expected 24, is {}", + msg.corrections_certificate[4] + ); + assert_eq!( + msg.corrections_certificate[5], 25, + "incorrect value for corrections_certificate[5], expected 25, is {}", + msg.corrections_certificate[5] + ); + assert_eq!( + msg.corrections_certificate[6], 26, + "incorrect value for corrections_certificate[6], expected 26, is {}", + msg.corrections_certificate[6] + ); + assert_eq!( + msg.corrections_certificate[7], 27, + "incorrect value for corrections_certificate[7], expected 27, is {}", + msg.corrections_certificate[7] + ); + assert_eq!( + msg.corrections_certificate[8], 28, + "incorrect value for corrections_certificate[8], expected 28, is {}", + msg.corrections_certificate[8] + ); + assert_eq!( + msg.corrections_certificate[9], 29, + "incorrect value for corrections_certificate[9], expected 29, is {}", + msg.corrections_certificate[9] + ); + assert_eq!( + msg.corrections_certificate[10], 10, + "incorrect value for corrections_certificate[10], expected 10, is {}", + msg.corrections_certificate[10] + ); + assert_eq!( + msg.corrections_certificate[11], 11, + "incorrect value for corrections_certificate[11], expected 11, is {}", + msg.corrections_certificate[11] + ); + assert_eq!( + msg.corrections_certificate[12], 12, + "incorrect value for corrections_certificate[12], expected 12, is {}", + msg.corrections_certificate[12] + ); + assert_eq!( + msg.corrections_certificate[13], 13, + "incorrect value for corrections_certificate[13], expected 13, is {}", + msg.corrections_certificate[13] + ); + assert_eq!( + msg.corrections_certificate[14], 14, + "incorrect value for corrections_certificate[14], expected 14, is {}", + msg.corrections_certificate[14] + ); + assert_eq!( + msg.corrections_certificate[15], 15, + "incorrect value for corrections_certificate[15], expected 15, is {}", + msg.corrections_certificate[15] + ); + assert_eq!( + msg.corrections_certificate[16], 16, + "incorrect value for corrections_certificate[16], expected 16, is {}", + msg.corrections_certificate[16] + ); + assert_eq!( + msg.corrections_certificate[17], 17, + "incorrect value for corrections_certificate[17], expected 17, is {}", + msg.corrections_certificate[17] + ); + assert_eq!( + msg.corrections_certificate[18], 18, + "incorrect value for corrections_certificate[18], expected 18, is {}", + msg.corrections_certificate[18] + ); + assert_eq!( + msg.corrections_certificate[19], 19, + "incorrect value for corrections_certificate[19], expected 19, is {}", + msg.corrections_certificate[19] + ); + assert_eq!( + msg.expiration.day, 30, + "incorrect value for expiration.day, expected 30, is {}", + msg.expiration.day + ); + assert_eq!( + msg.expiration.hours, 12, + "incorrect value for expiration.hours, expected 12, is {}", + msg.expiration.hours + ); + assert_eq!( + msg.expiration.minutes, 34, + "incorrect value for expiration.minutes, expected 34, is {}", + msg.expiration.minutes + ); + assert_eq!( + msg.expiration.month, 3, + "incorrect value for expiration.month, expected 3, is {}", + msg.expiration.month + ); + assert_eq!( + msg.expiration.ns, 123456789, + "incorrect value for expiration.ns, expected 123456789, is {}", + msg.expiration.ns + ); + assert_eq!( + msg.expiration.seconds, 59, + "incorrect value for expiration.seconds, expected 59, is {}", + msg.expiration.seconds + ); + assert_eq!( + msg.expiration.year, 2024, + "incorrect value for expiration.year, expected 2024, is {}", + msg.expiration.year + ); + assert_eq!( + msg.intermediate_certificate[0], 10, + "incorrect value for intermediate_certificate[0], expected 10, is {}", + msg.intermediate_certificate[0] + ); + assert_eq!( + msg.intermediate_certificate[1], 11, + "incorrect value for intermediate_certificate[1], expected 11, is {}", + msg.intermediate_certificate[1] + ); + assert_eq!( + msg.intermediate_certificate[2], 12, + "incorrect value for intermediate_certificate[2], expected 12, is {}", + msg.intermediate_certificate[2] + ); + assert_eq!( + msg.intermediate_certificate[3], 13, + "incorrect value for intermediate_certificate[3], expected 13, is {}", + msg.intermediate_certificate[3] + ); + assert_eq!( + msg.intermediate_certificate[4], 14, + "incorrect value for intermediate_certificate[4], expected 14, is {}", + msg.intermediate_certificate[4] + ); + assert_eq!( + msg.intermediate_certificate[5], 15, + "incorrect value for intermediate_certificate[5], expected 15, is {}", + msg.intermediate_certificate[5] + ); + assert_eq!( + msg.intermediate_certificate[6], 16, + "incorrect value for intermediate_certificate[6], expected 16, is {}", + msg.intermediate_certificate[6] + ); + assert_eq!( + msg.intermediate_certificate[7], 17, + "incorrect value for intermediate_certificate[7], expected 17, is {}", + msg.intermediate_certificate[7] + ); + assert_eq!( + msg.intermediate_certificate[8], 18, + "incorrect value for intermediate_certificate[8], expected 18, is {}", + msg.intermediate_certificate[8] + ); + assert_eq!( + msg.intermediate_certificate[9], 19, + "incorrect value for intermediate_certificate[9], expected 19, is {}", + msg.intermediate_certificate[9] + ); + assert_eq!( + msg.intermediate_certificate[10], 0, + "incorrect value for intermediate_certificate[10], expected 0, is {}", + msg.intermediate_certificate[10] + ); + assert_eq!( + msg.intermediate_certificate[11], 1, + "incorrect value for intermediate_certificate[11], expected 1, is {}", + msg.intermediate_certificate[11] + ); + assert_eq!( + msg.intermediate_certificate[12], 2, + "incorrect value for intermediate_certificate[12], expected 2, is {}", + msg.intermediate_certificate[12] + ); + assert_eq!( + msg.intermediate_certificate[13], 3, + "incorrect value for intermediate_certificate[13], expected 3, is {}", + msg.intermediate_certificate[13] + ); + assert_eq!( + msg.intermediate_certificate[14], 4, + "incorrect value for intermediate_certificate[14], expected 4, is {}", + msg.intermediate_certificate[14] + ); + assert_eq!( + msg.intermediate_certificate[15], 5, + "incorrect value for intermediate_certificate[15], expected 5, is {}", + msg.intermediate_certificate[15] + ); + assert_eq!( + msg.intermediate_certificate[16], 6, + "incorrect value for intermediate_certificate[16], expected 6, is {}", + msg.intermediate_certificate[16] + ); + assert_eq!( + msg.intermediate_certificate[17], 7, + "incorrect value for intermediate_certificate[17], expected 7, is {}", + msg.intermediate_certificate[17] + ); + assert_eq!( + msg.intermediate_certificate[18], 8, + "incorrect value for intermediate_certificate[18], expected 8, is {}", + msg.intermediate_certificate[18] + ); + assert_eq!( + msg.intermediate_certificate[19], 9, + "incorrect value for intermediate_certificate[19], expected 9, is {}", + msg.intermediate_certificate[19] + ); + assert_eq!( + msg.root_certificate[0], 0, + "incorrect value for root_certificate[0], expected 0, is {}", + msg.root_certificate[0] + ); + assert_eq!( + msg.root_certificate[1], 1, + "incorrect value for root_certificate[1], expected 1, is {}", + msg.root_certificate[1] + ); + assert_eq!( + msg.root_certificate[2], 2, + "incorrect value for root_certificate[2], expected 2, is {}", + msg.root_certificate[2] + ); + assert_eq!( + msg.root_certificate[3], 3, + "incorrect value for root_certificate[3], expected 3, is {}", + msg.root_certificate[3] + ); + assert_eq!( + msg.root_certificate[4], 4, + "incorrect value for root_certificate[4], expected 4, is {}", + msg.root_certificate[4] + ); + assert_eq!( + msg.root_certificate[5], 5, + "incorrect value for root_certificate[5], expected 5, is {}", + msg.root_certificate[5] + ); + assert_eq!( + msg.root_certificate[6], 6, + "incorrect value for root_certificate[6], expected 6, is {}", + msg.root_certificate[6] + ); + assert_eq!( + msg.root_certificate[7], 7, + "incorrect value for root_certificate[7], expected 7, is {}", + msg.root_certificate[7] + ); + assert_eq!( + msg.root_certificate[8], 8, + "incorrect value for root_certificate[8], expected 8, is {}", + msg.root_certificate[8] + ); + assert_eq!( + msg.root_certificate[9], 9, + "incorrect value for root_certificate[9], expected 9, is {}", + msg.root_certificate[9] + ); + assert_eq!( + msg.root_certificate[10], 10, + "incorrect value for root_certificate[10], expected 10, is {}", + msg.root_certificate[10] + ); + assert_eq!( + msg.root_certificate[11], 11, + "incorrect value for root_certificate[11], expected 11, is {}", + msg.root_certificate[11] + ); + assert_eq!( + msg.root_certificate[12], 12, + "incorrect value for root_certificate[12], expected 12, is {}", + msg.root_certificate[12] + ); + assert_eq!( + msg.root_certificate[13], 13, + "incorrect value for root_certificate[13], expected 13, is {}", + msg.root_certificate[13] + ); + assert_eq!( + msg.root_certificate[14], 14, + "incorrect value for root_certificate[14], expected 14, is {}", + msg.root_certificate[14] + ); + assert_eq!( + msg.root_certificate[15], 15, + "incorrect value for root_certificate[15], expected 15, is {}", + msg.root_certificate[15] + ); + assert_eq!( + msg.root_certificate[16], 16, + "incorrect value for root_certificate[16], expected 16, is {}", + msg.root_certificate[16] + ); + assert_eq!( + msg.root_certificate[17], 17, + "incorrect value for root_certificate[17], expected 17, is {}", + msg.root_certificate[17] + ); + assert_eq!( + msg.root_certificate[18], 18, + "incorrect value for root_certificate[18], expected 18, is {}", + msg.root_certificate[18] + ); + assert_eq!( + msg.root_certificate[19], 19, + "incorrect value for root_certificate[19], expected 19, is {}", + msg.root_certificate[19] + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 0, + "incorrect value for signature[8], expected 0, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 1, + "incorrect value for signature[9], expected 1, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 2, + "incorrect value for signature[10], expected 2, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 3, + "incorrect value for signature[11], expected 3, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 4, + "incorrect value for signature[12], expected 4, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 5, + "incorrect value for signature[13], expected 5, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 6, + "incorrect value for signature[14], expected 6, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 7, + "incorrect value for signature[15], expected 7, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 0, + "incorrect value for signature[16], expected 0, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 1, + "incorrect value for signature[17], expected 1, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 2, + "incorrect value for signature[18], expected 2, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 3, + "incorrect value for signature[19], expected 3, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 4, + "incorrect value for signature[20], expected 4, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 5, + "incorrect value for signature[21], expected 5, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 6, + "incorrect value for signature[22], expected 6, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 7, + "incorrect value for signature[23], expected 7, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 0, + "incorrect value for signature[24], expected 0, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 1, + "incorrect value for signature[25], expected 1, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 2, + "incorrect value for signature[26], expected 2, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 3, + "incorrect value for signature[27], expected 3, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 4, + "incorrect value for signature[28], expected 4, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 5, + "incorrect value for signature[29], expected 5, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 6, + "incorrect value for signature[30], expected 6, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 7, + "incorrect value for signature[31], expected 7, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 0, + "incorrect value for signature[32], expected 0, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 1, + "incorrect value for signature[33], expected 1, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 2, + "incorrect value for signature[34], expected 2, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 3, + "incorrect value for signature[35], expected 3, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 4, + "incorrect value for signature[36], expected 4, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 5, + "incorrect value for signature[37], expected 5, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 6, + "incorrect value for signature[38], expected 6, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 7, + "incorrect value for signature[39], expected 7, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 0, + "incorrect value for signature[40], expected 0, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 1, + "incorrect value for signature[41], expected 1, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 2, + "incorrect value for signature[42], expected 2, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 3, + "incorrect value for signature[43], expected 3, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 4, + "incorrect value for signature[44], expected 4, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 5, + "incorrect value for signature[45], expected 5, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 6, + "incorrect value for signature[46], expected 6, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 7, + "incorrect value for signature[47], expected 7, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 0, + "incorrect value for signature[48], expected 0, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 1, + "incorrect value for signature[49], expected 1, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 2, + "incorrect value for signature[50], expected 2, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 3, + "incorrect value for signature[51], expected 3, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 4, + "incorrect value for signature[52], expected 4, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 5, + "incorrect value for signature[53], expected 5, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 6, + "incorrect value for signature[54], expected 6, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 7, + "incorrect value for signature[55], expected 7, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 0, + "incorrect value for signature[56], expected 0, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 1, + "incorrect value for signature[57], expected 1, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 2, + "incorrect value for signature[58], expected 2, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 3, + "incorrect value for signature[59], expected 3, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 4, + "incorrect value for signature[60], expected 4, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 5, + "incorrect value for signature[61], expected 5, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 6, + "incorrect value for signature[62], expected 6, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 7, + "incorrect value for signature[63], expected 7, is {}", + msg.signature[63] + ); + } + _ => panic!("Invalid message type! Expected a MsgCertificateChainDep"), + }; + let frame = sbp::to_vec(&sbp_msg).unwrap(); + assert_eq!(frame, payload.into_inner()); + } +} + +/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message +/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. +/// +/// Asserts: +/// - SBP message constructed via payload is identical to from fields +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +#[cfg(feature = "json")] +fn test_json2sbp_auto_check_sbp_signing_msg_certificate_chain_dep() { + { + let json_input = r#"{"preamble": 85, "msg_type": 3077, "sender": 66, "length": 135, "payload": "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH", "crc": 25712, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "intermediate_certificate": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "corrections_certificate": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "expiration": {"year": 2024, "month": 3, "day": 30, "hours": 12, "minutes": 34, "seconds": 59, "ns": 123456789}, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]}"#.as_bytes(); + + let sbp_msg = { + // JSON to SBP message from payload + let mut iter = json2sbp_iter_msg(json_input); + let from_payload = iter + .next() + .expect("no message found") + .expect("failed to parse message"); + + // JSON to SBP message from fields + let mut iter = iter_messages_from_fields(json_input); + let from_fields = iter + .next() + .expect("no message found") + .expect("failed to parse message"); + + assert_eq!(from_fields, from_payload); + from_fields + }; + match &sbp_msg { + sbp::messages::Sbp::MsgCertificateChainDep(msg) => { + assert_eq!( + msg.message_type(), + 0xC05, + "Incorrect message type, expected 0xC05, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.corrections_certificate[0], 20, + "incorrect value for corrections_certificate[0], expected 20, is {}", + msg.corrections_certificate[0] + ); + assert_eq!( + msg.corrections_certificate[1], 21, + "incorrect value for corrections_certificate[1], expected 21, is {}", + msg.corrections_certificate[1] + ); + assert_eq!( + msg.corrections_certificate[2], 22, + "incorrect value for corrections_certificate[2], expected 22, is {}", + msg.corrections_certificate[2] + ); + assert_eq!( + msg.corrections_certificate[3], 23, + "incorrect value for corrections_certificate[3], expected 23, is {}", + msg.corrections_certificate[3] + ); + assert_eq!( + msg.corrections_certificate[4], 24, + "incorrect value for corrections_certificate[4], expected 24, is {}", + msg.corrections_certificate[4] + ); + assert_eq!( + msg.corrections_certificate[5], 25, + "incorrect value for corrections_certificate[5], expected 25, is {}", + msg.corrections_certificate[5] + ); + assert_eq!( + msg.corrections_certificate[6], 26, + "incorrect value for corrections_certificate[6], expected 26, is {}", + msg.corrections_certificate[6] + ); + assert_eq!( + msg.corrections_certificate[7], 27, + "incorrect value for corrections_certificate[7], expected 27, is {}", + msg.corrections_certificate[7] + ); + assert_eq!( + msg.corrections_certificate[8], 28, + "incorrect value for corrections_certificate[8], expected 28, is {}", + msg.corrections_certificate[8] + ); + assert_eq!( + msg.corrections_certificate[9], 29, + "incorrect value for corrections_certificate[9], expected 29, is {}", + msg.corrections_certificate[9] + ); + assert_eq!( + msg.corrections_certificate[10], 10, + "incorrect value for corrections_certificate[10], expected 10, is {}", + msg.corrections_certificate[10] + ); + assert_eq!( + msg.corrections_certificate[11], 11, + "incorrect value for corrections_certificate[11], expected 11, is {}", + msg.corrections_certificate[11] + ); + assert_eq!( + msg.corrections_certificate[12], 12, + "incorrect value for corrections_certificate[12], expected 12, is {}", + msg.corrections_certificate[12] + ); + assert_eq!( + msg.corrections_certificate[13], 13, + "incorrect value for corrections_certificate[13], expected 13, is {}", + msg.corrections_certificate[13] + ); + assert_eq!( + msg.corrections_certificate[14], 14, + "incorrect value for corrections_certificate[14], expected 14, is {}", + msg.corrections_certificate[14] + ); + assert_eq!( + msg.corrections_certificate[15], 15, + "incorrect value for corrections_certificate[15], expected 15, is {}", + msg.corrections_certificate[15] + ); + assert_eq!( + msg.corrections_certificate[16], 16, + "incorrect value for corrections_certificate[16], expected 16, is {}", + msg.corrections_certificate[16] + ); + assert_eq!( + msg.corrections_certificate[17], 17, + "incorrect value for corrections_certificate[17], expected 17, is {}", + msg.corrections_certificate[17] + ); + assert_eq!( + msg.corrections_certificate[18], 18, + "incorrect value for corrections_certificate[18], expected 18, is {}", + msg.corrections_certificate[18] + ); + assert_eq!( + msg.corrections_certificate[19], 19, + "incorrect value for corrections_certificate[19], expected 19, is {}", + msg.corrections_certificate[19] + ); + assert_eq!( + msg.expiration.day, 30, + "incorrect value for expiration.day, expected 30, is {}", + msg.expiration.day + ); + assert_eq!( + msg.expiration.hours, 12, + "incorrect value for expiration.hours, expected 12, is {}", + msg.expiration.hours + ); + assert_eq!( + msg.expiration.minutes, 34, + "incorrect value for expiration.minutes, expected 34, is {}", + msg.expiration.minutes + ); + assert_eq!( + msg.expiration.month, 3, + "incorrect value for expiration.month, expected 3, is {}", + msg.expiration.month + ); + assert_eq!( + msg.expiration.ns, 123456789, + "incorrect value for expiration.ns, expected 123456789, is {}", + msg.expiration.ns + ); + assert_eq!( + msg.expiration.seconds, 59, + "incorrect value for expiration.seconds, expected 59, is {}", + msg.expiration.seconds + ); + assert_eq!( + msg.expiration.year, 2024, + "incorrect value for expiration.year, expected 2024, is {}", + msg.expiration.year + ); + assert_eq!( + msg.intermediate_certificate[0], 10, + "incorrect value for intermediate_certificate[0], expected 10, is {}", + msg.intermediate_certificate[0] + ); + assert_eq!( + msg.intermediate_certificate[1], 11, + "incorrect value for intermediate_certificate[1], expected 11, is {}", + msg.intermediate_certificate[1] + ); + assert_eq!( + msg.intermediate_certificate[2], 12, + "incorrect value for intermediate_certificate[2], expected 12, is {}", + msg.intermediate_certificate[2] + ); + assert_eq!( + msg.intermediate_certificate[3], 13, + "incorrect value for intermediate_certificate[3], expected 13, is {}", + msg.intermediate_certificate[3] + ); + assert_eq!( + msg.intermediate_certificate[4], 14, + "incorrect value for intermediate_certificate[4], expected 14, is {}", + msg.intermediate_certificate[4] + ); + assert_eq!( + msg.intermediate_certificate[5], 15, + "incorrect value for intermediate_certificate[5], expected 15, is {}", + msg.intermediate_certificate[5] + ); + assert_eq!( + msg.intermediate_certificate[6], 16, + "incorrect value for intermediate_certificate[6], expected 16, is {}", + msg.intermediate_certificate[6] + ); + assert_eq!( + msg.intermediate_certificate[7], 17, + "incorrect value for intermediate_certificate[7], expected 17, is {}", + msg.intermediate_certificate[7] + ); + assert_eq!( + msg.intermediate_certificate[8], 18, + "incorrect value for intermediate_certificate[8], expected 18, is {}", + msg.intermediate_certificate[8] + ); + assert_eq!( + msg.intermediate_certificate[9], 19, + "incorrect value for intermediate_certificate[9], expected 19, is {}", + msg.intermediate_certificate[9] + ); + assert_eq!( + msg.intermediate_certificate[10], 0, + "incorrect value for intermediate_certificate[10], expected 0, is {}", + msg.intermediate_certificate[10] + ); + assert_eq!( + msg.intermediate_certificate[11], 1, + "incorrect value for intermediate_certificate[11], expected 1, is {}", + msg.intermediate_certificate[11] + ); + assert_eq!( + msg.intermediate_certificate[12], 2, + "incorrect value for intermediate_certificate[12], expected 2, is {}", + msg.intermediate_certificate[12] + ); + assert_eq!( + msg.intermediate_certificate[13], 3, + "incorrect value for intermediate_certificate[13], expected 3, is {}", + msg.intermediate_certificate[13] + ); + assert_eq!( + msg.intermediate_certificate[14], 4, + "incorrect value for intermediate_certificate[14], expected 4, is {}", + msg.intermediate_certificate[14] + ); + assert_eq!( + msg.intermediate_certificate[15], 5, + "incorrect value for intermediate_certificate[15], expected 5, is {}", + msg.intermediate_certificate[15] + ); + assert_eq!( + msg.intermediate_certificate[16], 6, + "incorrect value for intermediate_certificate[16], expected 6, is {}", + msg.intermediate_certificate[16] + ); + assert_eq!( + msg.intermediate_certificate[17], 7, + "incorrect value for intermediate_certificate[17], expected 7, is {}", + msg.intermediate_certificate[17] + ); + assert_eq!( + msg.intermediate_certificate[18], 8, + "incorrect value for intermediate_certificate[18], expected 8, is {}", + msg.intermediate_certificate[18] + ); + assert_eq!( + msg.intermediate_certificate[19], 9, + "incorrect value for intermediate_certificate[19], expected 9, is {}", + msg.intermediate_certificate[19] + ); + assert_eq!( + msg.root_certificate[0], 0, + "incorrect value for root_certificate[0], expected 0, is {}", + msg.root_certificate[0] + ); + assert_eq!( + msg.root_certificate[1], 1, + "incorrect value for root_certificate[1], expected 1, is {}", + msg.root_certificate[1] + ); + assert_eq!( + msg.root_certificate[2], 2, + "incorrect value for root_certificate[2], expected 2, is {}", + msg.root_certificate[2] + ); + assert_eq!( + msg.root_certificate[3], 3, + "incorrect value for root_certificate[3], expected 3, is {}", + msg.root_certificate[3] + ); + assert_eq!( + msg.root_certificate[4], 4, + "incorrect value for root_certificate[4], expected 4, is {}", + msg.root_certificate[4] + ); + assert_eq!( + msg.root_certificate[5], 5, + "incorrect value for root_certificate[5], expected 5, is {}", + msg.root_certificate[5] + ); + assert_eq!( + msg.root_certificate[6], 6, + "incorrect value for root_certificate[6], expected 6, is {}", + msg.root_certificate[6] + ); + assert_eq!( + msg.root_certificate[7], 7, + "incorrect value for root_certificate[7], expected 7, is {}", + msg.root_certificate[7] + ); + assert_eq!( + msg.root_certificate[8], 8, + "incorrect value for root_certificate[8], expected 8, is {}", + msg.root_certificate[8] + ); + assert_eq!( + msg.root_certificate[9], 9, + "incorrect value for root_certificate[9], expected 9, is {}", + msg.root_certificate[9] + ); + assert_eq!( + msg.root_certificate[10], 10, + "incorrect value for root_certificate[10], expected 10, is {}", + msg.root_certificate[10] + ); + assert_eq!( + msg.root_certificate[11], 11, + "incorrect value for root_certificate[11], expected 11, is {}", + msg.root_certificate[11] + ); + assert_eq!( + msg.root_certificate[12], 12, + "incorrect value for root_certificate[12], expected 12, is {}", + msg.root_certificate[12] + ); + assert_eq!( + msg.root_certificate[13], 13, + "incorrect value for root_certificate[13], expected 13, is {}", + msg.root_certificate[13] + ); + assert_eq!( + msg.root_certificate[14], 14, + "incorrect value for root_certificate[14], expected 14, is {}", + msg.root_certificate[14] + ); + assert_eq!( + msg.root_certificate[15], 15, + "incorrect value for root_certificate[15], expected 15, is {}", + msg.root_certificate[15] + ); + assert_eq!( + msg.root_certificate[16], 16, + "incorrect value for root_certificate[16], expected 16, is {}", + msg.root_certificate[16] + ); + assert_eq!( + msg.root_certificate[17], 17, + "incorrect value for root_certificate[17], expected 17, is {}", + msg.root_certificate[17] + ); + assert_eq!( + msg.root_certificate[18], 18, + "incorrect value for root_certificate[18], expected 18, is {}", + msg.root_certificate[18] + ); + assert_eq!( + msg.root_certificate[19], 19, + "incorrect value for root_certificate[19], expected 19, is {}", + msg.root_certificate[19] + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 0, + "incorrect value for signature[8], expected 0, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 1, + "incorrect value for signature[9], expected 1, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 2, + "incorrect value for signature[10], expected 2, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 3, + "incorrect value for signature[11], expected 3, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 4, + "incorrect value for signature[12], expected 4, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 5, + "incorrect value for signature[13], expected 5, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 6, + "incorrect value for signature[14], expected 6, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 7, + "incorrect value for signature[15], expected 7, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 0, + "incorrect value for signature[16], expected 0, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 1, + "incorrect value for signature[17], expected 1, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 2, + "incorrect value for signature[18], expected 2, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 3, + "incorrect value for signature[19], expected 3, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 4, + "incorrect value for signature[20], expected 4, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 5, + "incorrect value for signature[21], expected 5, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 6, + "incorrect value for signature[22], expected 6, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 7, + "incorrect value for signature[23], expected 7, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 0, + "incorrect value for signature[24], expected 0, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 1, + "incorrect value for signature[25], expected 1, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 2, + "incorrect value for signature[26], expected 2, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 3, + "incorrect value for signature[27], expected 3, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 4, + "incorrect value for signature[28], expected 4, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 5, + "incorrect value for signature[29], expected 5, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 6, + "incorrect value for signature[30], expected 6, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 7, + "incorrect value for signature[31], expected 7, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 0, + "incorrect value for signature[32], expected 0, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 1, + "incorrect value for signature[33], expected 1, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 2, + "incorrect value for signature[34], expected 2, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 3, + "incorrect value for signature[35], expected 3, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 4, + "incorrect value for signature[36], expected 4, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 5, + "incorrect value for signature[37], expected 5, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 6, + "incorrect value for signature[38], expected 6, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 7, + "incorrect value for signature[39], expected 7, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 0, + "incorrect value for signature[40], expected 0, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 1, + "incorrect value for signature[41], expected 1, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 2, + "incorrect value for signature[42], expected 2, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 3, + "incorrect value for signature[43], expected 3, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 4, + "incorrect value for signature[44], expected 4, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 5, + "incorrect value for signature[45], expected 5, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 6, + "incorrect value for signature[46], expected 6, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 7, + "incorrect value for signature[47], expected 7, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 0, + "incorrect value for signature[48], expected 0, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 1, + "incorrect value for signature[49], expected 1, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 2, + "incorrect value for signature[50], expected 2, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 3, + "incorrect value for signature[51], expected 3, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 4, + "incorrect value for signature[52], expected 4, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 5, + "incorrect value for signature[53], expected 5, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 6, + "incorrect value for signature[54], expected 6, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 7, + "incorrect value for signature[55], expected 7, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 0, + "incorrect value for signature[56], expected 0, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 1, + "incorrect value for signature[57], expected 1, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 2, + "incorrect value for signature[58], expected 2, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 3, + "incorrect value for signature[59], expected 3, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 4, + "incorrect value for signature[60], expected 4, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 5, + "incorrect value for signature[61], expected 5, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 6, + "incorrect value for signature[62], expected 6, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 7, + "incorrect value for signature[63], expected 7, is {}", + msg.signature[63] + ); + } + _ => panic!("Invalid message type! Expected a MsgCertificateChainDep"), + }; + } +} + +/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON +/// +/// Assumes: +/// - [`self::test_auto_check_sbp_signing_msg_certificate_chain_dep`] passes +/// +/// Asserts: +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +#[cfg(feature = "json")] +fn test_sbp2json_auto_check_sbp_signing_msg_certificate_chain_dep() { + { + let mut payload = Cursor::new(vec![ + 85, 5, 12, 66, 0, 135, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 232, 7, 3, 30, + 12, 34, 59, 21, 205, 91, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, + 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, + 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 112, 100, + ]); + + // Construct sbp message + let sbp_msg = { + let mut msgs = iter_messages(&mut payload); + msgs.next() + .expect("no message found") + .expect("failed to parse message") + }; + + let mut json_buffer = vec![]; + // Populate json buffer, CompactFormatter + sbp::json::JsonEncoder::new(&mut json_buffer, sbp::json::CompactFormatter {}) + .send(&sbp_msg) + .unwrap(); + + // Reconstruct Sbp message from json fields, roundtrip + let sbp_msg = sbp::messages::Sbp::MsgCertificateChainDep( + serde_json::from_str( + std::str::from_utf8(json_buffer.as_slice()) + .unwrap() + .to_string() + .as_str(), + ) + .unwrap(), + ); + match &sbp_msg { + sbp::messages::Sbp::MsgCertificateChainDep(msg) => { + assert_eq!( + msg.message_type(), + 0xC05, + "Incorrect message type, expected 0xC05, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.corrections_certificate[0], 20, + "incorrect value for corrections_certificate[0], expected 20, is {}", + msg.corrections_certificate[0] + ); + assert_eq!( + msg.corrections_certificate[1], 21, + "incorrect value for corrections_certificate[1], expected 21, is {}", + msg.corrections_certificate[1] + ); + assert_eq!( + msg.corrections_certificate[2], 22, + "incorrect value for corrections_certificate[2], expected 22, is {}", + msg.corrections_certificate[2] + ); + assert_eq!( + msg.corrections_certificate[3], 23, + "incorrect value for corrections_certificate[3], expected 23, is {}", + msg.corrections_certificate[3] + ); + assert_eq!( + msg.corrections_certificate[4], 24, + "incorrect value for corrections_certificate[4], expected 24, is {}", + msg.corrections_certificate[4] + ); + assert_eq!( + msg.corrections_certificate[5], 25, + "incorrect value for corrections_certificate[5], expected 25, is {}", + msg.corrections_certificate[5] + ); + assert_eq!( + msg.corrections_certificate[6], 26, + "incorrect value for corrections_certificate[6], expected 26, is {}", + msg.corrections_certificate[6] + ); + assert_eq!( + msg.corrections_certificate[7], 27, + "incorrect value for corrections_certificate[7], expected 27, is {}", + msg.corrections_certificate[7] + ); + assert_eq!( + msg.corrections_certificate[8], 28, + "incorrect value for corrections_certificate[8], expected 28, is {}", + msg.corrections_certificate[8] + ); + assert_eq!( + msg.corrections_certificate[9], 29, + "incorrect value for corrections_certificate[9], expected 29, is {}", + msg.corrections_certificate[9] + ); + assert_eq!( + msg.corrections_certificate[10], 10, + "incorrect value for corrections_certificate[10], expected 10, is {}", + msg.corrections_certificate[10] + ); + assert_eq!( + msg.corrections_certificate[11], 11, + "incorrect value for corrections_certificate[11], expected 11, is {}", + msg.corrections_certificate[11] + ); + assert_eq!( + msg.corrections_certificate[12], 12, + "incorrect value for corrections_certificate[12], expected 12, is {}", + msg.corrections_certificate[12] + ); + assert_eq!( + msg.corrections_certificate[13], 13, + "incorrect value for corrections_certificate[13], expected 13, is {}", + msg.corrections_certificate[13] + ); + assert_eq!( + msg.corrections_certificate[14], 14, + "incorrect value for corrections_certificate[14], expected 14, is {}", + msg.corrections_certificate[14] + ); + assert_eq!( + msg.corrections_certificate[15], 15, + "incorrect value for corrections_certificate[15], expected 15, is {}", + msg.corrections_certificate[15] + ); + assert_eq!( + msg.corrections_certificate[16], 16, + "incorrect value for corrections_certificate[16], expected 16, is {}", + msg.corrections_certificate[16] + ); + assert_eq!( + msg.corrections_certificate[17], 17, + "incorrect value for corrections_certificate[17], expected 17, is {}", + msg.corrections_certificate[17] + ); + assert_eq!( + msg.corrections_certificate[18], 18, + "incorrect value for corrections_certificate[18], expected 18, is {}", + msg.corrections_certificate[18] + ); + assert_eq!( + msg.corrections_certificate[19], 19, + "incorrect value for corrections_certificate[19], expected 19, is {}", + msg.corrections_certificate[19] + ); + assert_eq!( + msg.expiration.day, 30, + "incorrect value for expiration.day, expected 30, is {}", + msg.expiration.day + ); + assert_eq!( + msg.expiration.hours, 12, + "incorrect value for expiration.hours, expected 12, is {}", + msg.expiration.hours + ); + assert_eq!( + msg.expiration.minutes, 34, + "incorrect value for expiration.minutes, expected 34, is {}", + msg.expiration.minutes + ); + assert_eq!( + msg.expiration.month, 3, + "incorrect value for expiration.month, expected 3, is {}", + msg.expiration.month + ); + assert_eq!( + msg.expiration.ns, 123456789, + "incorrect value for expiration.ns, expected 123456789, is {}", + msg.expiration.ns + ); + assert_eq!( + msg.expiration.seconds, 59, + "incorrect value for expiration.seconds, expected 59, is {}", + msg.expiration.seconds + ); + assert_eq!( + msg.expiration.year, 2024, + "incorrect value for expiration.year, expected 2024, is {}", + msg.expiration.year + ); + assert_eq!( + msg.intermediate_certificate[0], 10, + "incorrect value for intermediate_certificate[0], expected 10, is {}", + msg.intermediate_certificate[0] + ); + assert_eq!( + msg.intermediate_certificate[1], 11, + "incorrect value for intermediate_certificate[1], expected 11, is {}", + msg.intermediate_certificate[1] + ); + assert_eq!( + msg.intermediate_certificate[2], 12, + "incorrect value for intermediate_certificate[2], expected 12, is {}", + msg.intermediate_certificate[2] + ); + assert_eq!( + msg.intermediate_certificate[3], 13, + "incorrect value for intermediate_certificate[3], expected 13, is {}", + msg.intermediate_certificate[3] + ); + assert_eq!( + msg.intermediate_certificate[4], 14, + "incorrect value for intermediate_certificate[4], expected 14, is {}", + msg.intermediate_certificate[4] + ); + assert_eq!( + msg.intermediate_certificate[5], 15, + "incorrect value for intermediate_certificate[5], expected 15, is {}", + msg.intermediate_certificate[5] + ); + assert_eq!( + msg.intermediate_certificate[6], 16, + "incorrect value for intermediate_certificate[6], expected 16, is {}", + msg.intermediate_certificate[6] + ); + assert_eq!( + msg.intermediate_certificate[7], 17, + "incorrect value for intermediate_certificate[7], expected 17, is {}", + msg.intermediate_certificate[7] + ); + assert_eq!( + msg.intermediate_certificate[8], 18, + "incorrect value for intermediate_certificate[8], expected 18, is {}", + msg.intermediate_certificate[8] + ); + assert_eq!( + msg.intermediate_certificate[9], 19, + "incorrect value for intermediate_certificate[9], expected 19, is {}", + msg.intermediate_certificate[9] + ); + assert_eq!( + msg.intermediate_certificate[10], 0, + "incorrect value for intermediate_certificate[10], expected 0, is {}", + msg.intermediate_certificate[10] + ); + assert_eq!( + msg.intermediate_certificate[11], 1, + "incorrect value for intermediate_certificate[11], expected 1, is {}", + msg.intermediate_certificate[11] + ); + assert_eq!( + msg.intermediate_certificate[12], 2, + "incorrect value for intermediate_certificate[12], expected 2, is {}", + msg.intermediate_certificate[12] + ); + assert_eq!( + msg.intermediate_certificate[13], 3, + "incorrect value for intermediate_certificate[13], expected 3, is {}", + msg.intermediate_certificate[13] + ); + assert_eq!( + msg.intermediate_certificate[14], 4, + "incorrect value for intermediate_certificate[14], expected 4, is {}", + msg.intermediate_certificate[14] + ); + assert_eq!( + msg.intermediate_certificate[15], 5, + "incorrect value for intermediate_certificate[15], expected 5, is {}", + msg.intermediate_certificate[15] + ); + assert_eq!( + msg.intermediate_certificate[16], 6, + "incorrect value for intermediate_certificate[16], expected 6, is {}", + msg.intermediate_certificate[16] + ); + assert_eq!( + msg.intermediate_certificate[17], 7, + "incorrect value for intermediate_certificate[17], expected 7, is {}", + msg.intermediate_certificate[17] + ); + assert_eq!( + msg.intermediate_certificate[18], 8, + "incorrect value for intermediate_certificate[18], expected 8, is {}", + msg.intermediate_certificate[18] + ); + assert_eq!( + msg.intermediate_certificate[19], 9, + "incorrect value for intermediate_certificate[19], expected 9, is {}", + msg.intermediate_certificate[19] + ); + assert_eq!( + msg.root_certificate[0], 0, + "incorrect value for root_certificate[0], expected 0, is {}", + msg.root_certificate[0] + ); + assert_eq!( + msg.root_certificate[1], 1, + "incorrect value for root_certificate[1], expected 1, is {}", + msg.root_certificate[1] + ); + assert_eq!( + msg.root_certificate[2], 2, + "incorrect value for root_certificate[2], expected 2, is {}", + msg.root_certificate[2] + ); + assert_eq!( + msg.root_certificate[3], 3, + "incorrect value for root_certificate[3], expected 3, is {}", + msg.root_certificate[3] + ); + assert_eq!( + msg.root_certificate[4], 4, + "incorrect value for root_certificate[4], expected 4, is {}", + msg.root_certificate[4] + ); + assert_eq!( + msg.root_certificate[5], 5, + "incorrect value for root_certificate[5], expected 5, is {}", + msg.root_certificate[5] + ); + assert_eq!( + msg.root_certificate[6], 6, + "incorrect value for root_certificate[6], expected 6, is {}", + msg.root_certificate[6] + ); + assert_eq!( + msg.root_certificate[7], 7, + "incorrect value for root_certificate[7], expected 7, is {}", + msg.root_certificate[7] + ); + assert_eq!( + msg.root_certificate[8], 8, + "incorrect value for root_certificate[8], expected 8, is {}", + msg.root_certificate[8] + ); + assert_eq!( + msg.root_certificate[9], 9, + "incorrect value for root_certificate[9], expected 9, is {}", + msg.root_certificate[9] + ); + assert_eq!( + msg.root_certificate[10], 10, + "incorrect value for root_certificate[10], expected 10, is {}", + msg.root_certificate[10] + ); + assert_eq!( + msg.root_certificate[11], 11, + "incorrect value for root_certificate[11], expected 11, is {}", + msg.root_certificate[11] + ); + assert_eq!( + msg.root_certificate[12], 12, + "incorrect value for root_certificate[12], expected 12, is {}", + msg.root_certificate[12] + ); + assert_eq!( + msg.root_certificate[13], 13, + "incorrect value for root_certificate[13], expected 13, is {}", + msg.root_certificate[13] + ); + assert_eq!( + msg.root_certificate[14], 14, + "incorrect value for root_certificate[14], expected 14, is {}", + msg.root_certificate[14] + ); + assert_eq!( + msg.root_certificate[15], 15, + "incorrect value for root_certificate[15], expected 15, is {}", + msg.root_certificate[15] + ); + assert_eq!( + msg.root_certificate[16], 16, + "incorrect value for root_certificate[16], expected 16, is {}", + msg.root_certificate[16] + ); + assert_eq!( + msg.root_certificate[17], 17, + "incorrect value for root_certificate[17], expected 17, is {}", + msg.root_certificate[17] + ); + assert_eq!( + msg.root_certificate[18], 18, + "incorrect value for root_certificate[18], expected 18, is {}", + msg.root_certificate[18] + ); + assert_eq!( + msg.root_certificate[19], 19, + "incorrect value for root_certificate[19], expected 19, is {}", + msg.root_certificate[19] + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 0, + "incorrect value for signature[8], expected 0, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 1, + "incorrect value for signature[9], expected 1, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 2, + "incorrect value for signature[10], expected 2, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 3, + "incorrect value for signature[11], expected 3, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 4, + "incorrect value for signature[12], expected 4, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 5, + "incorrect value for signature[13], expected 5, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 6, + "incorrect value for signature[14], expected 6, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 7, + "incorrect value for signature[15], expected 7, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 0, + "incorrect value for signature[16], expected 0, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 1, + "incorrect value for signature[17], expected 1, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 2, + "incorrect value for signature[18], expected 2, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 3, + "incorrect value for signature[19], expected 3, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 4, + "incorrect value for signature[20], expected 4, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 5, + "incorrect value for signature[21], expected 5, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 6, + "incorrect value for signature[22], expected 6, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 7, + "incorrect value for signature[23], expected 7, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 0, + "incorrect value for signature[24], expected 0, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 1, + "incorrect value for signature[25], expected 1, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 2, + "incorrect value for signature[26], expected 2, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 3, + "incorrect value for signature[27], expected 3, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 4, + "incorrect value for signature[28], expected 4, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 5, + "incorrect value for signature[29], expected 5, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 6, + "incorrect value for signature[30], expected 6, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 7, + "incorrect value for signature[31], expected 7, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 0, + "incorrect value for signature[32], expected 0, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 1, + "incorrect value for signature[33], expected 1, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 2, + "incorrect value for signature[34], expected 2, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 3, + "incorrect value for signature[35], expected 3, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 4, + "incorrect value for signature[36], expected 4, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 5, + "incorrect value for signature[37], expected 5, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 6, + "incorrect value for signature[38], expected 6, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 7, + "incorrect value for signature[39], expected 7, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 0, + "incorrect value for signature[40], expected 0, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 1, + "incorrect value for signature[41], expected 1, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 2, + "incorrect value for signature[42], expected 2, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 3, + "incorrect value for signature[43], expected 3, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 4, + "incorrect value for signature[44], expected 4, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 5, + "incorrect value for signature[45], expected 5, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 6, + "incorrect value for signature[46], expected 6, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 7, + "incorrect value for signature[47], expected 7, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 0, + "incorrect value for signature[48], expected 0, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 1, + "incorrect value for signature[49], expected 1, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 2, + "incorrect value for signature[50], expected 2, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 3, + "incorrect value for signature[51], expected 3, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 4, + "incorrect value for signature[52], expected 4, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 5, + "incorrect value for signature[53], expected 5, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 6, + "incorrect value for signature[54], expected 6, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 7, + "incorrect value for signature[55], expected 7, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 0, + "incorrect value for signature[56], expected 0, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 1, + "incorrect value for signature[57], expected 1, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 2, + "incorrect value for signature[58], expected 2, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 3, + "incorrect value for signature[59], expected 3, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 4, + "incorrect value for signature[60], expected 4, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 5, + "incorrect value for signature[61], expected 5, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 6, + "incorrect value for signature[62], expected 6, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 7, + "incorrect value for signature[63], expected 7, is {}", + msg.signature[63] + ); + } + _ => panic!("Invalid message type! Expected a MsgCertificateChainDep"), + }; + + // Check payload is still identical + let frame = sbp::to_vec(&sbp_msg).unwrap(); + assert_eq!(frame, payload.into_inner()); + } +} diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature.rs index 8a0c1df5e2..4e82341c6d 100644 --- a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature.rs +++ b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature.rs @@ -22,10 +22,10 @@ use crate::*; fn test_auto_check_sbp_signing_msg_ecdsa_signature() { { let mut payload = Cursor::new(vec![ - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, ]); // Test the round trip payload parsing @@ -39,8 +39,8 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature() { sbp::messages::Sbp::MsgEcdsaSignature(msg) => { assert_eq!( msg.message_type(), - 0xC07, - "Incorrect message type, expected 0xC07, is {}", + 0xC08, + "Incorrect message type, expected 0xC08, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -73,375 +73,375 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature() { "incorrect value for flags, expected 0, is {}", msg.flags ); - assert_eq!( - msg.n_signature_bytes, 72, - "incorrect value for n_signature_bytes, expected 72, is {}", - msg.n_signature_bytes - ); assert_eq!( msg.on_demand_counter, 2, "incorrect value for on_demand_counter, expected 2, is {}", msg.on_demand_counter ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] + ); + assert_eq!( + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] ); assert_eq!( - msg.signature[8], 8, - "incorrect value for signature[8], expected 8, is {}", - msg.signature[8] + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[9], 9, - "incorrect value for signature[9], expected 9, is {}", - msg.signature[9] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[10], 10, - "incorrect value for signature[10], expected 10, is {}", - msg.signature[10] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[11], 11, - "incorrect value for signature[11], expected 11, is {}", - msg.signature[11] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[12], 12, - "incorrect value for signature[12], expected 12, is {}", - msg.signature[12] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[13], 13, - "incorrect value for signature[13], expected 13, is {}", - msg.signature[13] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[14], 14, - "incorrect value for signature[14], expected 14, is {}", - msg.signature[14] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[15], 15, - "incorrect value for signature[15], expected 15, is {}", - msg.signature[15] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[16], 16, - "incorrect value for signature[16], expected 16, is {}", - msg.signature[16] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[17], 17, - "incorrect value for signature[17], expected 17, is {}", - msg.signature[17] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[18], 18, - "incorrect value for signature[18], expected 18, is {}", - msg.signature[18] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[19], 19, - "incorrect value for signature[19], expected 19, is {}", - msg.signature[19] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[20], 20, - "incorrect value for signature[20], expected 20, is {}", - msg.signature[20] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[21], 21, - "incorrect value for signature[21], expected 21, is {}", - msg.signature[21] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[22], 22, - "incorrect value for signature[22], expected 22, is {}", - msg.signature[22] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[23], 23, - "incorrect value for signature[23], expected 23, is {}", - msg.signature[23] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[24], 24, - "incorrect value for signature[24], expected 24, is {}", - msg.signature[24] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[25], 25, - "incorrect value for signature[25], expected 25, is {}", - msg.signature[25] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[26], 26, - "incorrect value for signature[26], expected 26, is {}", - msg.signature[26] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[27], 27, - "incorrect value for signature[27], expected 27, is {}", - msg.signature[27] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[28], 28, - "incorrect value for signature[28], expected 28, is {}", - msg.signature[28] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[29], 29, - "incorrect value for signature[29], expected 29, is {}", - msg.signature[29] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[30], 30, - "incorrect value for signature[30], expected 30, is {}", - msg.signature[30] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[31], 31, - "incorrect value for signature[31], expected 31, is {}", - msg.signature[31] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[32], 32, - "incorrect value for signature[32], expected 32, is {}", - msg.signature[32] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[33], 33, - "incorrect value for signature[33], expected 33, is {}", - msg.signature[33] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[34], 34, - "incorrect value for signature[34], expected 34, is {}", - msg.signature[34] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[35], 35, - "incorrect value for signature[35], expected 35, is {}", - msg.signature[35] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[36], 36, - "incorrect value for signature[36], expected 36, is {}", - msg.signature[36] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[37], 37, - "incorrect value for signature[37], expected 37, is {}", - msg.signature[37] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[38], 38, - "incorrect value for signature[38], expected 38, is {}", - msg.signature[38] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[39], 39, - "incorrect value for signature[39], expected 39, is {}", - msg.signature[39] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[40], 40, - "incorrect value for signature[40], expected 40, is {}", - msg.signature[40] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[41], 41, - "incorrect value for signature[41], expected 41, is {}", - msg.signature[41] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[42], 42, - "incorrect value for signature[42], expected 42, is {}", - msg.signature[42] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[43], 43, - "incorrect value for signature[43], expected 43, is {}", - msg.signature[43] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[44], 44, - "incorrect value for signature[44], expected 44, is {}", - msg.signature[44] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[45], 45, - "incorrect value for signature[45], expected 45, is {}", - msg.signature[45] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[46], 46, - "incorrect value for signature[46], expected 46, is {}", - msg.signature[46] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[47], 47, - "incorrect value for signature[47], expected 47, is {}", - msg.signature[47] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[48], 48, - "incorrect value for signature[48], expected 48, is {}", - msg.signature[48] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[49], 49, - "incorrect value for signature[49], expected 49, is {}", - msg.signature[49] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[50], 50, - "incorrect value for signature[50], expected 50, is {}", - msg.signature[50] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[51], 51, - "incorrect value for signature[51], expected 51, is {}", - msg.signature[51] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[52], 52, - "incorrect value for signature[52], expected 52, is {}", - msg.signature[52] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[53], 53, - "incorrect value for signature[53], expected 53, is {}", - msg.signature[53] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[54], 54, - "incorrect value for signature[54], expected 54, is {}", - msg.signature[54] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[55], 55, - "incorrect value for signature[55], expected 55, is {}", - msg.signature[55] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[56], 56, - "incorrect value for signature[56], expected 56, is {}", - msg.signature[56] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[57], 57, - "incorrect value for signature[57], expected 57, is {}", - msg.signature[57] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[58], 58, - "incorrect value for signature[58], expected 58, is {}", - msg.signature[58] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[59], 59, - "incorrect value for signature[59], expected 59, is {}", - msg.signature[59] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[60], 60, - "incorrect value for signature[60], expected 60, is {}", - msg.signature[60] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[61], 61, - "incorrect value for signature[61], expected 61, is {}", - msg.signature[61] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[62], 62, - "incorrect value for signature[62], expected 62, is {}", - msg.signature[62] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] ); assert_eq!( - msg.signature[63], 63, - "incorrect value for signature[63], expected 63, is {}", - msg.signature[63] + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] ); assert_eq!( - msg.signature[64], 64, - "incorrect value for signature[64], expected 64, is {}", - msg.signature[64] + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] ); assert_eq!( - msg.signature[65], 65, - "incorrect value for signature[65], expected 65, is {}", - msg.signature[65] + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] ); assert_eq!( - msg.signature[66], 66, - "incorrect value for signature[66], expected 66, is {}", - msg.signature[66] + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] ); assert_eq!( - msg.signature[67], 67, - "incorrect value for signature[67], expected 67, is {}", - msg.signature[67] + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] ); assert_eq!( - msg.signature[68], 68, - "incorrect value for signature[68], expected 68, is {}", - msg.signature[68] + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] ); assert_eq!( - msg.signature[69], 69, - "incorrect value for signature[69], expected 69, is {}", - msg.signature[69] + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] ); assert_eq!( - msg.signature[70], 70, - "incorrect value for signature[70], expected 70, is {}", - msg.signature[70] + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] ); assert_eq!( - msg.signature[71], 71, - "incorrect value for signature[71], expected 71, is {}", - msg.signature[71] + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); assert_eq!( msg.signed_messages[0], 10, @@ -482,7 +482,7 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature() { #[cfg(feature = "json")] fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature() { { - let json_input = r#"{"preamble": 85, "msg_type": 3079, "sender": 66, "length": 83, "payload": "AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc=", "crc": 40958, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": [1, 2, 3, 4], "n_signature_bytes": 72, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], "signed_messages": [10, 21, 23]}"#.as_bytes(); + let json_input = r#"{"preamble": 85, "msg_type": 3080, "sender": 66, "length": 83, "payload": "AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc=", "crc": 33768, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": [1, 2, 3, 4], "signature": {"len": 72, "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]}, "signed_messages": [10, 21, 23]}"#.as_bytes(); let sbp_msg = { // JSON to SBP message from payload @@ -506,8 +506,8 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature() { sbp::messages::Sbp::MsgEcdsaSignature(msg) => { assert_eq!( msg.message_type(), - 0xC07, - "Incorrect message type, expected 0xC07, is {}", + 0xC08, + "Incorrect message type, expected 0xC08, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -540,375 +540,375 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature() { "incorrect value for flags, expected 0, is {}", msg.flags ); - assert_eq!( - msg.n_signature_bytes, 72, - "incorrect value for n_signature_bytes, expected 72, is {}", - msg.n_signature_bytes - ); assert_eq!( msg.on_demand_counter, 2, "incorrect value for on_demand_counter, expected 2, is {}", msg.on_demand_counter ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] ); assert_eq!( - msg.signature[8], 8, - "incorrect value for signature[8], expected 8, is {}", - msg.signature[8] + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] ); assert_eq!( - msg.signature[9], 9, - "incorrect value for signature[9], expected 9, is {}", - msg.signature[9] + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[10], 10, - "incorrect value for signature[10], expected 10, is {}", - msg.signature[10] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[11], 11, - "incorrect value for signature[11], expected 11, is {}", - msg.signature[11] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[12], 12, - "incorrect value for signature[12], expected 12, is {}", - msg.signature[12] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[13], 13, - "incorrect value for signature[13], expected 13, is {}", - msg.signature[13] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[14], 14, - "incorrect value for signature[14], expected 14, is {}", - msg.signature[14] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[15], 15, - "incorrect value for signature[15], expected 15, is {}", - msg.signature[15] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[16], 16, - "incorrect value for signature[16], expected 16, is {}", - msg.signature[16] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[17], 17, - "incorrect value for signature[17], expected 17, is {}", - msg.signature[17] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[18], 18, - "incorrect value for signature[18], expected 18, is {}", - msg.signature[18] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[19], 19, - "incorrect value for signature[19], expected 19, is {}", - msg.signature[19] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[20], 20, - "incorrect value for signature[20], expected 20, is {}", - msg.signature[20] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[21], 21, - "incorrect value for signature[21], expected 21, is {}", - msg.signature[21] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[22], 22, - "incorrect value for signature[22], expected 22, is {}", - msg.signature[22] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[23], 23, - "incorrect value for signature[23], expected 23, is {}", - msg.signature[23] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[24], 24, - "incorrect value for signature[24], expected 24, is {}", - msg.signature[24] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[25], 25, - "incorrect value for signature[25], expected 25, is {}", - msg.signature[25] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[26], 26, - "incorrect value for signature[26], expected 26, is {}", - msg.signature[26] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[27], 27, - "incorrect value for signature[27], expected 27, is {}", - msg.signature[27] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[28], 28, - "incorrect value for signature[28], expected 28, is {}", - msg.signature[28] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[29], 29, - "incorrect value for signature[29], expected 29, is {}", - msg.signature[29] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[30], 30, - "incorrect value for signature[30], expected 30, is {}", - msg.signature[30] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[31], 31, - "incorrect value for signature[31], expected 31, is {}", - msg.signature[31] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[32], 32, - "incorrect value for signature[32], expected 32, is {}", - msg.signature[32] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[33], 33, - "incorrect value for signature[33], expected 33, is {}", - msg.signature[33] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[34], 34, - "incorrect value for signature[34], expected 34, is {}", - msg.signature[34] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[35], 35, - "incorrect value for signature[35], expected 35, is {}", - msg.signature[35] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[36], 36, - "incorrect value for signature[36], expected 36, is {}", - msg.signature[36] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[37], 37, - "incorrect value for signature[37], expected 37, is {}", - msg.signature[37] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[38], 38, - "incorrect value for signature[38], expected 38, is {}", - msg.signature[38] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[39], 39, - "incorrect value for signature[39], expected 39, is {}", - msg.signature[39] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[40], 40, - "incorrect value for signature[40], expected 40, is {}", - msg.signature[40] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[41], 41, - "incorrect value for signature[41], expected 41, is {}", - msg.signature[41] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[42], 42, - "incorrect value for signature[42], expected 42, is {}", - msg.signature[42] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[43], 43, - "incorrect value for signature[43], expected 43, is {}", - msg.signature[43] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[44], 44, - "incorrect value for signature[44], expected 44, is {}", - msg.signature[44] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[45], 45, - "incorrect value for signature[45], expected 45, is {}", - msg.signature[45] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[46], 46, - "incorrect value for signature[46], expected 46, is {}", - msg.signature[46] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[47], 47, - "incorrect value for signature[47], expected 47, is {}", - msg.signature[47] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[48], 48, - "incorrect value for signature[48], expected 48, is {}", - msg.signature[48] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[49], 49, - "incorrect value for signature[49], expected 49, is {}", - msg.signature[49] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[50], 50, - "incorrect value for signature[50], expected 50, is {}", - msg.signature[50] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[51], 51, - "incorrect value for signature[51], expected 51, is {}", - msg.signature[51] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[52], 52, - "incorrect value for signature[52], expected 52, is {}", - msg.signature[52] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[53], 53, - "incorrect value for signature[53], expected 53, is {}", - msg.signature[53] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[54], 54, - "incorrect value for signature[54], expected 54, is {}", - msg.signature[54] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[55], 55, - "incorrect value for signature[55], expected 55, is {}", - msg.signature[55] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[56], 56, - "incorrect value for signature[56], expected 56, is {}", - msg.signature[56] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[57], 57, - "incorrect value for signature[57], expected 57, is {}", - msg.signature[57] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[58], 58, - "incorrect value for signature[58], expected 58, is {}", - msg.signature[58] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[59], 59, - "incorrect value for signature[59], expected 59, is {}", - msg.signature[59] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[60], 60, - "incorrect value for signature[60], expected 60, is {}", - msg.signature[60] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[61], 61, - "incorrect value for signature[61], expected 61, is {}", - msg.signature[61] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[62], 62, - "incorrect value for signature[62], expected 62, is {}", - msg.signature[62] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[63], 63, - "incorrect value for signature[63], expected 63, is {}", - msg.signature[63] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] ); assert_eq!( - msg.signature[64], 64, - "incorrect value for signature[64], expected 64, is {}", - msg.signature[64] + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] ); assert_eq!( - msg.signature[65], 65, - "incorrect value for signature[65], expected 65, is {}", - msg.signature[65] + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] ); assert_eq!( - msg.signature[66], 66, - "incorrect value for signature[66], expected 66, is {}", - msg.signature[66] + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] ); assert_eq!( - msg.signature[67], 67, - "incorrect value for signature[67], expected 67, is {}", - msg.signature[67] + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] ); assert_eq!( - msg.signature[68], 68, - "incorrect value for signature[68], expected 68, is {}", - msg.signature[68] + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] ); assert_eq!( - msg.signature[69], 69, - "incorrect value for signature[69], expected 69, is {}", - msg.signature[69] + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] ); assert_eq!( - msg.signature[70], 70, - "incorrect value for signature[70], expected 70, is {}", - msg.signature[70] + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] ); assert_eq!( - msg.signature[71], 71, - "incorrect value for signature[71], expected 71, is {}", - msg.signature[71] + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] + ); + assert_eq!( + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); assert_eq!( msg.signed_messages[0], 10, @@ -949,10 +949,10 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature() { fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature() { { let mut payload = Cursor::new(vec![ - 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 85, 8, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 232, 131, ]); // Construct sbp message @@ -983,8 +983,8 @@ fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature() { sbp::messages::Sbp::MsgEcdsaSignature(msg) => { assert_eq!( msg.message_type(), - 0xC07, - "Incorrect message type, expected 0xC07, is {}", + 0xC08, + "Incorrect message type, expected 0xC08, is {}", msg.message_type() ); let sender_id = msg.sender_id().unwrap(); @@ -1017,375 +1017,375 @@ fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature() { "incorrect value for flags, expected 0, is {}", msg.flags ); - assert_eq!( - msg.n_signature_bytes, 72, - "incorrect value for n_signature_bytes, expected 72, is {}", - msg.n_signature_bytes - ); assert_eq!( msg.on_demand_counter, 2, "incorrect value for on_demand_counter, expected 2, is {}", msg.on_demand_counter ); assert_eq!( - msg.signature[0], 0, - "incorrect value for signature[0], expected 0, is {}", - msg.signature[0] + msg.signature.data[0], 0, + "incorrect value for signature.data[0], expected 0, is {}", + msg.signature.data[0] + ); + assert_eq!( + msg.signature.data[1], 1, + "incorrect value for signature.data[1], expected 1, is {}", + msg.signature.data[1] ); assert_eq!( - msg.signature[1], 1, - "incorrect value for signature[1], expected 1, is {}", - msg.signature[1] + msg.signature.data[2], 2, + "incorrect value for signature.data[2], expected 2, is {}", + msg.signature.data[2] ); assert_eq!( - msg.signature[2], 2, - "incorrect value for signature[2], expected 2, is {}", - msg.signature[2] + msg.signature.data[3], 3, + "incorrect value for signature.data[3], expected 3, is {}", + msg.signature.data[3] ); assert_eq!( - msg.signature[3], 3, - "incorrect value for signature[3], expected 3, is {}", - msg.signature[3] + msg.signature.data[4], 4, + "incorrect value for signature.data[4], expected 4, is {}", + msg.signature.data[4] ); assert_eq!( - msg.signature[4], 4, - "incorrect value for signature[4], expected 4, is {}", - msg.signature[4] + msg.signature.data[5], 5, + "incorrect value for signature.data[5], expected 5, is {}", + msg.signature.data[5] ); assert_eq!( - msg.signature[5], 5, - "incorrect value for signature[5], expected 5, is {}", - msg.signature[5] + msg.signature.data[6], 6, + "incorrect value for signature.data[6], expected 6, is {}", + msg.signature.data[6] ); assert_eq!( - msg.signature[6], 6, - "incorrect value for signature[6], expected 6, is {}", - msg.signature[6] + msg.signature.data[7], 7, + "incorrect value for signature.data[7], expected 7, is {}", + msg.signature.data[7] ); assert_eq!( - msg.signature[7], 7, - "incorrect value for signature[7], expected 7, is {}", - msg.signature[7] + msg.signature.data[8], 8, + "incorrect value for signature.data[8], expected 8, is {}", + msg.signature.data[8] ); assert_eq!( - msg.signature[8], 8, - "incorrect value for signature[8], expected 8, is {}", - msg.signature[8] + msg.signature.data[9], 9, + "incorrect value for signature.data[9], expected 9, is {}", + msg.signature.data[9] ); assert_eq!( - msg.signature[9], 9, - "incorrect value for signature[9], expected 9, is {}", - msg.signature[9] + msg.signature.data[10], 10, + "incorrect value for signature.data[10], expected 10, is {}", + msg.signature.data[10] ); assert_eq!( - msg.signature[10], 10, - "incorrect value for signature[10], expected 10, is {}", - msg.signature[10] + msg.signature.data[11], 11, + "incorrect value for signature.data[11], expected 11, is {}", + msg.signature.data[11] ); assert_eq!( - msg.signature[11], 11, - "incorrect value for signature[11], expected 11, is {}", - msg.signature[11] + msg.signature.data[12], 12, + "incorrect value for signature.data[12], expected 12, is {}", + msg.signature.data[12] ); assert_eq!( - msg.signature[12], 12, - "incorrect value for signature[12], expected 12, is {}", - msg.signature[12] + msg.signature.data[13], 13, + "incorrect value for signature.data[13], expected 13, is {}", + msg.signature.data[13] ); assert_eq!( - msg.signature[13], 13, - "incorrect value for signature[13], expected 13, is {}", - msg.signature[13] + msg.signature.data[14], 14, + "incorrect value for signature.data[14], expected 14, is {}", + msg.signature.data[14] ); assert_eq!( - msg.signature[14], 14, - "incorrect value for signature[14], expected 14, is {}", - msg.signature[14] + msg.signature.data[15], 15, + "incorrect value for signature.data[15], expected 15, is {}", + msg.signature.data[15] ); assert_eq!( - msg.signature[15], 15, - "incorrect value for signature[15], expected 15, is {}", - msg.signature[15] + msg.signature.data[16], 16, + "incorrect value for signature.data[16], expected 16, is {}", + msg.signature.data[16] ); assert_eq!( - msg.signature[16], 16, - "incorrect value for signature[16], expected 16, is {}", - msg.signature[16] + msg.signature.data[17], 17, + "incorrect value for signature.data[17], expected 17, is {}", + msg.signature.data[17] ); assert_eq!( - msg.signature[17], 17, - "incorrect value for signature[17], expected 17, is {}", - msg.signature[17] + msg.signature.data[18], 18, + "incorrect value for signature.data[18], expected 18, is {}", + msg.signature.data[18] ); assert_eq!( - msg.signature[18], 18, - "incorrect value for signature[18], expected 18, is {}", - msg.signature[18] + msg.signature.data[19], 19, + "incorrect value for signature.data[19], expected 19, is {}", + msg.signature.data[19] ); assert_eq!( - msg.signature[19], 19, - "incorrect value for signature[19], expected 19, is {}", - msg.signature[19] + msg.signature.data[20], 20, + "incorrect value for signature.data[20], expected 20, is {}", + msg.signature.data[20] ); assert_eq!( - msg.signature[20], 20, - "incorrect value for signature[20], expected 20, is {}", - msg.signature[20] + msg.signature.data[21], 21, + "incorrect value for signature.data[21], expected 21, is {}", + msg.signature.data[21] ); assert_eq!( - msg.signature[21], 21, - "incorrect value for signature[21], expected 21, is {}", - msg.signature[21] + msg.signature.data[22], 22, + "incorrect value for signature.data[22], expected 22, is {}", + msg.signature.data[22] ); assert_eq!( - msg.signature[22], 22, - "incorrect value for signature[22], expected 22, is {}", - msg.signature[22] + msg.signature.data[23], 23, + "incorrect value for signature.data[23], expected 23, is {}", + msg.signature.data[23] ); assert_eq!( - msg.signature[23], 23, - "incorrect value for signature[23], expected 23, is {}", - msg.signature[23] + msg.signature.data[24], 24, + "incorrect value for signature.data[24], expected 24, is {}", + msg.signature.data[24] ); assert_eq!( - msg.signature[24], 24, - "incorrect value for signature[24], expected 24, is {}", - msg.signature[24] + msg.signature.data[25], 25, + "incorrect value for signature.data[25], expected 25, is {}", + msg.signature.data[25] ); assert_eq!( - msg.signature[25], 25, - "incorrect value for signature[25], expected 25, is {}", - msg.signature[25] + msg.signature.data[26], 26, + "incorrect value for signature.data[26], expected 26, is {}", + msg.signature.data[26] ); assert_eq!( - msg.signature[26], 26, - "incorrect value for signature[26], expected 26, is {}", - msg.signature[26] + msg.signature.data[27], 27, + "incorrect value for signature.data[27], expected 27, is {}", + msg.signature.data[27] ); assert_eq!( - msg.signature[27], 27, - "incorrect value for signature[27], expected 27, is {}", - msg.signature[27] + msg.signature.data[28], 28, + "incorrect value for signature.data[28], expected 28, is {}", + msg.signature.data[28] ); assert_eq!( - msg.signature[28], 28, - "incorrect value for signature[28], expected 28, is {}", - msg.signature[28] + msg.signature.data[29], 29, + "incorrect value for signature.data[29], expected 29, is {}", + msg.signature.data[29] ); assert_eq!( - msg.signature[29], 29, - "incorrect value for signature[29], expected 29, is {}", - msg.signature[29] + msg.signature.data[30], 30, + "incorrect value for signature.data[30], expected 30, is {}", + msg.signature.data[30] ); assert_eq!( - msg.signature[30], 30, - "incorrect value for signature[30], expected 30, is {}", - msg.signature[30] + msg.signature.data[31], 31, + "incorrect value for signature.data[31], expected 31, is {}", + msg.signature.data[31] ); assert_eq!( - msg.signature[31], 31, - "incorrect value for signature[31], expected 31, is {}", - msg.signature[31] + msg.signature.data[32], 32, + "incorrect value for signature.data[32], expected 32, is {}", + msg.signature.data[32] ); assert_eq!( - msg.signature[32], 32, - "incorrect value for signature[32], expected 32, is {}", - msg.signature[32] + msg.signature.data[33], 33, + "incorrect value for signature.data[33], expected 33, is {}", + msg.signature.data[33] ); assert_eq!( - msg.signature[33], 33, - "incorrect value for signature[33], expected 33, is {}", - msg.signature[33] + msg.signature.data[34], 34, + "incorrect value for signature.data[34], expected 34, is {}", + msg.signature.data[34] ); assert_eq!( - msg.signature[34], 34, - "incorrect value for signature[34], expected 34, is {}", - msg.signature[34] + msg.signature.data[35], 35, + "incorrect value for signature.data[35], expected 35, is {}", + msg.signature.data[35] ); assert_eq!( - msg.signature[35], 35, - "incorrect value for signature[35], expected 35, is {}", - msg.signature[35] + msg.signature.data[36], 36, + "incorrect value for signature.data[36], expected 36, is {}", + msg.signature.data[36] ); assert_eq!( - msg.signature[36], 36, - "incorrect value for signature[36], expected 36, is {}", - msg.signature[36] + msg.signature.data[37], 37, + "incorrect value for signature.data[37], expected 37, is {}", + msg.signature.data[37] ); assert_eq!( - msg.signature[37], 37, - "incorrect value for signature[37], expected 37, is {}", - msg.signature[37] + msg.signature.data[38], 38, + "incorrect value for signature.data[38], expected 38, is {}", + msg.signature.data[38] ); assert_eq!( - msg.signature[38], 38, - "incorrect value for signature[38], expected 38, is {}", - msg.signature[38] + msg.signature.data[39], 39, + "incorrect value for signature.data[39], expected 39, is {}", + msg.signature.data[39] ); assert_eq!( - msg.signature[39], 39, - "incorrect value for signature[39], expected 39, is {}", - msg.signature[39] + msg.signature.data[40], 40, + "incorrect value for signature.data[40], expected 40, is {}", + msg.signature.data[40] ); assert_eq!( - msg.signature[40], 40, - "incorrect value for signature[40], expected 40, is {}", - msg.signature[40] + msg.signature.data[41], 41, + "incorrect value for signature.data[41], expected 41, is {}", + msg.signature.data[41] ); assert_eq!( - msg.signature[41], 41, - "incorrect value for signature[41], expected 41, is {}", - msg.signature[41] + msg.signature.data[42], 42, + "incorrect value for signature.data[42], expected 42, is {}", + msg.signature.data[42] ); assert_eq!( - msg.signature[42], 42, - "incorrect value for signature[42], expected 42, is {}", - msg.signature[42] + msg.signature.data[43], 43, + "incorrect value for signature.data[43], expected 43, is {}", + msg.signature.data[43] ); assert_eq!( - msg.signature[43], 43, - "incorrect value for signature[43], expected 43, is {}", - msg.signature[43] + msg.signature.data[44], 44, + "incorrect value for signature.data[44], expected 44, is {}", + msg.signature.data[44] ); assert_eq!( - msg.signature[44], 44, - "incorrect value for signature[44], expected 44, is {}", - msg.signature[44] + msg.signature.data[45], 45, + "incorrect value for signature.data[45], expected 45, is {}", + msg.signature.data[45] ); assert_eq!( - msg.signature[45], 45, - "incorrect value for signature[45], expected 45, is {}", - msg.signature[45] + msg.signature.data[46], 46, + "incorrect value for signature.data[46], expected 46, is {}", + msg.signature.data[46] ); assert_eq!( - msg.signature[46], 46, - "incorrect value for signature[46], expected 46, is {}", - msg.signature[46] + msg.signature.data[47], 47, + "incorrect value for signature.data[47], expected 47, is {}", + msg.signature.data[47] ); assert_eq!( - msg.signature[47], 47, - "incorrect value for signature[47], expected 47, is {}", - msg.signature[47] + msg.signature.data[48], 48, + "incorrect value for signature.data[48], expected 48, is {}", + msg.signature.data[48] ); assert_eq!( - msg.signature[48], 48, - "incorrect value for signature[48], expected 48, is {}", - msg.signature[48] + msg.signature.data[49], 49, + "incorrect value for signature.data[49], expected 49, is {}", + msg.signature.data[49] ); assert_eq!( - msg.signature[49], 49, - "incorrect value for signature[49], expected 49, is {}", - msg.signature[49] + msg.signature.data[50], 50, + "incorrect value for signature.data[50], expected 50, is {}", + msg.signature.data[50] ); assert_eq!( - msg.signature[50], 50, - "incorrect value for signature[50], expected 50, is {}", - msg.signature[50] + msg.signature.data[51], 51, + "incorrect value for signature.data[51], expected 51, is {}", + msg.signature.data[51] ); assert_eq!( - msg.signature[51], 51, - "incorrect value for signature[51], expected 51, is {}", - msg.signature[51] + msg.signature.data[52], 52, + "incorrect value for signature.data[52], expected 52, is {}", + msg.signature.data[52] ); assert_eq!( - msg.signature[52], 52, - "incorrect value for signature[52], expected 52, is {}", - msg.signature[52] + msg.signature.data[53], 53, + "incorrect value for signature.data[53], expected 53, is {}", + msg.signature.data[53] ); assert_eq!( - msg.signature[53], 53, - "incorrect value for signature[53], expected 53, is {}", - msg.signature[53] + msg.signature.data[54], 54, + "incorrect value for signature.data[54], expected 54, is {}", + msg.signature.data[54] ); assert_eq!( - msg.signature[54], 54, - "incorrect value for signature[54], expected 54, is {}", - msg.signature[54] + msg.signature.data[55], 55, + "incorrect value for signature.data[55], expected 55, is {}", + msg.signature.data[55] ); assert_eq!( - msg.signature[55], 55, - "incorrect value for signature[55], expected 55, is {}", - msg.signature[55] + msg.signature.data[56], 56, + "incorrect value for signature.data[56], expected 56, is {}", + msg.signature.data[56] ); assert_eq!( - msg.signature[56], 56, - "incorrect value for signature[56], expected 56, is {}", - msg.signature[56] + msg.signature.data[57], 57, + "incorrect value for signature.data[57], expected 57, is {}", + msg.signature.data[57] ); assert_eq!( - msg.signature[57], 57, - "incorrect value for signature[57], expected 57, is {}", - msg.signature[57] + msg.signature.data[58], 58, + "incorrect value for signature.data[58], expected 58, is {}", + msg.signature.data[58] ); assert_eq!( - msg.signature[58], 58, - "incorrect value for signature[58], expected 58, is {}", - msg.signature[58] + msg.signature.data[59], 59, + "incorrect value for signature.data[59], expected 59, is {}", + msg.signature.data[59] ); assert_eq!( - msg.signature[59], 59, - "incorrect value for signature[59], expected 59, is {}", - msg.signature[59] + msg.signature.data[60], 60, + "incorrect value for signature.data[60], expected 60, is {}", + msg.signature.data[60] ); assert_eq!( - msg.signature[60], 60, - "incorrect value for signature[60], expected 60, is {}", - msg.signature[60] + msg.signature.data[61], 61, + "incorrect value for signature.data[61], expected 61, is {}", + msg.signature.data[61] ); assert_eq!( - msg.signature[61], 61, - "incorrect value for signature[61], expected 61, is {}", - msg.signature[61] + msg.signature.data[62], 62, + "incorrect value for signature.data[62], expected 62, is {}", + msg.signature.data[62] ); assert_eq!( - msg.signature[62], 62, - "incorrect value for signature[62], expected 62, is {}", - msg.signature[62] + msg.signature.data[63], 63, + "incorrect value for signature.data[63], expected 63, is {}", + msg.signature.data[63] ); assert_eq!( - msg.signature[63], 63, - "incorrect value for signature[63], expected 63, is {}", - msg.signature[63] + msg.signature.data[64], 64, + "incorrect value for signature.data[64], expected 64, is {}", + msg.signature.data[64] ); assert_eq!( - msg.signature[64], 64, - "incorrect value for signature[64], expected 64, is {}", - msg.signature[64] + msg.signature.data[65], 65, + "incorrect value for signature.data[65], expected 65, is {}", + msg.signature.data[65] ); assert_eq!( - msg.signature[65], 65, - "incorrect value for signature[65], expected 65, is {}", - msg.signature[65] + msg.signature.data[66], 66, + "incorrect value for signature.data[66], expected 66, is {}", + msg.signature.data[66] ); assert_eq!( - msg.signature[66], 66, - "incorrect value for signature[66], expected 66, is {}", - msg.signature[66] + msg.signature.data[67], 67, + "incorrect value for signature.data[67], expected 67, is {}", + msg.signature.data[67] ); assert_eq!( - msg.signature[67], 67, - "incorrect value for signature[67], expected 67, is {}", - msg.signature[67] + msg.signature.data[68], 68, + "incorrect value for signature.data[68], expected 68, is {}", + msg.signature.data[68] ); assert_eq!( - msg.signature[68], 68, - "incorrect value for signature[68], expected 68, is {}", - msg.signature[68] + msg.signature.data[69], 69, + "incorrect value for signature.data[69], expected 69, is {}", + msg.signature.data[69] ); assert_eq!( - msg.signature[69], 69, - "incorrect value for signature[69], expected 69, is {}", - msg.signature[69] + msg.signature.data[70], 70, + "incorrect value for signature.data[70], expected 70, is {}", + msg.signature.data[70] ); assert_eq!( - msg.signature[70], 70, - "incorrect value for signature[70], expected 70, is {}", - msg.signature[70] + msg.signature.data[71], 71, + "incorrect value for signature.data[71], expected 71, is {}", + msg.signature.data[71] ); assert_eq!( - msg.signature[71], 71, - "incorrect value for signature[71], expected 71, is {}", - msg.signature[71] + msg.signature.len, 72, + "incorrect value for signature.len, expected 72, is {}", + msg.signature.len ); assert_eq!( msg.signed_messages[0], 10, diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_a.rs similarity index 99% rename from rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep.rs rename to rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_a.rs index 79225fc719..f517d0588c 100644 --- a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep.rs +++ b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_a.rs @@ -9,7 +9,7 @@ // EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. -// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by generate.py. Do not modify by hand! +// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml by generate.py. Do not modify by hand! use crate::*; @@ -19,7 +19,7 @@ use crate::*; /// - SBP fields equates to that of the field /// - Payload is identical #[test] -fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep() { +fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep_a() { { let mut payload = Cursor::new(vec![ 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, @@ -45,7 +45,7 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep() { .expect("failed to parse message") }; match &sbp_msg { - sbp::messages::Sbp::MsgEcdsaSignatureDep(msg) => { + sbp::messages::Sbp::MsgEcdsaSignatureDepA(msg) => { assert_eq!( msg.message_type(), 0xC06, @@ -1333,7 +1333,7 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep() { msg.stream_counter ); } - _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDep"), + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepA"), }; let frame = sbp::to_vec(&sbp_msg).unwrap(); assert_eq!(frame, payload.into_inner()); @@ -1349,7 +1349,7 @@ fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep() { /// - Payload is identical #[test] #[cfg(feature = "json")] -fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep() { +fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep_a() { { let json_input = r#"{"preamble": 85, "msg_type": 3078, "sender": 66, "length": 255, "payload": "AAECAQIDBAABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcKFRc/jCWCahwopbNJsjx+ck5xG18DPmiRYBNcew5ambcJSFF2cHwQtkySczqQEWlCH4c2ZFS1ZwtYhZunrY9WnhSohI1mMjBHkzVXAWyKJIaLo1IrNJYMHm6ca3hbekWkqnQZXgUWGKKvJp1iLKAvYY4ISg2xD4Aag5pBqTeIfauhHYGXRKYzRi04T5VjKmWYJ1m0QDEGUKwgbQJ3XbAAITkiElV5iVNvOwdNBHWflCM9KUMuf0uu", "crc": 44129, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": [1, 2, 3, 4], "signature": [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7], "signed_messages": [10, 21, 23, 63, 140, 37, 130, 106, 28, 40, 165, 179, 73, 178, 60, 126, 114, 78, 113, 27, 95, 3, 62, 104, 145, 96, 19, 92, 123, 14, 90, 153, 183, 9, 72, 81, 118, 112, 124, 16, 182, 76, 146, 115, 58, 144, 17, 105, 66, 31, 135, 54, 100, 84, 181, 103, 11, 88, 133, 155, 167, 173, 143, 86, 158, 20, 168, 132, 141, 102, 50, 48, 71, 147, 53, 87, 1, 108, 138, 36, 134, 139, 163, 82, 43, 52, 150, 12, 30, 110, 156, 107, 120, 91, 122, 69, 164, 170, 116, 25, 94, 5, 22, 24, 162, 175, 38, 157, 98, 44, 160, 47, 97, 142, 8, 74, 13, 177, 15, 128, 26, 131, 154, 65, 169, 55, 136, 125, 171, 161, 29, 129, 151, 68, 166, 51, 70, 45, 56, 79, 149, 99, 42, 101, 152, 39, 89, 180, 64, 49, 6, 80, 172, 32, 109, 2, 119, 93, 176, 0, 33, 57, 34, 18, 85, 121, 137, 83, 111, 59, 7, 77, 4, 117, 159, 148, 35, 61, 41, 67, 46, 127, 75, 174]}"#.as_bytes(); @@ -1372,7 +1372,7 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep() { from_fields }; match &sbp_msg { - sbp::messages::Sbp::MsgEcdsaSignatureDep(msg) => { + sbp::messages::Sbp::MsgEcdsaSignatureDepA(msg) => { assert_eq!( msg.message_type(), 0xC06, @@ -2660,7 +2660,7 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep() { msg.stream_counter ); } - _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDep"), + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepA"), }; } } @@ -2668,14 +2668,14 @@ fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep() { /// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON /// /// Assumes: -/// - [`self::test_auto_check_sbp_signing_msg_ecdsa_signature_dep`] passes +/// - [`self::test_auto_check_sbp_signing_msg_ecdsa_signature_dep_a`] passes /// /// Asserts: /// - SBP fields equates to that of the field /// - Payload is identical #[test] #[cfg(feature = "json")] -fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep() { +fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep_a() { { let mut payload = Cursor::new(vec![ 85, 6, 12, 66, 0, 255, 0, 1, 2, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, @@ -2708,7 +2708,7 @@ fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep() { .unwrap(); // Reconstruct Sbp message from json fields, roundtrip - let sbp_msg = sbp::messages::Sbp::MsgEcdsaSignatureDep( + let sbp_msg = sbp::messages::Sbp::MsgEcdsaSignatureDepA( serde_json::from_str( std::str::from_utf8(json_buffer.as_slice()) .unwrap() @@ -2718,7 +2718,7 @@ fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep() { .unwrap(), ); match &sbp_msg { - sbp::messages::Sbp::MsgEcdsaSignatureDep(msg) => { + sbp::messages::Sbp::MsgEcdsaSignatureDepA(msg) => { assert_eq!( msg.message_type(), 0xC06, @@ -4006,7 +4006,7 @@ fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep() { msg.stream_counter ); } - _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDep"), + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepA"), }; // Check payload is still identical diff --git a/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_b.rs b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_b.rs new file mode 100644 index 0000000000..03551fee1b --- /dev/null +++ b/rust/sbp/tests/integration/auto_check_sbp_signing_msg_ecdsa_signature_dep_b.rs @@ -0,0 +1,1418 @@ +// +// Copyright (C) 2019-2021 Swift Navigation Inc. +// Contact: https://support.swiftnav.com +// +// This source is subject to the license found in the file 'LICENSE' which must +// be be distributed together with this source. All other rights reserved. +// +// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + +// This file was auto-generated from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml by generate.py. Do not modify by hand! + +use crate::*; + +/// Tests [`sbp::iter_messages`], from payload into SBP messages +/// +/// Asserts: +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +fn test_auto_check_sbp_signing_msg_ecdsa_signature_dep_b() { + { + let mut payload = Cursor::new(vec![ + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + ]); + + // Test the round trip payload parsing + let sbp_msg = { + let mut msgs = iter_messages(&mut payload); + msgs.next() + .expect("no message found") + .expect("failed to parse message") + }; + match &sbp_msg { + sbp::messages::Sbp::MsgEcdsaSignatureDepB(msg) => { + assert_eq!( + msg.message_type(), + 0xC07, + "Incorrect message type, expected 0xC07, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.certificate_id[0], 1, + "incorrect value for certificate_id[0], expected 1, is {}", + msg.certificate_id[0] + ); + assert_eq!( + msg.certificate_id[1], 2, + "incorrect value for certificate_id[1], expected 2, is {}", + msg.certificate_id[1] + ); + assert_eq!( + msg.certificate_id[2], 3, + "incorrect value for certificate_id[2], expected 3, is {}", + msg.certificate_id[2] + ); + assert_eq!( + msg.certificate_id[3], 4, + "incorrect value for certificate_id[3], expected 4, is {}", + msg.certificate_id[3] + ); + assert_eq!( + msg.flags, 0, + "incorrect value for flags, expected 0, is {}", + msg.flags + ); + assert_eq!( + msg.n_signature_bytes, 72, + "incorrect value for n_signature_bytes, expected 72, is {}", + msg.n_signature_bytes + ); + assert_eq!( + msg.on_demand_counter, 2, + "incorrect value for on_demand_counter, expected 2, is {}", + msg.on_demand_counter + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 8, + "incorrect value for signature[8], expected 8, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 9, + "incorrect value for signature[9], expected 9, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 10, + "incorrect value for signature[10], expected 10, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 11, + "incorrect value for signature[11], expected 11, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 12, + "incorrect value for signature[12], expected 12, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 13, + "incorrect value for signature[13], expected 13, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 14, + "incorrect value for signature[14], expected 14, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 15, + "incorrect value for signature[15], expected 15, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 16, + "incorrect value for signature[16], expected 16, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 17, + "incorrect value for signature[17], expected 17, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 18, + "incorrect value for signature[18], expected 18, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 19, + "incorrect value for signature[19], expected 19, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 20, + "incorrect value for signature[20], expected 20, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 21, + "incorrect value for signature[21], expected 21, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 22, + "incorrect value for signature[22], expected 22, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 23, + "incorrect value for signature[23], expected 23, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 24, + "incorrect value for signature[24], expected 24, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 25, + "incorrect value for signature[25], expected 25, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 26, + "incorrect value for signature[26], expected 26, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 27, + "incorrect value for signature[27], expected 27, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 28, + "incorrect value for signature[28], expected 28, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 29, + "incorrect value for signature[29], expected 29, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 30, + "incorrect value for signature[30], expected 30, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 31, + "incorrect value for signature[31], expected 31, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 32, + "incorrect value for signature[32], expected 32, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 33, + "incorrect value for signature[33], expected 33, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 34, + "incorrect value for signature[34], expected 34, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 35, + "incorrect value for signature[35], expected 35, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 36, + "incorrect value for signature[36], expected 36, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 37, + "incorrect value for signature[37], expected 37, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 38, + "incorrect value for signature[38], expected 38, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 39, + "incorrect value for signature[39], expected 39, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 40, + "incorrect value for signature[40], expected 40, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 41, + "incorrect value for signature[41], expected 41, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 42, + "incorrect value for signature[42], expected 42, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 43, + "incorrect value for signature[43], expected 43, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 44, + "incorrect value for signature[44], expected 44, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 45, + "incorrect value for signature[45], expected 45, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 46, + "incorrect value for signature[46], expected 46, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 47, + "incorrect value for signature[47], expected 47, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 48, + "incorrect value for signature[48], expected 48, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 49, + "incorrect value for signature[49], expected 49, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 50, + "incorrect value for signature[50], expected 50, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 51, + "incorrect value for signature[51], expected 51, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 52, + "incorrect value for signature[52], expected 52, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 53, + "incorrect value for signature[53], expected 53, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 54, + "incorrect value for signature[54], expected 54, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 55, + "incorrect value for signature[55], expected 55, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 56, + "incorrect value for signature[56], expected 56, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 57, + "incorrect value for signature[57], expected 57, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 58, + "incorrect value for signature[58], expected 58, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 59, + "incorrect value for signature[59], expected 59, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 60, + "incorrect value for signature[60], expected 60, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 61, + "incorrect value for signature[61], expected 61, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 62, + "incorrect value for signature[62], expected 62, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 63, + "incorrect value for signature[63], expected 63, is {}", + msg.signature[63] + ); + assert_eq!( + msg.signature[64], 64, + "incorrect value for signature[64], expected 64, is {}", + msg.signature[64] + ); + assert_eq!( + msg.signature[65], 65, + "incorrect value for signature[65], expected 65, is {}", + msg.signature[65] + ); + assert_eq!( + msg.signature[66], 66, + "incorrect value for signature[66], expected 66, is {}", + msg.signature[66] + ); + assert_eq!( + msg.signature[67], 67, + "incorrect value for signature[67], expected 67, is {}", + msg.signature[67] + ); + assert_eq!( + msg.signature[68], 68, + "incorrect value for signature[68], expected 68, is {}", + msg.signature[68] + ); + assert_eq!( + msg.signature[69], 69, + "incorrect value for signature[69], expected 69, is {}", + msg.signature[69] + ); + assert_eq!( + msg.signature[70], 70, + "incorrect value for signature[70], expected 70, is {}", + msg.signature[70] + ); + assert_eq!( + msg.signature[71], 71, + "incorrect value for signature[71], expected 71, is {}", + msg.signature[71] + ); + assert_eq!( + msg.signed_messages[0], 10, + "incorrect value for signed_messages[0], expected 10, is {}", + msg.signed_messages[0] + ); + assert_eq!( + msg.signed_messages[1], 21, + "incorrect value for signed_messages[1], expected 21, is {}", + msg.signed_messages[1] + ); + assert_eq!( + msg.signed_messages[2], 23, + "incorrect value for signed_messages[2], expected 23, is {}", + msg.signed_messages[2] + ); + assert_eq!( + msg.stream_counter, 1, + "incorrect value for stream_counter, expected 1, is {}", + msg.stream_counter + ); + } + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepB"), + }; + let frame = sbp::to_vec(&sbp_msg).unwrap(); + assert_eq!(frame, payload.into_inner()); + } +} + +/// Tests [`sbp::json::iter_messages`] for JSON payload -> SBP message +/// and [`sbp::json::iter_messages_from_fields`] for JSON fields -> SBP message. +/// +/// Asserts: +/// - SBP message constructed via payload is identical to from fields +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +#[cfg(feature = "json")] +fn test_json2sbp_auto_check_sbp_signing_msg_ecdsa_signature_dep_b() { + { + let json_input = r#"{"preamble": 85, "msg_type": 3079, "sender": 66, "length": 83, "payload": "AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc=", "crc": 40958, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": [1, 2, 3, 4], "n_signature_bytes": 72, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71], "signed_messages": [10, 21, 23]}"#.as_bytes(); + + let sbp_msg = { + // JSON to SBP message from payload + let mut iter = json2sbp_iter_msg(json_input); + let from_payload = iter + .next() + .expect("no message found") + .expect("failed to parse message"); + + // JSON to SBP message from fields + let mut iter = iter_messages_from_fields(json_input); + let from_fields = iter + .next() + .expect("no message found") + .expect("failed to parse message"); + + assert_eq!(from_fields, from_payload); + from_fields + }; + match &sbp_msg { + sbp::messages::Sbp::MsgEcdsaSignatureDepB(msg) => { + assert_eq!( + msg.message_type(), + 0xC07, + "Incorrect message type, expected 0xC07, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.certificate_id[0], 1, + "incorrect value for certificate_id[0], expected 1, is {}", + msg.certificate_id[0] + ); + assert_eq!( + msg.certificate_id[1], 2, + "incorrect value for certificate_id[1], expected 2, is {}", + msg.certificate_id[1] + ); + assert_eq!( + msg.certificate_id[2], 3, + "incorrect value for certificate_id[2], expected 3, is {}", + msg.certificate_id[2] + ); + assert_eq!( + msg.certificate_id[3], 4, + "incorrect value for certificate_id[3], expected 4, is {}", + msg.certificate_id[3] + ); + assert_eq!( + msg.flags, 0, + "incorrect value for flags, expected 0, is {}", + msg.flags + ); + assert_eq!( + msg.n_signature_bytes, 72, + "incorrect value for n_signature_bytes, expected 72, is {}", + msg.n_signature_bytes + ); + assert_eq!( + msg.on_demand_counter, 2, + "incorrect value for on_demand_counter, expected 2, is {}", + msg.on_demand_counter + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 8, + "incorrect value for signature[8], expected 8, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 9, + "incorrect value for signature[9], expected 9, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 10, + "incorrect value for signature[10], expected 10, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 11, + "incorrect value for signature[11], expected 11, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 12, + "incorrect value for signature[12], expected 12, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 13, + "incorrect value for signature[13], expected 13, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 14, + "incorrect value for signature[14], expected 14, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 15, + "incorrect value for signature[15], expected 15, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 16, + "incorrect value for signature[16], expected 16, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 17, + "incorrect value for signature[17], expected 17, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 18, + "incorrect value for signature[18], expected 18, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 19, + "incorrect value for signature[19], expected 19, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 20, + "incorrect value for signature[20], expected 20, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 21, + "incorrect value for signature[21], expected 21, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 22, + "incorrect value for signature[22], expected 22, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 23, + "incorrect value for signature[23], expected 23, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 24, + "incorrect value for signature[24], expected 24, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 25, + "incorrect value for signature[25], expected 25, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 26, + "incorrect value for signature[26], expected 26, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 27, + "incorrect value for signature[27], expected 27, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 28, + "incorrect value for signature[28], expected 28, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 29, + "incorrect value for signature[29], expected 29, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 30, + "incorrect value for signature[30], expected 30, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 31, + "incorrect value for signature[31], expected 31, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 32, + "incorrect value for signature[32], expected 32, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 33, + "incorrect value for signature[33], expected 33, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 34, + "incorrect value for signature[34], expected 34, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 35, + "incorrect value for signature[35], expected 35, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 36, + "incorrect value for signature[36], expected 36, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 37, + "incorrect value for signature[37], expected 37, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 38, + "incorrect value for signature[38], expected 38, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 39, + "incorrect value for signature[39], expected 39, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 40, + "incorrect value for signature[40], expected 40, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 41, + "incorrect value for signature[41], expected 41, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 42, + "incorrect value for signature[42], expected 42, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 43, + "incorrect value for signature[43], expected 43, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 44, + "incorrect value for signature[44], expected 44, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 45, + "incorrect value for signature[45], expected 45, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 46, + "incorrect value for signature[46], expected 46, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 47, + "incorrect value for signature[47], expected 47, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 48, + "incorrect value for signature[48], expected 48, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 49, + "incorrect value for signature[49], expected 49, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 50, + "incorrect value for signature[50], expected 50, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 51, + "incorrect value for signature[51], expected 51, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 52, + "incorrect value for signature[52], expected 52, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 53, + "incorrect value for signature[53], expected 53, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 54, + "incorrect value for signature[54], expected 54, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 55, + "incorrect value for signature[55], expected 55, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 56, + "incorrect value for signature[56], expected 56, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 57, + "incorrect value for signature[57], expected 57, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 58, + "incorrect value for signature[58], expected 58, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 59, + "incorrect value for signature[59], expected 59, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 60, + "incorrect value for signature[60], expected 60, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 61, + "incorrect value for signature[61], expected 61, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 62, + "incorrect value for signature[62], expected 62, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 63, + "incorrect value for signature[63], expected 63, is {}", + msg.signature[63] + ); + assert_eq!( + msg.signature[64], 64, + "incorrect value for signature[64], expected 64, is {}", + msg.signature[64] + ); + assert_eq!( + msg.signature[65], 65, + "incorrect value for signature[65], expected 65, is {}", + msg.signature[65] + ); + assert_eq!( + msg.signature[66], 66, + "incorrect value for signature[66], expected 66, is {}", + msg.signature[66] + ); + assert_eq!( + msg.signature[67], 67, + "incorrect value for signature[67], expected 67, is {}", + msg.signature[67] + ); + assert_eq!( + msg.signature[68], 68, + "incorrect value for signature[68], expected 68, is {}", + msg.signature[68] + ); + assert_eq!( + msg.signature[69], 69, + "incorrect value for signature[69], expected 69, is {}", + msg.signature[69] + ); + assert_eq!( + msg.signature[70], 70, + "incorrect value for signature[70], expected 70, is {}", + msg.signature[70] + ); + assert_eq!( + msg.signature[71], 71, + "incorrect value for signature[71], expected 71, is {}", + msg.signature[71] + ); + assert_eq!( + msg.signed_messages[0], 10, + "incorrect value for signed_messages[0], expected 10, is {}", + msg.signed_messages[0] + ); + assert_eq!( + msg.signed_messages[1], 21, + "incorrect value for signed_messages[1], expected 21, is {}", + msg.signed_messages[1] + ); + assert_eq!( + msg.signed_messages[2], 23, + "incorrect value for signed_messages[2], expected 23, is {}", + msg.signed_messages[2] + ); + assert_eq!( + msg.stream_counter, 1, + "incorrect value for stream_counter, expected 1, is {}", + msg.stream_counter + ); + } + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepB"), + }; + } +} + +/// Tests [`sbp::json::JsonEncoder`] for roundtrip SBP message -> JSON +/// +/// Assumes: +/// - [`self::test_auto_check_sbp_signing_msg_ecdsa_signature_dep_b`] passes +/// +/// Asserts: +/// - SBP fields equates to that of the field +/// - Payload is identical +#[test] +#[cfg(feature = "json")] +fn test_sbp2json_auto_check_sbp_signing_msg_ecdsa_signature_dep_b() { + { + let mut payload = Cursor::new(vec![ + 85, 7, 12, 66, 0, 83, 0, 1, 2, 1, 2, 3, 4, 72, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 10, 21, 23, 254, 159, + ]); + + // Construct sbp message + let sbp_msg = { + let mut msgs = iter_messages(&mut payload); + msgs.next() + .expect("no message found") + .expect("failed to parse message") + }; + + let mut json_buffer = vec![]; + // Populate json buffer, CompactFormatter + sbp::json::JsonEncoder::new(&mut json_buffer, sbp::json::CompactFormatter {}) + .send(&sbp_msg) + .unwrap(); + + // Reconstruct Sbp message from json fields, roundtrip + let sbp_msg = sbp::messages::Sbp::MsgEcdsaSignatureDepB( + serde_json::from_str( + std::str::from_utf8(json_buffer.as_slice()) + .unwrap() + .to_string() + .as_str(), + ) + .unwrap(), + ); + match &sbp_msg { + sbp::messages::Sbp::MsgEcdsaSignatureDepB(msg) => { + assert_eq!( + msg.message_type(), + 0xC07, + "Incorrect message type, expected 0xC07, is {}", + msg.message_type() + ); + let sender_id = msg.sender_id().unwrap(); + assert_eq!( + sender_id, 0x42, + "incorrect sender id, expected 0x42, is {sender_id}" + ); + assert_eq!( + msg.certificate_id[0], 1, + "incorrect value for certificate_id[0], expected 1, is {}", + msg.certificate_id[0] + ); + assert_eq!( + msg.certificate_id[1], 2, + "incorrect value for certificate_id[1], expected 2, is {}", + msg.certificate_id[1] + ); + assert_eq!( + msg.certificate_id[2], 3, + "incorrect value for certificate_id[2], expected 3, is {}", + msg.certificate_id[2] + ); + assert_eq!( + msg.certificate_id[3], 4, + "incorrect value for certificate_id[3], expected 4, is {}", + msg.certificate_id[3] + ); + assert_eq!( + msg.flags, 0, + "incorrect value for flags, expected 0, is {}", + msg.flags + ); + assert_eq!( + msg.n_signature_bytes, 72, + "incorrect value for n_signature_bytes, expected 72, is {}", + msg.n_signature_bytes + ); + assert_eq!( + msg.on_demand_counter, 2, + "incorrect value for on_demand_counter, expected 2, is {}", + msg.on_demand_counter + ); + assert_eq!( + msg.signature[0], 0, + "incorrect value for signature[0], expected 0, is {}", + msg.signature[0] + ); + assert_eq!( + msg.signature[1], 1, + "incorrect value for signature[1], expected 1, is {}", + msg.signature[1] + ); + assert_eq!( + msg.signature[2], 2, + "incorrect value for signature[2], expected 2, is {}", + msg.signature[2] + ); + assert_eq!( + msg.signature[3], 3, + "incorrect value for signature[3], expected 3, is {}", + msg.signature[3] + ); + assert_eq!( + msg.signature[4], 4, + "incorrect value for signature[4], expected 4, is {}", + msg.signature[4] + ); + assert_eq!( + msg.signature[5], 5, + "incorrect value for signature[5], expected 5, is {}", + msg.signature[5] + ); + assert_eq!( + msg.signature[6], 6, + "incorrect value for signature[6], expected 6, is {}", + msg.signature[6] + ); + assert_eq!( + msg.signature[7], 7, + "incorrect value for signature[7], expected 7, is {}", + msg.signature[7] + ); + assert_eq!( + msg.signature[8], 8, + "incorrect value for signature[8], expected 8, is {}", + msg.signature[8] + ); + assert_eq!( + msg.signature[9], 9, + "incorrect value for signature[9], expected 9, is {}", + msg.signature[9] + ); + assert_eq!( + msg.signature[10], 10, + "incorrect value for signature[10], expected 10, is {}", + msg.signature[10] + ); + assert_eq!( + msg.signature[11], 11, + "incorrect value for signature[11], expected 11, is {}", + msg.signature[11] + ); + assert_eq!( + msg.signature[12], 12, + "incorrect value for signature[12], expected 12, is {}", + msg.signature[12] + ); + assert_eq!( + msg.signature[13], 13, + "incorrect value for signature[13], expected 13, is {}", + msg.signature[13] + ); + assert_eq!( + msg.signature[14], 14, + "incorrect value for signature[14], expected 14, is {}", + msg.signature[14] + ); + assert_eq!( + msg.signature[15], 15, + "incorrect value for signature[15], expected 15, is {}", + msg.signature[15] + ); + assert_eq!( + msg.signature[16], 16, + "incorrect value for signature[16], expected 16, is {}", + msg.signature[16] + ); + assert_eq!( + msg.signature[17], 17, + "incorrect value for signature[17], expected 17, is {}", + msg.signature[17] + ); + assert_eq!( + msg.signature[18], 18, + "incorrect value for signature[18], expected 18, is {}", + msg.signature[18] + ); + assert_eq!( + msg.signature[19], 19, + "incorrect value for signature[19], expected 19, is {}", + msg.signature[19] + ); + assert_eq!( + msg.signature[20], 20, + "incorrect value for signature[20], expected 20, is {}", + msg.signature[20] + ); + assert_eq!( + msg.signature[21], 21, + "incorrect value for signature[21], expected 21, is {}", + msg.signature[21] + ); + assert_eq!( + msg.signature[22], 22, + "incorrect value for signature[22], expected 22, is {}", + msg.signature[22] + ); + assert_eq!( + msg.signature[23], 23, + "incorrect value for signature[23], expected 23, is {}", + msg.signature[23] + ); + assert_eq!( + msg.signature[24], 24, + "incorrect value for signature[24], expected 24, is {}", + msg.signature[24] + ); + assert_eq!( + msg.signature[25], 25, + "incorrect value for signature[25], expected 25, is {}", + msg.signature[25] + ); + assert_eq!( + msg.signature[26], 26, + "incorrect value for signature[26], expected 26, is {}", + msg.signature[26] + ); + assert_eq!( + msg.signature[27], 27, + "incorrect value for signature[27], expected 27, is {}", + msg.signature[27] + ); + assert_eq!( + msg.signature[28], 28, + "incorrect value for signature[28], expected 28, is {}", + msg.signature[28] + ); + assert_eq!( + msg.signature[29], 29, + "incorrect value for signature[29], expected 29, is {}", + msg.signature[29] + ); + assert_eq!( + msg.signature[30], 30, + "incorrect value for signature[30], expected 30, is {}", + msg.signature[30] + ); + assert_eq!( + msg.signature[31], 31, + "incorrect value for signature[31], expected 31, is {}", + msg.signature[31] + ); + assert_eq!( + msg.signature[32], 32, + "incorrect value for signature[32], expected 32, is {}", + msg.signature[32] + ); + assert_eq!( + msg.signature[33], 33, + "incorrect value for signature[33], expected 33, is {}", + msg.signature[33] + ); + assert_eq!( + msg.signature[34], 34, + "incorrect value for signature[34], expected 34, is {}", + msg.signature[34] + ); + assert_eq!( + msg.signature[35], 35, + "incorrect value for signature[35], expected 35, is {}", + msg.signature[35] + ); + assert_eq!( + msg.signature[36], 36, + "incorrect value for signature[36], expected 36, is {}", + msg.signature[36] + ); + assert_eq!( + msg.signature[37], 37, + "incorrect value for signature[37], expected 37, is {}", + msg.signature[37] + ); + assert_eq!( + msg.signature[38], 38, + "incorrect value for signature[38], expected 38, is {}", + msg.signature[38] + ); + assert_eq!( + msg.signature[39], 39, + "incorrect value for signature[39], expected 39, is {}", + msg.signature[39] + ); + assert_eq!( + msg.signature[40], 40, + "incorrect value for signature[40], expected 40, is {}", + msg.signature[40] + ); + assert_eq!( + msg.signature[41], 41, + "incorrect value for signature[41], expected 41, is {}", + msg.signature[41] + ); + assert_eq!( + msg.signature[42], 42, + "incorrect value for signature[42], expected 42, is {}", + msg.signature[42] + ); + assert_eq!( + msg.signature[43], 43, + "incorrect value for signature[43], expected 43, is {}", + msg.signature[43] + ); + assert_eq!( + msg.signature[44], 44, + "incorrect value for signature[44], expected 44, is {}", + msg.signature[44] + ); + assert_eq!( + msg.signature[45], 45, + "incorrect value for signature[45], expected 45, is {}", + msg.signature[45] + ); + assert_eq!( + msg.signature[46], 46, + "incorrect value for signature[46], expected 46, is {}", + msg.signature[46] + ); + assert_eq!( + msg.signature[47], 47, + "incorrect value for signature[47], expected 47, is {}", + msg.signature[47] + ); + assert_eq!( + msg.signature[48], 48, + "incorrect value for signature[48], expected 48, is {}", + msg.signature[48] + ); + assert_eq!( + msg.signature[49], 49, + "incorrect value for signature[49], expected 49, is {}", + msg.signature[49] + ); + assert_eq!( + msg.signature[50], 50, + "incorrect value for signature[50], expected 50, is {}", + msg.signature[50] + ); + assert_eq!( + msg.signature[51], 51, + "incorrect value for signature[51], expected 51, is {}", + msg.signature[51] + ); + assert_eq!( + msg.signature[52], 52, + "incorrect value for signature[52], expected 52, is {}", + msg.signature[52] + ); + assert_eq!( + msg.signature[53], 53, + "incorrect value for signature[53], expected 53, is {}", + msg.signature[53] + ); + assert_eq!( + msg.signature[54], 54, + "incorrect value for signature[54], expected 54, is {}", + msg.signature[54] + ); + assert_eq!( + msg.signature[55], 55, + "incorrect value for signature[55], expected 55, is {}", + msg.signature[55] + ); + assert_eq!( + msg.signature[56], 56, + "incorrect value for signature[56], expected 56, is {}", + msg.signature[56] + ); + assert_eq!( + msg.signature[57], 57, + "incorrect value for signature[57], expected 57, is {}", + msg.signature[57] + ); + assert_eq!( + msg.signature[58], 58, + "incorrect value for signature[58], expected 58, is {}", + msg.signature[58] + ); + assert_eq!( + msg.signature[59], 59, + "incorrect value for signature[59], expected 59, is {}", + msg.signature[59] + ); + assert_eq!( + msg.signature[60], 60, + "incorrect value for signature[60], expected 60, is {}", + msg.signature[60] + ); + assert_eq!( + msg.signature[61], 61, + "incorrect value for signature[61], expected 61, is {}", + msg.signature[61] + ); + assert_eq!( + msg.signature[62], 62, + "incorrect value for signature[62], expected 62, is {}", + msg.signature[62] + ); + assert_eq!( + msg.signature[63], 63, + "incorrect value for signature[63], expected 63, is {}", + msg.signature[63] + ); + assert_eq!( + msg.signature[64], 64, + "incorrect value for signature[64], expected 64, is {}", + msg.signature[64] + ); + assert_eq!( + msg.signature[65], 65, + "incorrect value for signature[65], expected 65, is {}", + msg.signature[65] + ); + assert_eq!( + msg.signature[66], 66, + "incorrect value for signature[66], expected 66, is {}", + msg.signature[66] + ); + assert_eq!( + msg.signature[67], 67, + "incorrect value for signature[67], expected 67, is {}", + msg.signature[67] + ); + assert_eq!( + msg.signature[68], 68, + "incorrect value for signature[68], expected 68, is {}", + msg.signature[68] + ); + assert_eq!( + msg.signature[69], 69, + "incorrect value for signature[69], expected 69, is {}", + msg.signature[69] + ); + assert_eq!( + msg.signature[70], 70, + "incorrect value for signature[70], expected 70, is {}", + msg.signature[70] + ); + assert_eq!( + msg.signature[71], 71, + "incorrect value for signature[71], expected 71, is {}", + msg.signature[71] + ); + assert_eq!( + msg.signed_messages[0], 10, + "incorrect value for signed_messages[0], expected 10, is {}", + msg.signed_messages[0] + ); + assert_eq!( + msg.signed_messages[1], 21, + "incorrect value for signed_messages[1], expected 21, is {}", + msg.signed_messages[1] + ); + assert_eq!( + msg.signed_messages[2], 23, + "incorrect value for signed_messages[2], expected 23, is {}", + msg.signed_messages[2] + ); + assert_eq!( + msg.stream_counter, 1, + "incorrect value for stream_counter, expected 1, is {}", + msg.stream_counter + ); + } + _ => panic!("Invalid message type! Expected a MsgEcdsaSignatureDepB"), + }; + + // Check payload is still identical + let frame = sbp::to_vec(&sbp_msg).unwrap(); + assert_eq!(frame, payload.into_inner()); + } +} diff --git a/rust/sbp/tests/integration/main.rs b/rust/sbp/tests/integration/main.rs index 76d771e5b1..e6cc01ca47 100644 --- a/rust/sbp/tests/integration/main.rs +++ b/rust/sbp/tests/integration/main.rs @@ -95,9 +95,11 @@ mod auto_check_sbp_sbas_msg_sbas_raw; mod auto_check_sbp_settings_msg_settings_read_by_index_done; mod auto_check_sbp_settings_msg_settings_read_by_index_resp; mod auto_check_sbp_signing_msg_certificate_chain; +mod auto_check_sbp_signing_msg_certificate_chain_dep; mod auto_check_sbp_signing_msg_ecdsa_certificate; mod auto_check_sbp_signing_msg_ecdsa_signature; -mod auto_check_sbp_signing_msg_ecdsa_signature_dep; +mod auto_check_sbp_signing_msg_ecdsa_signature_dep_a; +mod auto_check_sbp_signing_msg_ecdsa_signature_dep_b; mod auto_check_sbp_signing_msg_ed25519_certificate_dep; mod auto_check_sbp_signing_msg_ed25519_signature_dep_a; mod auto_check_sbp_signing_msg_ed25519_signature_dep_b; diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml index 1a46386425..ae5eb83a96 100644 --- a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChain.yaml @@ -1,5 +1,5 @@ description: Unit tests for swiftnav.sbp.signing MsgCertificateChain -generated_on: '2023-03-01 17:44:45.306890' +generated_on: '2023-03-17 19:23:29.517163' package: sbp.signing tests: - msg: @@ -76,88 +76,100 @@ tests: - 18 - 19 signature: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 + data: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 22 + - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 + - 30 + - 31 + - 32 + - 33 + - 34 + - 35 + - 36 + - 37 + - 38 + - 39 + - 40 + - 41 + - 42 + - 43 + - 44 + - 45 + - 46 + - 47 + - 48 + - 49 + - 50 + - 51 + - 52 + - 53 + - 54 + - 55 + - 56 + - 57 + - 58 + - 59 + - 60 + - 61 + - 62 + - 63 + - 64 + - 65 + - 66 + - 67 + - 68 + - 69 + - 70 + - 71 + len: 72 module: sbp.signing name: MsgCertificateChain - msg_type: '0xC05' - raw_json: '{"preamble": 85, "msg_type": 3077, "sender": 66, "length": 135, "payload": - "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH", - "crc": 25712, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + msg_type: '0xC09' + raw_json: '{"preamble": 85, "msg_type": 3081, "sender": 66, "length": 144, "payload": + "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwdIAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH", + "crc": 57571, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "intermediate_certificate": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "corrections_certificate": [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "expiration": {"year": 2024, "month": 3, "day": 30, "hours": 12, "minutes": 34, "seconds": 59, - "ns": 123456789}, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, - 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, - 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]}' - raw_packet: VQUMQgCHAAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHcGQ= + "ns": 123456789}, "signature": {"len": 72, "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71]}}' + raw_packet: VQkMQgCQAAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwdIAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH4+A= sbp: - crc: '0x6470' - length: 135 - msg_type: '0xC05' - payload: AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH + crc: '0xE0E3' + length: 144 + msg_type: '0xC09' + payload: AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwdIAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZH preamble: '0x55' sender: '0x42' diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml new file mode 100644 index 0000000000..0abcf68bbb --- /dev/null +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgCertificateChainDep.yaml @@ -0,0 +1,163 @@ +description: Unit tests for swiftnav.sbp.signing MsgCertificateChainDep +generated_on: '2023-03-01 17:44:45.306890' +package: sbp.signing +tests: +- msg: + fields: + corrections_certificate: + - 20 + - 21 + - 22 + - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + expiration: + day: 30 + hours: 12 + minutes: 34 + month: 3 + ns: 123456789 + seconds: 59 + year: 2024 + intermediate_certificate: + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + root_certificate: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + signature: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + module: sbp.signing + name: MsgCertificateChainDep + msg_type: '0xC05' + raw_json: '{"preamble": 85, "msg_type": 3077, "sender": 66, "length": 135, "payload": + "AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH", + "crc": 25712, "root_certificate": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19], "intermediate_certificate": [10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "corrections_certificate": [20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19], "expiration": + {"year": 2024, "month": 3, "day": 30, "hours": 12, "minutes": 34, "seconds": 59, + "ns": 123456789}, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, + 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, + 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7]}' + raw_packet: VQUMQgCHAAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHcGQ= + sbp: + crc: '0x6470' + length: 135 + msg_type: '0xC05' + payload: AAECAwQFBgcICQoLDA0ODxAREhMKCwwNDg8QERITAAECAwQFBgcICRQVFhcYGRobHB0KCwwNDg8QERIT6AcDHgwiOxXNWwcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYH + preamble: '0x55' + sender: '0x42' diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml index c97c585a62..1bc8c8fe94 100644 --- a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml @@ -1,10 +1,8 @@ description: Unit tests for swiftnav.sbp.signing MsgEcdsaSignature -generated_on: '2023-03-16 22:03:42.945683' +generated_on: '2023-03-17 19:24:46.292191' package: sbp.signing tests: - msg: - c_decoded_fields: - n_signed_messages: 3 fields: certificate_id: - 1 @@ -12,81 +10,82 @@ tests: - 3 - 4 flags: 0 - n_signature_bytes: 72 on_demand_counter: 2 signature: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - 10 - - 11 - - 12 - - 13 - - 14 - - 15 - - 16 - - 17 - - 18 - - 19 - - 20 - - 21 - - 22 - - 23 - - 24 - - 25 - - 26 - - 27 - - 28 - - 29 - - 30 - - 31 - - 32 - - 33 - - 34 - - 35 - - 36 - - 37 - - 38 - - 39 - - 40 - - 41 - - 42 - - 43 - - 44 - - 45 - - 46 - - 47 - - 48 - - 49 - - 50 - - 51 - - 52 - - 53 - - 54 - - 55 - - 56 - - 57 - - 58 - - 59 - - 60 - - 61 - - 62 - - 63 - - 64 - - 65 - - 66 - - 67 - - 68 - - 69 - - 70 - - 71 + data: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 22 + - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 + - 30 + - 31 + - 32 + - 33 + - 34 + - 35 + - 36 + - 37 + - 38 + - 39 + - 40 + - 41 + - 42 + - 43 + - 44 + - 45 + - 46 + - 47 + - 48 + - 49 + - 50 + - 51 + - 52 + - 53 + - 54 + - 55 + - 56 + - 57 + - 58 + - 59 + - 60 + - 61 + - 62 + - 63 + - 64 + - 65 + - 66 + - 67 + - 68 + - 69 + - 70 + - 71 + len: 72 signed_messages: - 10 - 21 @@ -94,20 +93,20 @@ tests: stream_counter: 1 module: sbp.signing name: MsgEcdsaSignature - msg_type: '0xC07' - raw_json: '{"preamble": 85, "msg_type": 3079, "sender": 66, "length": 83, "payload": + msg_type: '0xC08' + raw_json: '{"preamble": 85, "msg_type": 3080, "sender": 66, "length": 83, "payload": "AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc=", - "crc": 40958, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": - [1, 2, 3, 4], "n_signature_bytes": 72, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71], "signed_messages": [10, 21, 23]}' - raw_packet: VQcMQgBTAAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRf+nw== + "crc": 33768, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": + [1, 2, 3, 4], "signature": {"len": 72, "data": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71]}, "signed_messages": [10, 21, 23]}' + raw_packet: VQgMQgBTAAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRfogw== sbp: - crc: '0x9FFE' + crc: '0x83E8' length: 83 - msg_type: '0xC07' + msg_type: '0xC08' payload: AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc= preamble: '0x55' sender: '0x42' diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml similarity index 99% rename from spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml rename to spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml index 2a8a48205f..894d2b44ff 100644 --- a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepA.yaml @@ -1,4 +1,4 @@ -description: Unit tests for swiftnav.sbp.signing MsgEcdsaSignatureDep +description: Unit tests for swiftnav.sbp.signing MsgEcdsaSignatureDepA generated_on: '2023-03-01 18:56:51.200360' package: sbp.signing tests: @@ -265,7 +265,7 @@ tests: - 174 stream_counter: 1 module: sbp.signing - name: MsgEcdsaSignatureDep + name: MsgEcdsaSignatureDepA msg_type: '0xC06' raw_json: '{"preamble": 85, "msg_type": 3078, "sender": 66, "length": 255, "payload": "AAECAQIDBAABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcAAQIDBAUGBwABAgMEBQYHAAECAwQFBgcKFRc/jCWCahwopbNJsjx+ck5xG18DPmiRYBNcew5ambcJSFF2cHwQtkySczqQEWlCH4c2ZFS1ZwtYhZunrY9WnhSohI1mMjBHkzVXAWyKJIaLo1IrNJYMHm6ca3hbekWkqnQZXgUWGKKvJp1iLKAvYY4ISg2xD4Aag5pBqTeIfauhHYGXRKYzRi04T5VjKmWYJ1m0QDEGUKwgbQJ3XbAAITkiElV5iVNvOwdNBHWflCM9KUMuf0uu", diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml new file mode 100644 index 0000000000..e4c6dd21cc --- /dev/null +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDepB.yaml @@ -0,0 +1,113 @@ +description: Unit tests for swiftnav.sbp.signing MsgEcdsaSignatureDepB +generated_on: '2023-03-16 22:03:42.945683' +package: sbp.signing +tests: +- msg: + c_decoded_fields: + n_signed_messages: 3 + fields: + certificate_id: + - 1 + - 2 + - 3 + - 4 + flags: 0 + n_signature_bytes: 72 + on_demand_counter: 2 + signature: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - 10 + - 11 + - 12 + - 13 + - 14 + - 15 + - 16 + - 17 + - 18 + - 19 + - 20 + - 21 + - 22 + - 23 + - 24 + - 25 + - 26 + - 27 + - 28 + - 29 + - 30 + - 31 + - 32 + - 33 + - 34 + - 35 + - 36 + - 37 + - 38 + - 39 + - 40 + - 41 + - 42 + - 43 + - 44 + - 45 + - 46 + - 47 + - 48 + - 49 + - 50 + - 51 + - 52 + - 53 + - 54 + - 55 + - 56 + - 57 + - 58 + - 59 + - 60 + - 61 + - 62 + - 63 + - 64 + - 65 + - 66 + - 67 + - 68 + - 69 + - 70 + - 71 + signed_messages: + - 10 + - 21 + - 23 + stream_counter: 1 + module: sbp.signing + name: MsgEcdsaSignatureDepB + msg_type: '0xC07' + raw_json: '{"preamble": 85, "msg_type": 3079, "sender": 66, "length": 83, "payload": + "AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc=", + "crc": 40958, "flags": 0, "stream_counter": 1, "on_demand_counter": 2, "certificate_id": + [1, 2, 3, 4], "n_signature_bytes": 72, "signature": [0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71], "signed_messages": [10, 21, 23]}' + raw_packet: VQcMQgBTAAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRf+nw== + sbp: + crc: '0x9FFE' + length: 83 + msg_type: '0xC07' + payload: AAECAQIDBEgAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkcKFRc= + preamble: '0x55' + sender: '0x42' diff --git a/spec/yaml/swiftnav/sbp/signing.yaml b/spec/yaml/swiftnav/sbp/signing.yaml index e01addf960..fe057c146a 100644 --- a/spec/yaml/swiftnav/sbp/signing.yaml +++ b/spec/yaml/swiftnav/sbp/signing.yaml @@ -51,6 +51,23 @@ definitions: desc: nanoseconds of second (range 0-999999999) + - ECDSASignature: + short_desc: ECDSA signature + fields: + - len: + type: u8 + desc: > + Number of bytes to use of the signature field. The DER encoded + signature has a maximum size of 72 bytes but can vary between 70 + and 72 bytes in length. + - data: + type: array + fill: u8 + size: 72 + desc: > + DER encoded ECDSA signature for the messages using SHA-256 as the digest + algorithm. + - MSG_ECDSA_CERTIFICATE: id: 0x0C04 short_desc: An ECDSA certificate split over multiple messages @@ -84,6 +101,40 @@ definitions: desc: DER encoded x.509 ECDSA certificate bytes - MSG_CERTIFICATE_CHAIN: + id: 0x0C09 + short_desc: The certificate chain + fields: + - root_certificate: + type: array + fill: u8 + size: 20 + desc: SHA-1 fingerprint of the root certificate + - intermediate_certificate: + type: array + fill: u8 + size: 20 + desc: SHA-1 fingerprint of the intermediate certificate + - corrections_certificate: + type: array + fill: u8 + size: 20 + desc: SHA-1 fingerprint of the corrections certificate + - expiration: + type: UtcTime + desc: > + The certificate chain comprised of three fingerprints: root + certificate, intermediate certificate and corrections certificate. + - signature: + type: ECDSASignature + desc: > + Signature (created by the root certificate) over the + concatenation of the SBP payload bytes preceding this field. That + is, the concatenation of `root_certificate`, + `intermediate_certificate`, `corrections_certificate` and + `expiration`. This certificate chain (allow list) can also be + validated by fetching it from `http(s)://certs.swiftnav.com/chain`. + + - MSG_CERTIFICATE_CHAIN_DEP: id: 0x0C05 short_desc: The certificate chain fields: @@ -120,6 +171,56 @@ definitions: validated by fetching it from `http(s)://certs.swiftnav.com/chain`. - MSG_ECDSA_SIGNATURE: + id: 0x0C08 + short_desc: An ECDSA signature + desc: > + An ECDSA-256 signature using SHA-256 as the message digest algorithm. + fields: + - flags: + type: u8 + desc: Describes the format of the `signed\_messages` field below. + fields: + - 0-1: + desc: CRC type + values: + - 0: 24-bit CRCs from RTCM framing + - 1: 16-bit CRCs from SBP framing + - stream_counter: + type: u8 + desc: > + Signature message counter. Zero indexed and incremented with each + signature message. The counter will not increment if this message + was in response to an on demand request. The counter will roll + over after 256 messages. Upon connection, the value of the counter + may not initially be zero. + - on_demand_counter: + type: u8 + desc: > + On demand message counter. Zero indexed and incremented with each + signature message sent in response to an on demand message. The + counter will roll over after 256 messages. Upon connection, the + value of the counter may not initially be zero. + - certificate_id: + type: array + fill: u8 + size: 4 + desc: The last 4 bytes of the certificate's SHA-1 fingerprint + - signature: + type: ECDSASignature + desc: > + Signature over the frames of this message group. + - signed_messages: + type: array + fill: u8 + desc: > + CRCs of the messages covered by this signature. For Skylark, + which delivers SBP messages wrapped in Swift's proprietary RTCM + message, these are the 24-bit CRCs from the RTCM message framing. + For SBP only streams, this will be 16-bit CRCs from the SBP + framing. See the `flags` field to determine the type of CRCs + covered. + + - MSG_ECDSA_SIGNATURE_DEP_B: id: 0x0C07 short_desc: An ECDSA signature desc: > @@ -159,7 +260,7 @@ definitions: desc: > Number of bytes to use of the signature field. The DER encoded signature has a maximum size of 72 bytes but can vary between 70 - and 72 bytes in length. + and 72 bytes in length. - signature: type: array fill: u8 @@ -178,7 +279,7 @@ definitions: framing. See the `flags` field to determine the type of CRCs covered. - - MSG_ECDSA_SIGNATURE_DEP: + - MSG_ECDSA_SIGNATURE_DEP_A: id: 0x0C06 short_desc: An ECDSA signature desc: > From 89ee37292889ea3b1223e08007d6c8d0ccdd27dd Mon Sep 17 00:00:00 2001 From: notoriaga Date: Fri, 17 Mar 2023 13:39:05 -0700 Subject: [PATCH 2/5] remove old java test --- ..._sbp_signing_MsgEcdsaSignatureDepTest.java | 2848 ----------------- 1 file changed, 2848 deletions(-) delete mode 100644 java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepTest.java diff --git a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepTest.java b/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepTest.java deleted file mode 100644 index f057f7be02..0000000000 --- a/java/test/auto_check_sbp_signing_MsgEcdsaSignatureDepTest.java +++ /dev/null @@ -1,2848 +0,0 @@ -/* Copyright (C) 2015-2022 Swift Navigation Inc. - * Contact: https://support.swiftnav.com - * - * This source is subject to the license found in the file 'LICENSE' which must - * be be distributed together with this source. All other rights reserved. - * - * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. - */ -package com.swiftnav.sbp.test; - -// This file was auto-generated from -// spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignatureDep.yaml by generate.py. Do not modify -// by hand! - - -import com.swiftnav.sbp.SBPMessage; -import com.swiftnav.sbp.signing.MsgEcdsaSignatureDep; -import java.math.BigInteger; -import org.json.JSONObject; -import org.junit.Test; - -public class auto_check_sbp_signing_MsgEcdsaSignatureDepTest { - - public static boolean debug = false; - private static final double DELTA = 1e-15; - - @Test - public void test1() throws Throwable { - if (debug) - System.out.format("%n%s%n", "auto_check_sbp_signing_MsgEcdsaSignatureDepTest.test1"); - byte[] payload = - new byte[] { - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 0, - (byte) 1, - (byte) 2, - (byte) 3, - (byte) 4, - (byte) 5, - (byte) 6, - (byte) 7, - (byte) 10, - (byte) 21, - (byte) 23, - (byte) 63, - (byte) 140, - (byte) 37, - (byte) 130, - (byte) 106, - (byte) 28, - (byte) 40, - (byte) 165, - (byte) 179, - (byte) 73, - (byte) 178, - (byte) 60, - (byte) 126, - (byte) 114, - (byte) 78, - (byte) 113, - (byte) 27, - (byte) 95, - (byte) 3, - (byte) 62, - (byte) 104, - (byte) 145, - (byte) 96, - (byte) 19, - (byte) 92, - (byte) 123, - (byte) 14, - (byte) 90, - (byte) 153, - (byte) 183, - (byte) 9, - (byte) 72, - (byte) 81, - (byte) 118, - (byte) 112, - (byte) 124, - (byte) 16, - (byte) 182, - (byte) 76, - (byte) 146, - (byte) 115, - (byte) 58, - (byte) 144, - (byte) 17, - (byte) 105, - (byte) 66, - (byte) 31, - (byte) 135, - (byte) 54, - (byte) 100, - (byte) 84, - (byte) 181, - (byte) 103, - (byte) 11, - (byte) 88, - (byte) 133, - (byte) 155, - (byte) 167, - (byte) 173, - (byte) 143, - (byte) 86, - (byte) 158, - (byte) 20, - (byte) 168, - (byte) 132, - (byte) 141, - (byte) 102, - (byte) 50, - (byte) 48, - (byte) 71, - (byte) 147, - (byte) 53, - (byte) 87, - (byte) 1, - (byte) 108, - (byte) 138, - (byte) 36, - (byte) 134, - (byte) 139, - (byte) 163, - (byte) 82, - (byte) 43, - (byte) 52, - (byte) 150, - (byte) 12, - (byte) 30, - (byte) 110, - (byte) 156, - (byte) 107, - (byte) 120, - (byte) 91, - (byte) 122, - (byte) 69, - (byte) 164, - (byte) 170, - (byte) 116, - (byte) 25, - (byte) 94, - (byte) 5, - (byte) 22, - (byte) 24, - (byte) 162, - (byte) 175, - (byte) 38, - (byte) 157, - (byte) 98, - (byte) 44, - (byte) 160, - (byte) 47, - (byte) 97, - (byte) 142, - (byte) 8, - (byte) 74, - (byte) 13, - (byte) 177, - (byte) 15, - (byte) 128, - (byte) 26, - (byte) 131, - (byte) 154, - (byte) 65, - (byte) 169, - (byte) 55, - (byte) 136, - (byte) 125, - (byte) 171, - (byte) 161, - (byte) 29, - (byte) 129, - (byte) 151, - (byte) 68, - (byte) 166, - (byte) 51, - (byte) 70, - (byte) 45, - (byte) 56, - (byte) 79, - (byte) 149, - (byte) 99, - (byte) 42, - (byte) 101, - (byte) 152, - (byte) 39, - (byte) 89, - (byte) 180, - (byte) 64, - (byte) 49, - (byte) 6, - (byte) 80, - (byte) 172, - (byte) 32, - (byte) 109, - (byte) 2, - (byte) 119, - (byte) 93, - (byte) 176, - (byte) 0, - (byte) 33, - (byte) 57, - (byte) 34, - (byte) 18, - (byte) 85, - (byte) 121, - (byte) 137, - (byte) 83, - (byte) 111, - (byte) 59, - (byte) 7, - (byte) 77, - (byte) 4, - (byte) 117, - (byte) 159, - (byte) 148, - (byte) 35, - (byte) 61, - (byte) 41, - (byte) 67, - (byte) 46, - (byte) 127, - (byte) 75, - (byte) 174, - }; - SBPMessage sbp = new SBPMessage(0x42, 0xC06, payload); - MsgEcdsaSignatureDep msg = new MsgEcdsaSignatureDep(sbp); - JSONObject json = msg.toJSON(); - Number value; - Number expected; - value = msg.certificate_id[0]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.certificate_id[0] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.certificate_id[1]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.certificate_id[1] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.certificate_id[2]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.certificate_id[2] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.certificate_id[3]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.certificate_id[3] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.flags; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.flags + "' != '" + 0 + "'", value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.on_demand_counter; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.on_demand_counter + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[0]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[0] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[1]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[1] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[2]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[2] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[3]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[3] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[4]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[4] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[5]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[5] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[6]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[6] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[7]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[7] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[8]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[8] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[9]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[9] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[10]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[10] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[11]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[11] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[12]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[12] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[13]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[13] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[14]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[14] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[15]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[15] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[16]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[16] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[17]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[17] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[18]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[18] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[19]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[19] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[20]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[20] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[21]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[21] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[22]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[22] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[23]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[23] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[24]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[24] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[25]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[25] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[26]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[26] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[27]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[27] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[28]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[28] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[29]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[29] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[30]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[30] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[31]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[31] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[32]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[32] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[33]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[33] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[34]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[34] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[35]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[35] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[36]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[36] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[37]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[37] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[38]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[38] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[39]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[39] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[40]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[40] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[41]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[41] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[42]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[42] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[43]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[43] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[44]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[44] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[45]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[45] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[46]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[46] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[47]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[47] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[48]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[48] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[49]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[49] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[50]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[50] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[51]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[51] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[52]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[52] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[53]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[53] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[54]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[54] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[55]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[55] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[56]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[56] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[57]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[57] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[58]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[58] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[59]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[59] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[60]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[60] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[61]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[61] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[62]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[62] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signature[63]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signature[63] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[0]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[0] + "' != '" + 10 + "'", - value.equals(BigInteger.valueOf(10L))); - } else { - value = value.longValue(); - expected = 10L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[1]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[1] + "' != '" + 21 + "'", - value.equals(BigInteger.valueOf(21L))); - } else { - value = value.longValue(); - expected = 21L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[2]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[2] + "' != '" + 23 + "'", - value.equals(BigInteger.valueOf(23L))); - } else { - value = value.longValue(); - expected = 23L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[3]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[3] + "' != '" + 63 + "'", - value.equals(BigInteger.valueOf(63L))); - } else { - value = value.longValue(); - expected = 63L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[4]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[4] + "' != '" + 140 + "'", - value.equals(BigInteger.valueOf(140L))); - } else { - value = value.longValue(); - expected = 140L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[5]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[5] + "' != '" + 37 + "'", - value.equals(BigInteger.valueOf(37L))); - } else { - value = value.longValue(); - expected = 37L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[6]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[6] + "' != '" + 130 + "'", - value.equals(BigInteger.valueOf(130L))); - } else { - value = value.longValue(); - expected = 130L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[7]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[7] + "' != '" + 106 + "'", - value.equals(BigInteger.valueOf(106L))); - } else { - value = value.longValue(); - expected = 106L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[8]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[8] + "' != '" + 28 + "'", - value.equals(BigInteger.valueOf(28L))); - } else { - value = value.longValue(); - expected = 28L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[9]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[9] + "' != '" + 40 + "'", - value.equals(BigInteger.valueOf(40L))); - } else { - value = value.longValue(); - expected = 40L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[10]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[10] + "' != '" + 165 + "'", - value.equals(BigInteger.valueOf(165L))); - } else { - value = value.longValue(); - expected = 165L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[11]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[11] + "' != '" + 179 + "'", - value.equals(BigInteger.valueOf(179L))); - } else { - value = value.longValue(); - expected = 179L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[12]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[12] + "' != '" + 73 + "'", - value.equals(BigInteger.valueOf(73L))); - } else { - value = value.longValue(); - expected = 73L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[13]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[13] + "' != '" + 178 + "'", - value.equals(BigInteger.valueOf(178L))); - } else { - value = value.longValue(); - expected = 178L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[14]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[14] + "' != '" + 60 + "'", - value.equals(BigInteger.valueOf(60L))); - } else { - value = value.longValue(); - expected = 60L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[15]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[15] + "' != '" + 126 + "'", - value.equals(BigInteger.valueOf(126L))); - } else { - value = value.longValue(); - expected = 126L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[16]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[16] + "' != '" + 114 + "'", - value.equals(BigInteger.valueOf(114L))); - } else { - value = value.longValue(); - expected = 114L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[17]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[17] + "' != '" + 78 + "'", - value.equals(BigInteger.valueOf(78L))); - } else { - value = value.longValue(); - expected = 78L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[18]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[18] + "' != '" + 113 + "'", - value.equals(BigInteger.valueOf(113L))); - } else { - value = value.longValue(); - expected = 113L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[19]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[19] + "' != '" + 27 + "'", - value.equals(BigInteger.valueOf(27L))); - } else { - value = value.longValue(); - expected = 27L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[20]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[20] + "' != '" + 95 + "'", - value.equals(BigInteger.valueOf(95L))); - } else { - value = value.longValue(); - expected = 95L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[21]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[21] + "' != '" + 3 + "'", - value.equals(BigInteger.valueOf(3L))); - } else { - value = value.longValue(); - expected = 3L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[22]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[22] + "' != '" + 62 + "'", - value.equals(BigInteger.valueOf(62L))); - } else { - value = value.longValue(); - expected = 62L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[23]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[23] + "' != '" + 104 + "'", - value.equals(BigInteger.valueOf(104L))); - } else { - value = value.longValue(); - expected = 104L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[24]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[24] + "' != '" + 145 + "'", - value.equals(BigInteger.valueOf(145L))); - } else { - value = value.longValue(); - expected = 145L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[25]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[25] + "' != '" + 96 + "'", - value.equals(BigInteger.valueOf(96L))); - } else { - value = value.longValue(); - expected = 96L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[26]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[26] + "' != '" + 19 + "'", - value.equals(BigInteger.valueOf(19L))); - } else { - value = value.longValue(); - expected = 19L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[27]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[27] + "' != '" + 92 + "'", - value.equals(BigInteger.valueOf(92L))); - } else { - value = value.longValue(); - expected = 92L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[28]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[28] + "' != '" + 123 + "'", - value.equals(BigInteger.valueOf(123L))); - } else { - value = value.longValue(); - expected = 123L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[29]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[29] + "' != '" + 14 + "'", - value.equals(BigInteger.valueOf(14L))); - } else { - value = value.longValue(); - expected = 14L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[30]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[30] + "' != '" + 90 + "'", - value.equals(BigInteger.valueOf(90L))); - } else { - value = value.longValue(); - expected = 90L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[31]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[31] + "' != '" + 153 + "'", - value.equals(BigInteger.valueOf(153L))); - } else { - value = value.longValue(); - expected = 153L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[32]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[32] + "' != '" + 183 + "'", - value.equals(BigInteger.valueOf(183L))); - } else { - value = value.longValue(); - expected = 183L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[33]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[33] + "' != '" + 9 + "'", - value.equals(BigInteger.valueOf(9L))); - } else { - value = value.longValue(); - expected = 9L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[34]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[34] + "' != '" + 72 + "'", - value.equals(BigInteger.valueOf(72L))); - } else { - value = value.longValue(); - expected = 72L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[35]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[35] + "' != '" + 81 + "'", - value.equals(BigInteger.valueOf(81L))); - } else { - value = value.longValue(); - expected = 81L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[36]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[36] + "' != '" + 118 + "'", - value.equals(BigInteger.valueOf(118L))); - } else { - value = value.longValue(); - expected = 118L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[37]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[37] + "' != '" + 112 + "'", - value.equals(BigInteger.valueOf(112L))); - } else { - value = value.longValue(); - expected = 112L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[38]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[38] + "' != '" + 124 + "'", - value.equals(BigInteger.valueOf(124L))); - } else { - value = value.longValue(); - expected = 124L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[39]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[39] + "' != '" + 16 + "'", - value.equals(BigInteger.valueOf(16L))); - } else { - value = value.longValue(); - expected = 16L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[40]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[40] + "' != '" + 182 + "'", - value.equals(BigInteger.valueOf(182L))); - } else { - value = value.longValue(); - expected = 182L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[41]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[41] + "' != '" + 76 + "'", - value.equals(BigInteger.valueOf(76L))); - } else { - value = value.longValue(); - expected = 76L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[42]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[42] + "' != '" + 146 + "'", - value.equals(BigInteger.valueOf(146L))); - } else { - value = value.longValue(); - expected = 146L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[43]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[43] + "' != '" + 115 + "'", - value.equals(BigInteger.valueOf(115L))); - } else { - value = value.longValue(); - expected = 115L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[44]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[44] + "' != '" + 58 + "'", - value.equals(BigInteger.valueOf(58L))); - } else { - value = value.longValue(); - expected = 58L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[45]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[45] + "' != '" + 144 + "'", - value.equals(BigInteger.valueOf(144L))); - } else { - value = value.longValue(); - expected = 144L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[46]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[46] + "' != '" + 17 + "'", - value.equals(BigInteger.valueOf(17L))); - } else { - value = value.longValue(); - expected = 17L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[47]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[47] + "' != '" + 105 + "'", - value.equals(BigInteger.valueOf(105L))); - } else { - value = value.longValue(); - expected = 105L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[48]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[48] + "' != '" + 66 + "'", - value.equals(BigInteger.valueOf(66L))); - } else { - value = value.longValue(); - expected = 66L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[49]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[49] + "' != '" + 31 + "'", - value.equals(BigInteger.valueOf(31L))); - } else { - value = value.longValue(); - expected = 31L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[50]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[50] + "' != '" + 135 + "'", - value.equals(BigInteger.valueOf(135L))); - } else { - value = value.longValue(); - expected = 135L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[51]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[51] + "' != '" + 54 + "'", - value.equals(BigInteger.valueOf(54L))); - } else { - value = value.longValue(); - expected = 54L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[52]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[52] + "' != '" + 100 + "'", - value.equals(BigInteger.valueOf(100L))); - } else { - value = value.longValue(); - expected = 100L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[53]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[53] + "' != '" + 84 + "'", - value.equals(BigInteger.valueOf(84L))); - } else { - value = value.longValue(); - expected = 84L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[54]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[54] + "' != '" + 181 + "'", - value.equals(BigInteger.valueOf(181L))); - } else { - value = value.longValue(); - expected = 181L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[55]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[55] + "' != '" + 103 + "'", - value.equals(BigInteger.valueOf(103L))); - } else { - value = value.longValue(); - expected = 103L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[56]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[56] + "' != '" + 11 + "'", - value.equals(BigInteger.valueOf(11L))); - } else { - value = value.longValue(); - expected = 11L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[57]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[57] + "' != '" + 88 + "'", - value.equals(BigInteger.valueOf(88L))); - } else { - value = value.longValue(); - expected = 88L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[58]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[58] + "' != '" + 133 + "'", - value.equals(BigInteger.valueOf(133L))); - } else { - value = value.longValue(); - expected = 133L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[59]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[59] + "' != '" + 155 + "'", - value.equals(BigInteger.valueOf(155L))); - } else { - value = value.longValue(); - expected = 155L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[60]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[60] + "' != '" + 167 + "'", - value.equals(BigInteger.valueOf(167L))); - } else { - value = value.longValue(); - expected = 167L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[61]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[61] + "' != '" + 173 + "'", - value.equals(BigInteger.valueOf(173L))); - } else { - value = value.longValue(); - expected = 173L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[62]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[62] + "' != '" + 143 + "'", - value.equals(BigInteger.valueOf(143L))); - } else { - value = value.longValue(); - expected = 143L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[63]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[63] + "' != '" + 86 + "'", - value.equals(BigInteger.valueOf(86L))); - } else { - value = value.longValue(); - expected = 86L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[64]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[64] + "' != '" + 158 + "'", - value.equals(BigInteger.valueOf(158L))); - } else { - value = value.longValue(); - expected = 158L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[65]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[65] + "' != '" + 20 + "'", - value.equals(BigInteger.valueOf(20L))); - } else { - value = value.longValue(); - expected = 20L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[66]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[66] + "' != '" + 168 + "'", - value.equals(BigInteger.valueOf(168L))); - } else { - value = value.longValue(); - expected = 168L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[67]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[67] + "' != '" + 132 + "'", - value.equals(BigInteger.valueOf(132L))); - } else { - value = value.longValue(); - expected = 132L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[68]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[68] + "' != '" + 141 + "'", - value.equals(BigInteger.valueOf(141L))); - } else { - value = value.longValue(); - expected = 141L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[69]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[69] + "' != '" + 102 + "'", - value.equals(BigInteger.valueOf(102L))); - } else { - value = value.longValue(); - expected = 102L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[70]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[70] + "' != '" + 50 + "'", - value.equals(BigInteger.valueOf(50L))); - } else { - value = value.longValue(); - expected = 50L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[71]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[71] + "' != '" + 48 + "'", - value.equals(BigInteger.valueOf(48L))); - } else { - value = value.longValue(); - expected = 48L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[72]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[72] + "' != '" + 71 + "'", - value.equals(BigInteger.valueOf(71L))); - } else { - value = value.longValue(); - expected = 71L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[73]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[73] + "' != '" + 147 + "'", - value.equals(BigInteger.valueOf(147L))); - } else { - value = value.longValue(); - expected = 147L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[74]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[74] + "' != '" + 53 + "'", - value.equals(BigInteger.valueOf(53L))); - } else { - value = value.longValue(); - expected = 53L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[75]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[75] + "' != '" + 87 + "'", - value.equals(BigInteger.valueOf(87L))); - } else { - value = value.longValue(); - expected = 87L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[76]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[76] + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[77]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[77] + "' != '" + 108 + "'", - value.equals(BigInteger.valueOf(108L))); - } else { - value = value.longValue(); - expected = 108L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[78]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[78] + "' != '" + 138 + "'", - value.equals(BigInteger.valueOf(138L))); - } else { - value = value.longValue(); - expected = 138L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[79]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[79] + "' != '" + 36 + "'", - value.equals(BigInteger.valueOf(36L))); - } else { - value = value.longValue(); - expected = 36L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[80]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[80] + "' != '" + 134 + "'", - value.equals(BigInteger.valueOf(134L))); - } else { - value = value.longValue(); - expected = 134L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[81]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[81] + "' != '" + 139 + "'", - value.equals(BigInteger.valueOf(139L))); - } else { - value = value.longValue(); - expected = 139L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[82]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[82] + "' != '" + 163 + "'", - value.equals(BigInteger.valueOf(163L))); - } else { - value = value.longValue(); - expected = 163L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[83]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[83] + "' != '" + 82 + "'", - value.equals(BigInteger.valueOf(82L))); - } else { - value = value.longValue(); - expected = 82L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[84]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[84] + "' != '" + 43 + "'", - value.equals(BigInteger.valueOf(43L))); - } else { - value = value.longValue(); - expected = 43L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[85]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[85] + "' != '" + 52 + "'", - value.equals(BigInteger.valueOf(52L))); - } else { - value = value.longValue(); - expected = 52L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[86]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[86] + "' != '" + 150 + "'", - value.equals(BigInteger.valueOf(150L))); - } else { - value = value.longValue(); - expected = 150L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[87]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[87] + "' != '" + 12 + "'", - value.equals(BigInteger.valueOf(12L))); - } else { - value = value.longValue(); - expected = 12L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[88]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[88] + "' != '" + 30 + "'", - value.equals(BigInteger.valueOf(30L))); - } else { - value = value.longValue(); - expected = 30L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[89]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[89] + "' != '" + 110 + "'", - value.equals(BigInteger.valueOf(110L))); - } else { - value = value.longValue(); - expected = 110L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[90]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[90] + "' != '" + 156 + "'", - value.equals(BigInteger.valueOf(156L))); - } else { - value = value.longValue(); - expected = 156L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[91]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[91] + "' != '" + 107 + "'", - value.equals(BigInteger.valueOf(107L))); - } else { - value = value.longValue(); - expected = 107L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[92]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[92] + "' != '" + 120 + "'", - value.equals(BigInteger.valueOf(120L))); - } else { - value = value.longValue(); - expected = 120L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[93]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[93] + "' != '" + 91 + "'", - value.equals(BigInteger.valueOf(91L))); - } else { - value = value.longValue(); - expected = 91L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[94]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[94] + "' != '" + 122 + "'", - value.equals(BigInteger.valueOf(122L))); - } else { - value = value.longValue(); - expected = 122L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[95]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[95] + "' != '" + 69 + "'", - value.equals(BigInteger.valueOf(69L))); - } else { - value = value.longValue(); - expected = 69L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[96]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[96] + "' != '" + 164 + "'", - value.equals(BigInteger.valueOf(164L))); - } else { - value = value.longValue(); - expected = 164L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[97]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[97] + "' != '" + 170 + "'", - value.equals(BigInteger.valueOf(170L))); - } else { - value = value.longValue(); - expected = 170L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[98]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[98] + "' != '" + 116 + "'", - value.equals(BigInteger.valueOf(116L))); - } else { - value = value.longValue(); - expected = 116L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[99]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[99] + "' != '" + 25 + "'", - value.equals(BigInteger.valueOf(25L))); - } else { - value = value.longValue(); - expected = 25L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[100]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[100] + "' != '" + 94 + "'", - value.equals(BigInteger.valueOf(94L))); - } else { - value = value.longValue(); - expected = 94L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[101]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[101] + "' != '" + 5 + "'", - value.equals(BigInteger.valueOf(5L))); - } else { - value = value.longValue(); - expected = 5L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[102]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[102] + "' != '" + 22 + "'", - value.equals(BigInteger.valueOf(22L))); - } else { - value = value.longValue(); - expected = 22L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[103]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[103] + "' != '" + 24 + "'", - value.equals(BigInteger.valueOf(24L))); - } else { - value = value.longValue(); - expected = 24L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[104]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[104] + "' != '" + 162 + "'", - value.equals(BigInteger.valueOf(162L))); - } else { - value = value.longValue(); - expected = 162L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[105]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[105] + "' != '" + 175 + "'", - value.equals(BigInteger.valueOf(175L))); - } else { - value = value.longValue(); - expected = 175L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[106]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[106] + "' != '" + 38 + "'", - value.equals(BigInteger.valueOf(38L))); - } else { - value = value.longValue(); - expected = 38L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[107]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[107] + "' != '" + 157 + "'", - value.equals(BigInteger.valueOf(157L))); - } else { - value = value.longValue(); - expected = 157L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[108]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[108] + "' != '" + 98 + "'", - value.equals(BigInteger.valueOf(98L))); - } else { - value = value.longValue(); - expected = 98L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[109]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[109] + "' != '" + 44 + "'", - value.equals(BigInteger.valueOf(44L))); - } else { - value = value.longValue(); - expected = 44L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[110]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[110] + "' != '" + 160 + "'", - value.equals(BigInteger.valueOf(160L))); - } else { - value = value.longValue(); - expected = 160L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[111]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[111] + "' != '" + 47 + "'", - value.equals(BigInteger.valueOf(47L))); - } else { - value = value.longValue(); - expected = 47L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[112]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[112] + "' != '" + 97 + "'", - value.equals(BigInteger.valueOf(97L))); - } else { - value = value.longValue(); - expected = 97L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[113]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[113] + "' != '" + 142 + "'", - value.equals(BigInteger.valueOf(142L))); - } else { - value = value.longValue(); - expected = 142L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[114]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[114] + "' != '" + 8 + "'", - value.equals(BigInteger.valueOf(8L))); - } else { - value = value.longValue(); - expected = 8L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[115]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[115] + "' != '" + 74 + "'", - value.equals(BigInteger.valueOf(74L))); - } else { - value = value.longValue(); - expected = 74L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[116]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[116] + "' != '" + 13 + "'", - value.equals(BigInteger.valueOf(13L))); - } else { - value = value.longValue(); - expected = 13L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[117]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[117] + "' != '" + 177 + "'", - value.equals(BigInteger.valueOf(177L))); - } else { - value = value.longValue(); - expected = 177L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[118]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[118] + "' != '" + 15 + "'", - value.equals(BigInteger.valueOf(15L))); - } else { - value = value.longValue(); - expected = 15L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[119]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[119] + "' != '" + 128 + "'", - value.equals(BigInteger.valueOf(128L))); - } else { - value = value.longValue(); - expected = 128L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[120]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[120] + "' != '" + 26 + "'", - value.equals(BigInteger.valueOf(26L))); - } else { - value = value.longValue(); - expected = 26L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[121]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[121] + "' != '" + 131 + "'", - value.equals(BigInteger.valueOf(131L))); - } else { - value = value.longValue(); - expected = 131L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[122]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[122] + "' != '" + 154 + "'", - value.equals(BigInteger.valueOf(154L))); - } else { - value = value.longValue(); - expected = 154L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[123]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[123] + "' != '" + 65 + "'", - value.equals(BigInteger.valueOf(65L))); - } else { - value = value.longValue(); - expected = 65L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[124]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[124] + "' != '" + 169 + "'", - value.equals(BigInteger.valueOf(169L))); - } else { - value = value.longValue(); - expected = 169L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[125]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[125] + "' != '" + 55 + "'", - value.equals(BigInteger.valueOf(55L))); - } else { - value = value.longValue(); - expected = 55L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[126]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[126] + "' != '" + 136 + "'", - value.equals(BigInteger.valueOf(136L))); - } else { - value = value.longValue(); - expected = 136L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[127]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[127] + "' != '" + 125 + "'", - value.equals(BigInteger.valueOf(125L))); - } else { - value = value.longValue(); - expected = 125L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[128]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[128] + "' != '" + 171 + "'", - value.equals(BigInteger.valueOf(171L))); - } else { - value = value.longValue(); - expected = 171L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[129]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[129] + "' != '" + 161 + "'", - value.equals(BigInteger.valueOf(161L))); - } else { - value = value.longValue(); - expected = 161L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[130]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[130] + "' != '" + 29 + "'", - value.equals(BigInteger.valueOf(29L))); - } else { - value = value.longValue(); - expected = 29L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[131]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[131] + "' != '" + 129 + "'", - value.equals(BigInteger.valueOf(129L))); - } else { - value = value.longValue(); - expected = 129L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[132]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[132] + "' != '" + 151 + "'", - value.equals(BigInteger.valueOf(151L))); - } else { - value = value.longValue(); - expected = 151L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[133]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[133] + "' != '" + 68 + "'", - value.equals(BigInteger.valueOf(68L))); - } else { - value = value.longValue(); - expected = 68L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[134]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[134] + "' != '" + 166 + "'", - value.equals(BigInteger.valueOf(166L))); - } else { - value = value.longValue(); - expected = 166L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[135]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[135] + "' != '" + 51 + "'", - value.equals(BigInteger.valueOf(51L))); - } else { - value = value.longValue(); - expected = 51L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[136]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[136] + "' != '" + 70 + "'", - value.equals(BigInteger.valueOf(70L))); - } else { - value = value.longValue(); - expected = 70L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[137]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[137] + "' != '" + 45 + "'", - value.equals(BigInteger.valueOf(45L))); - } else { - value = value.longValue(); - expected = 45L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[138]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[138] + "' != '" + 56 + "'", - value.equals(BigInteger.valueOf(56L))); - } else { - value = value.longValue(); - expected = 56L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[139]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[139] + "' != '" + 79 + "'", - value.equals(BigInteger.valueOf(79L))); - } else { - value = value.longValue(); - expected = 79L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[140]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[140] + "' != '" + 149 + "'", - value.equals(BigInteger.valueOf(149L))); - } else { - value = value.longValue(); - expected = 149L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[141]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[141] + "' != '" + 99 + "'", - value.equals(BigInteger.valueOf(99L))); - } else { - value = value.longValue(); - expected = 99L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[142]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[142] + "' != '" + 42 + "'", - value.equals(BigInteger.valueOf(42L))); - } else { - value = value.longValue(); - expected = 42L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[143]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[143] + "' != '" + 101 + "'", - value.equals(BigInteger.valueOf(101L))); - } else { - value = value.longValue(); - expected = 101L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[144]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[144] + "' != '" + 152 + "'", - value.equals(BigInteger.valueOf(152L))); - } else { - value = value.longValue(); - expected = 152L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[145]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[145] + "' != '" + 39 + "'", - value.equals(BigInteger.valueOf(39L))); - } else { - value = value.longValue(); - expected = 39L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[146]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[146] + "' != '" + 89 + "'", - value.equals(BigInteger.valueOf(89L))); - } else { - value = value.longValue(); - expected = 89L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[147]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[147] + "' != '" + 180 + "'", - value.equals(BigInteger.valueOf(180L))); - } else { - value = value.longValue(); - expected = 180L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[148]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[148] + "' != '" + 64 + "'", - value.equals(BigInteger.valueOf(64L))); - } else { - value = value.longValue(); - expected = 64L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[149]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[149] + "' != '" + 49 + "'", - value.equals(BigInteger.valueOf(49L))); - } else { - value = value.longValue(); - expected = 49L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[150]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[150] + "' != '" + 6 + "'", - value.equals(BigInteger.valueOf(6L))); - } else { - value = value.longValue(); - expected = 6L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[151]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[151] + "' != '" + 80 + "'", - value.equals(BigInteger.valueOf(80L))); - } else { - value = value.longValue(); - expected = 80L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[152]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[152] + "' != '" + 172 + "'", - value.equals(BigInteger.valueOf(172L))); - } else { - value = value.longValue(); - expected = 172L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[153]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[153] + "' != '" + 32 + "'", - value.equals(BigInteger.valueOf(32L))); - } else { - value = value.longValue(); - expected = 32L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[154]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[154] + "' != '" + 109 + "'", - value.equals(BigInteger.valueOf(109L))); - } else { - value = value.longValue(); - expected = 109L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[155]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[155] + "' != '" + 2 + "'", - value.equals(BigInteger.valueOf(2L))); - } else { - value = value.longValue(); - expected = 2L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[156]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[156] + "' != '" + 119 + "'", - value.equals(BigInteger.valueOf(119L))); - } else { - value = value.longValue(); - expected = 119L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[157]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[157] + "' != '" + 93 + "'", - value.equals(BigInteger.valueOf(93L))); - } else { - value = value.longValue(); - expected = 93L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[158]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[158] + "' != '" + 176 + "'", - value.equals(BigInteger.valueOf(176L))); - } else { - value = value.longValue(); - expected = 176L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[159]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[159] + "' != '" + 0 + "'", - value.equals(BigInteger.valueOf(0L))); - } else { - value = value.longValue(); - expected = 0L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[160]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[160] + "' != '" + 33 + "'", - value.equals(BigInteger.valueOf(33L))); - } else { - value = value.longValue(); - expected = 33L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[161]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[161] + "' != '" + 57 + "'", - value.equals(BigInteger.valueOf(57L))); - } else { - value = value.longValue(); - expected = 57L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[162]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[162] + "' != '" + 34 + "'", - value.equals(BigInteger.valueOf(34L))); - } else { - value = value.longValue(); - expected = 34L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[163]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[163] + "' != '" + 18 + "'", - value.equals(BigInteger.valueOf(18L))); - } else { - value = value.longValue(); - expected = 18L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[164]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[164] + "' != '" + 85 + "'", - value.equals(BigInteger.valueOf(85L))); - } else { - value = value.longValue(); - expected = 85L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[165]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[165] + "' != '" + 121 + "'", - value.equals(BigInteger.valueOf(121L))); - } else { - value = value.longValue(); - expected = 121L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[166]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[166] + "' != '" + 137 + "'", - value.equals(BigInteger.valueOf(137L))); - } else { - value = value.longValue(); - expected = 137L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[167]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[167] + "' != '" + 83 + "'", - value.equals(BigInteger.valueOf(83L))); - } else { - value = value.longValue(); - expected = 83L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[168]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[168] + "' != '" + 111 + "'", - value.equals(BigInteger.valueOf(111L))); - } else { - value = value.longValue(); - expected = 111L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[169]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[169] + "' != '" + 59 + "'", - value.equals(BigInteger.valueOf(59L))); - } else { - value = value.longValue(); - expected = 59L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[170]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[170] + "' != '" + 7 + "'", - value.equals(BigInteger.valueOf(7L))); - } else { - value = value.longValue(); - expected = 7L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[171]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[171] + "' != '" + 77 + "'", - value.equals(BigInteger.valueOf(77L))); - } else { - value = value.longValue(); - expected = 77L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[172]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[172] + "' != '" + 4 + "'", - value.equals(BigInteger.valueOf(4L))); - } else { - value = value.longValue(); - expected = 4L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[173]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[173] + "' != '" + 117 + "'", - value.equals(BigInteger.valueOf(117L))); - } else { - value = value.longValue(); - expected = 117L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[174]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[174] + "' != '" + 159 + "'", - value.equals(BigInteger.valueOf(159L))); - } else { - value = value.longValue(); - expected = 159L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[175]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[175] + "' != '" + 148 + "'", - value.equals(BigInteger.valueOf(148L))); - } else { - value = value.longValue(); - expected = 148L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[176]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[176] + "' != '" + 35 + "'", - value.equals(BigInteger.valueOf(35L))); - } else { - value = value.longValue(); - expected = 35L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[177]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[177] + "' != '" + 61 + "'", - value.equals(BigInteger.valueOf(61L))); - } else { - value = value.longValue(); - expected = 61L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[178]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[178] + "' != '" + 41 + "'", - value.equals(BigInteger.valueOf(41L))); - } else { - value = value.longValue(); - expected = 41L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[179]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[179] + "' != '" + 67 + "'", - value.equals(BigInteger.valueOf(67L))); - } else { - value = value.longValue(); - expected = 67L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[180]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[180] + "' != '" + 46 + "'", - value.equals(BigInteger.valueOf(46L))); - } else { - value = value.longValue(); - expected = 46L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[181]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[181] + "' != '" + 127 + "'", - value.equals(BigInteger.valueOf(127L))); - } else { - value = value.longValue(); - expected = 127L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[182]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[182] + "' != '" + 75 + "'", - value.equals(BigInteger.valueOf(75L))); - } else { - value = value.longValue(); - expected = 75L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.signed_messages[183]; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.signed_messages[183] + "' != '" + 174 + "'", - value.equals(BigInteger.valueOf(174L))); - } else { - value = value.longValue(); - expected = 174L; - org.junit.Assert.assertEquals(value, expected); - } - value = msg.stream_counter; - if (value instanceof BigInteger) { - org.junit.Assert.assertTrue( - "'" + msg.stream_counter + "' != '" + 1 + "'", - value.equals(BigInteger.valueOf(1L))); - } else { - value = value.longValue(); - expected = 1L; - org.junit.Assert.assertEquals(value, expected); - } - - org.junit.Assert.assertNotEquals("", msg.getFriendlyName()); - } -} From d0839db6dea734c967343a8e2a3539bd7824dad0 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Fri, 17 Mar 2023 13:49:01 -0700 Subject: [PATCH 3/5] fix c tests --- c/test/auto_check_sbp_signing_MsgEcdsaSignature.c | 8 ++++++++ c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc | 4 ++++ .../yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml | 2 ++ 3 files changed, 14 insertions(+) diff --git a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c index 813bc85c54..cc176c9798 100644 --- a/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c +++ b/c/test/auto_check_sbp_signing_MsgEcdsaSignature.c @@ -117,6 +117,8 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { test_msg.ecdsa_signature.flags = 0; + test_msg.ecdsa_signature.n_signed_messages = 3; + test_msg.ecdsa_signature.on_demand_counter = 2; test_msg.ecdsa_signature.signature.data[0] = 0; @@ -323,6 +325,12 @@ START_TEST(test_auto_check_sbp_signing_MsgEcdsaSignature) { "expected 0, is %d", last_msg.msg.ecdsa_signature.flags); + ck_assert_msg( + last_msg.msg.ecdsa_signature.n_signed_messages == 3, + "incorrect value for last_msg.msg.ecdsa_signature.n_signed_messages, " + "expected 3, is %d", + last_msg.msg.ecdsa_signature.n_signed_messages); + ck_assert_msg( last_msg.msg.ecdsa_signature.on_demand_counter == 2, "incorrect value for last_msg.msg.ecdsa_signature.on_demand_counter, " diff --git a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc index 56a0027c1f..c0993550bf 100644 --- a/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc +++ b/c/test/cpp/auto_check_sbp_signing_MsgEcdsaSignature.cc @@ -94,6 +94,7 @@ TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { test_msg.certificate_id[3] = 4; test_msg.flags = 0; + test_msg.n_signed_messages = 3; test_msg.on_demand_counter = 2; test_msg.signature.data[0] = 0; @@ -275,6 +276,9 @@ TEST_F(Test_auto_check_sbp_signing_MsgEcdsaSignature0, Test) { EXPECT_EQ(last_msg_.flags, 0) << "incorrect value for last_msg_.flags, expected 0, is " << last_msg_.flags; + EXPECT_EQ(last_msg_.n_signed_messages, 3) + << "incorrect value for last_msg_.n_signed_messages, expected 3, is " + << last_msg_.n_signed_messages; EXPECT_EQ(last_msg_.on_demand_counter, 2) << "incorrect value for last_msg_.on_demand_counter, expected 2, is " << last_msg_.on_demand_counter; diff --git a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml index 1bc8c8fe94..15949a8921 100644 --- a/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml +++ b/spec/tests/yaml/swiftnav/sbp/signing/test_MsgEcdsaSignature.yaml @@ -3,6 +3,8 @@ generated_on: '2023-03-17 19:24:46.292191' package: sbp.signing tests: - msg: + c_decoded_fields: + n_signed_messages: 3 fields: certificate_id: - 1 From 0b4d631b611a13ef9eab46d9f0420aac23e72a92 Mon Sep 17 00:00:00 2001 From: Steven Meyer Date: Fri, 17 Mar 2023 14:40:45 -0700 Subject: [PATCH 4/5] Update spec/yaml/swiftnav/sbp/signing.yaml Co-authored-by: Jason Mobarak --- spec/yaml/swiftnav/sbp/signing.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/yaml/swiftnav/sbp/signing.yaml b/spec/yaml/swiftnav/sbp/signing.yaml index fe057c146a..3de9a4ddf2 100644 --- a/spec/yaml/swiftnav/sbp/signing.yaml +++ b/spec/yaml/swiftnav/sbp/signing.yaml @@ -122,8 +122,11 @@ definitions: - expiration: type: UtcTime desc: > - The certificate chain comprised of three fingerprints: root - certificate, intermediate certificate and corrections certificate. + The time after which the signature given is no longer valid. + Implementors should consult a time source (such as GNSS) to + check if the current time is later than the expiration time, + if the condition is true, signatures in the stream should not + be considered valid. - signature: type: ECDSASignature desc: > From b1bc0b3db5f8328068a273c6d81bfe6319bde0d1 Mon Sep 17 00:00:00 2001 From: notoriaga Date: Fri, 17 Mar 2023 15:11:38 -0700 Subject: [PATCH 5/5] gen --- c/include/libsbp/legacy/signing.h | 15 ++++++++++----- .../libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h | 6 ++++-- haskell/src/SwiftNav/SBP/Signing.hs | 6 ++++-- .../swiftnav/sbp/signing/MsgCertificateChain.java | 5 +++-- javascript/sbp/signing.js | 6 ++++-- python/sbp/signing.py | 6 ++++-- rust/sbp/src/messages/signing.rs | 6 ++++-- 7 files changed, 33 insertions(+), 17 deletions(-) diff --git a/c/include/libsbp/legacy/signing.h b/c/include/libsbp/legacy/signing.h index 5b74beeedf..911dd111f2 100644 --- a/c/include/libsbp/legacy/signing.h +++ b/c/include/libsbp/legacy/signing.h @@ -71,11 +71,16 @@ typedef struct SBP_ATTR_PACKED { certificate */ u8 corrections_certificate[20]; /**< SHA-1 fingerprint of the corrections certificate */ - utc_time_t expiration; /**< The certificate chain comprised - of three fingerprints: root - certificate, intermediate - certificate and corrections - certificate. */ + utc_time_t expiration; /**< The time after which the + signature given is no longer + valid. Implementors should + consult a time source (such as + GNSS) to check if the current + time is later than the + expiration time, if the + condition is true, signatures + in the stream should not be + considered valid. */ ecdsa_signature_t signature; /**< Signature (created by the root certificate) over the concatenation diff --git a/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h index f302eba9de..0233b47f04 100644 --- a/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h +++ b/c/include/libsbp/v4/signing/MSG_CERTIFICATE_CHAIN.h @@ -59,8 +59,10 @@ typedef struct { [SBP_MSG_CERTIFICATE_CHAIN_CORRECTIONS_CERTIFICATE_MAX]; /** - * The certificate chain comprised of three fingerprints: root certificate, - * intermediate certificate and corrections certificate. + * The time after which the signature given is no longer valid. Implementors + * should consult a time source (such as GNSS) to check if the current time is + * later than the expiration time, if the condition is true, signatures in the + * stream should not be considered valid. */ sbp_utc_time_t expiration; diff --git a/haskell/src/SwiftNav/SBP/Signing.hs b/haskell/src/SwiftNav/SBP/Signing.hs index 828ef9197d..1a552345e0 100644 --- a/haskell/src/SwiftNav/SBP/Signing.hs +++ b/haskell/src/SwiftNav/SBP/Signing.hs @@ -146,8 +146,10 @@ data MsgCertificateChain = MsgCertificateChain , _msgCertificateChain_corrections_certificate :: ![Word8] -- ^ SHA-1 fingerprint of the corrections certificate , _msgCertificateChain_expiration :: !UtcTime - -- ^ The certificate chain comprised of three fingerprints: root - -- certificate, intermediate certificate and corrections certificate. + -- ^ The time after which the signature given is no longer valid. + -- Implementors should consult a time source (such as GNSS) to check if + -- the current time is later than the expiration time, if the condition is + -- true, signatures in the stream should not be considered valid. , _msgCertificateChain_signature :: !ECDSASignature -- ^ Signature (created by the root certificate) over the concatenation of -- the SBP payload bytes preceding this field. That is, the concatenation diff --git a/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java b/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java index a8abee15d0..b8768865cf 100644 --- a/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java +++ b/java/src/com/swiftnav/sbp/signing/MsgCertificateChain.java @@ -32,8 +32,9 @@ public class MsgCertificateChain extends SBPMessage { public int[] corrections_certificate; /** - * The certificate chain comprised of three fingerprints: root certificate, intermediate - * certificate and corrections certificate. + * The time after which the signature given is no longer valid. Implementors should consult a + * time source (such as GNSS) to check if the current time is later than the expiration time, if + * the condition is true, signatures in the stream should not be considered valid. */ public UtcTime expiration; diff --git a/javascript/sbp/signing.js b/javascript/sbp/signing.js index 55977881b6..339c396f82 100644 --- a/javascript/sbp/signing.js +++ b/javascript/sbp/signing.js @@ -142,8 +142,10 @@ MsgEcdsaCertificate.prototype.fieldSpec.push(['certificate_bytes', 'array', 'wri * @field root_certificate array SHA-1 fingerprint of the root certificate * @field intermediate_certificate array SHA-1 fingerprint of the intermediate certificate * @field corrections_certificate array SHA-1 fingerprint of the corrections certificate - * @field expiration UtcTime The certificate chain comprised of three fingerprints: root certificate, - * intermediate certificate and corrections certificate. + * @field expiration UtcTime The time after which the signature given is no longer valid. Implementors should + * consult a time source (such as GNSS) to check if the current time is later than + * the expiration time, if the condition is true, signatures in the stream should + * not be considered valid. * @field signature ECDSASignature Signature (created by the root certificate) over the concatenation of the SBP * payload bytes preceding this field. That is, the concatenation of * `root_certificate`, `intermediate_certificate`, `corrections_certificate` and diff --git a/python/sbp/signing.py b/python/sbp/signing.py index c0de084329..654fa8b9e3 100644 --- a/python/sbp/signing.py +++ b/python/sbp/signing.py @@ -255,8 +255,10 @@ class MsgCertificateChain(SBP): corrections_certificate : array SHA-1 fingerprint of the corrections certificate expiration : UtcTime - The certificate chain comprised of three fingerprints: root certificate, - intermediate certificate and corrections certificate. + The time after which the signature given is no longer valid. Implementors + should consult a time source (such as GNSS) to check if the current time + is later than the expiration time, if the condition is true, signatures in + the stream should not be considered valid. signature : ECDSASignature Signature (created by the root certificate) over the concatenation of the SBP payload bytes preceding this field. That is, the concatenation of diff --git a/rust/sbp/src/messages/signing.rs b/rust/sbp/src/messages/signing.rs index e8ba4d238e..bb0c85f343 100644 --- a/rust/sbp/src/messages/signing.rs +++ b/rust/sbp/src/messages/signing.rs @@ -86,8 +86,10 @@ pub mod msg_certificate_chain { /// SHA-1 fingerprint of the corrections certificate #[cfg_attr(feature = "serde", serde(rename = "corrections_certificate"))] pub corrections_certificate: [u8; 20], - /// The certificate chain comprised of three fingerprints: root certificate, - /// intermediate certificate and corrections certificate. + /// The time after which the signature given is no longer valid. + /// Implementors should consult a time source (such as GNSS) to check if the + /// current time is later than the expiration time, if the condition is + /// true, signatures in the stream should not be considered valid. #[cfg_attr(feature = "serde", serde(rename = "expiration"))] pub expiration: UtcTime, /// Signature (created by the root certificate) over the concatenation of