Subject: Re: [Tm-rid] Adam's current extended auth message

From: "Wiethuechter, Adam" <[email-masked]>
Date: Tue, 1 Oct 2019 10:20:50 -0400

All,

This sadly might be changed considerably due to in version 0.8 of the spec
the authentication message has changed. It now, from what I can tell in
commits here [1] that it has a max of 5 pages and there are new field
formats. The specific commit for those interested is: 92d4a9c. While a few
of the fields address some of the issues we were targeting (the timestamp)
it is not exactly as we envisioned it.

I am working now on fixing our format and seeing how it fits in the new
one. I will keep everyone here posted as I make progress on this.

[1] https://github.com/opendroneid/opendroneid-core-c/commits/master

On Fri, Sep 27, 2019 at 12:37 PM Robert Moskowitz <[email-masked]>
wrote:

> I am sending this layout that Adam has been working on for people to get
> some idea of what we have been working on.  It needs fixes and details.
>
> It uses ECDSA-384 sigs of 96bytes.  I will be recommending EdDSA25519
> sigs of 64 bytes.
>
> What goes into making the message hashes and how are they computed? For
> the later, i recommend SHAKE128 (or cSHAKE128).
>
> There is more, but I am short of time with Rosh Hashana Monday and
> Tuesday.  Here it is:
>
>
>
> =================================================================
>      |                        General Format                         |
> =================================================================
>      Page 0:
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------+-------+-------+-------+
>      |  Msg. Header  | # Hashes Left | STS-P | ETS-P | H-Alg | H-Len |
> +---------------+---------------+-------+-------+-------+-------+
>      |         Start Timestamp       |         End Timestamp         |
> +-------------------------------+-------------------------------+
>      |                Hash of Previous Auth. Message                 |
> +---------------------------------------------------------------+
>      |                Hash of Current Auth. Message                  |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      Msg. Header: (1 byte)
>          Defined by ASTM Remote ID Message protocol.
>          Bits 7-4: AuthType
>          Bits 3-0: Data Page
>          See https://github.com/opendroneid/specs, Message for more
>          details.
>      # Hashes Left: (1 byte)
>          A count of the number of hashes to be found in this Auth
>          message. This does not include the previous or current
>          Auth message hashes.
>          The first page will decrement this by 2 for the next page
>          in the sequence.
>      STS-P, ETS-P: (4 bits), (4 bits)
>          This is a precision value for the Start and End timestamps
>          respectively.
>
>          See ASTM draft, Figure 3; Timestamp/Speed Accuracy field
>          for details. We are only concered about bits 7-4.
>      H-Alg, H-Len: (4 bits), (4 bits)
>          These are fields for relaying information of the Hash
>          algorithm used for the messages and the Hash length (in octets).
>          For this example of the format a length of 4 bytes is
>          used.
>      Start Timestamp: (2 bytes)
>          Time stamp dictating that messages hashed in this Auth
>          message came after this specified time, but NOT after
>          End Timestamp.
>          See ASTM draft for Timestamp format details.
>      End Timestamp: (2 bytes)
>          Time stamp dictating that messages hashed in this Auth
>          message came before this specified time, but NOT before
>          Start Timestamp.
>          See ASTM draft for Timestamp format details.
>      Hash of Previous Auth. Message: (4 bytes)
>          A hash of the previous send Auth message.
>      Hash of Current Auth. Message: (4 bytes)
>          A hash of the current Auth message.
>          A few notes on this field:
>          a) First during creation and signing of this message format
>          this field MUST be set to 0. So the signature will be
>          based on this field being 0, as well as its own hash. It
>          is an open question of if we compute the hash, then sign
>          or sign then compute.
>          b) There a few different ways to cycle this message. We can
>          "roll up" the hash of 'current' to 'previous' when needed
>          or to completely recompute the hash. This mostly depends on
>          the previous note.
>      Message Hash: (4 bytes)
>          A hash of a previously sent message.
>
> ===============================================================================
>      Page 1 to N (N<=11):
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |  Msg. Header  | # Hashes Left | RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      Msg. Header: (1 byte)
>          Defined by ASTM Remote ID Message protocol.
>          Bits 7-4: AuthType
>          Bits 3-0: Data Page
>          See https://github.com/opendroneid/specs, Message for more
>          details.
>      # Hashes Left: (1 byte)
>          A count of the number of hashes to be found left in this
>          Auth message.
>          Every full page of hashes will decrement this by 5 until it
>          reaches 0 (which signals the end of hashes and start of
>          the Auth message signature).
>          If a page has less than 5 hashes then the rest of the page
>          should be padded with zeros.
>      Message Hash: (4 bytes)
>          A hash of a previously sent message.
> ==========================================================================
>      Page N to K (N<=11 && K<=15):
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |  Msg. Header  | # Hashes Left | RESERVED           |
> +---------------+---------------+-------------------------------+
>      |            Length             |      Signature Algorithm      |
> +-------------------------------+-------------------------------+
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>      Msg. Header: (1 byte)
>          Defined by ASTM Remote ID Message protocol.
>          Bits 7-4: AuthType
>          Bits 3-0: Data Page
>          See https://github.com/opendroneid/specs, Message for more
>          details.
>      # Hashes Left: (1 byte)
>          A count of the number of hashes to be found in this Auth
>          message. This does not include the previous or current
>          Auth message hashes.
>          For this page (and all subsequent pages) it SHOULD be 0.
>
>      Length: (2 bytes)
>          length is octets, excluding Length, and Padding
>      Signature Algoirthm: (2 bytes)
>          Self explanatory.
>      HIP Signature: (96 bytes)
>          Based on ECDSA-384 Signature.
>          If smaller HIT based signature is used then more hashes can fit
>          into the full message format across the 16 pages. With a
>          ECDSA-384 signature a maximum of 64 message hashes can be sent.
>          23 bytes per page * 16 pages = 368 bytes
>          - 96 bytes for sig = 272 bytes
>          - 8 bytes for timestamps = 264 bytes
>          - 8 bytes for auth message hashs = 256 bytes
>          / 4 bytes per hash = 64 hashes
>          See RFC4754 for detail on ECDSA-384 and RFC7401 on HIPs use of
>          ECDSA for HI/HIT.
>          If the end of the signature does not fill a full page, it
>          WILL be padded with zeros at the end.
>
> ============================================================================
>      Page 0:
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------+-------+-------+-------+
>      |  Msg. Header  | # Hashes Left | STS-P | ETS-P | H-Alg | H-Len |
> +---------------+---------------+-------+-------+-------+-------+
>      |         Start Timestamp       |         End Timestamp         |
> +-------------------------------+-------------------------------+
>      |                Hash of Previous Auth. Message                 |
> +---------------------------------------------------------------+
>      |                Hash of Current Auth. Message                  |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      Page 1 to N (N<=11):
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |  Msg. Header  | # Hashes Left | RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      Page N to K (N<=11 && K<=15):
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |  Msg. Header  | # Hashes Left | RESERVED           |
> +---------------+---------------+-------------------------------+
>      |            Length             |      Signature Algorithm      |
> +-------------------------------+-------------------------------+
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>
> ============================================================================
>      DETAILED EXAMPLE OF FULL AUTH MESSAGE FORMAT
> =================================================================
>      |                         AUTH PAGE 0                           |
> =================================================================
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------+-------+-------+-------+
>      |0 0 0 1 0 0 0 0|0 0 1 1 0 1 0 0| STS-P | ETS-P | H-Alg |0 1 0 0|
> +---------------+---------------+-------+-------+-------+-------+
>      |         Start Timestamp       |         End Timestamp         |
> +-------------------------------+-------------------------------+
>      |                Hash of Previous Auth. Message                 |
> +---------------------------------------------------------------+
>      |                Hash of Current Auth. Message                  |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
> =================================================================
>      |                         AUTH PAGE 1                           |
> =================================================================
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |0 0 0 1 0 0 0 1|0 0 1 1 0 0 1 0| RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
> =================================================================
>      |                         AUTH PAGE 2 - 9                       |
> =================================================================
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |0 0 0 1 0 0 1 0|0 0 0 0 0 1 0 1| RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |0 0 0 1 1 0 0 1|0 0 0 0 0 1 0 1| RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
> =================================================================
>      |                         AUTH PAGE 10                          |
> =================================================================
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |0 0 0 1 1 0 1 0|0 0 0 0 0 0 0 0| RESERVED           |
> +---------------+---------------+-------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
>      |                          Message Hash                         |
> +---------------------------------------------------------------+
> =================================================================
>      |                    AUTH PAGE 11 - 15 (Signature)              |
> =================================================================
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+---------------+-------------------------------+
>      |0 0 0 1 1 0 1 1|0 0 0 0 0 0 0 0| RESERVED           |
> +---------------+---------------+-------------------------------+
>      |            Length             |      Signature Algorithm      |
> +-------------------------------+-------------------------------+
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+-----------------------------------------------+
>      |0 0 0 1 1 1 0 0|                                               |
> +---------------+                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+-----------------------------------------------+
>      |0 0 0 1 1 1 0 1|                                               |
> +---------------+                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+-----------------------------------------------+
>      |0 0 0 1 1 1 1 0|                                               |
> +---------------+                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>       0                   1                   2 3
>       0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
> +---------------+-----------------------------------------------+
>      |0 0 0 1 1 1 1 1|                                               |
> +---------------+                                               |
>      |                         HIP Signature                         |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
> |                                                               |
> |                                                               |
>      | Padding                            |
> |                                                               |
> |                                                               |
> +---------------------------------------------------------------+
>
>
> --
> Tm-rid mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/tm-rid
>

-- 
73's,
Adam T. Wiethuechter

---

From: "Wiethuechter, Adam" <[email-masked]>
Date: Tue, 1 Oct 2019 15:09:47 -0400

All,

Attached is my current revision of the authentication message conforming to
the new v0.8 standard by ASTM.

If my understanding is correct, then we only have 5 pages now on an
authentication message - down from 16. The first page contains some new
fields specified in the standard (Page Count, Timestamp, Length) then 17
bytes of data. The last 4 pages are identical and contain just data,
filling 23 bytes. This gives us a total of 109 bytes of data space.

First I took the HHIT Signature that Bob has proposed and fit it into the
last 3 pages of the format. I'm wondering if the length and algorithm field
from my old format are really needed. We are constrained to HHITs due to
size regardless. They are hold overs from when I "stole" from the HIP
packet format when HIP signatures were being used. It probably is useful so
I left them in.

I then took our list of hashes idea and just inserted them into the format
with what space was left. I show two different forms; a 4 byte hash as
originally planned and a condensed 2 byte hash. The 4 byte hash gives us
(excluding the previous and current authentication message hashes) 7 total
hashes of past messages sent. The 2 byte form gives us 17. Not terrible,
considering our constrain of 109 bytes total.

We lost the start and end timestamp fields, as well as the precision of
said timestamp fields. I removed the "# of hashes" field as the "H-Len"
field can be used to compute the number of hashes left - its fixed to
either 16 bytes of hashes (page 0) or 20 bytes of hashes (pages 1-4).
Seeing as we only really have 2 pages worth of hashes this seems a more
practical use of limited space we have. I'm still not sold on this method,
it could be cumbersome to implement and cause bad implementation in the
long run.

I'm going to reach out to Gabriel Cox about the situation. I may be reading
the code wrong (I do not have the official document to cite - and probably
can't get it due to some restriction). I'm hoping that if we request for a
new Auth Message Type (of type HIP - in parallel with the HHIT/HIP type for
ID) that the old format can be used instead. If so then we have 16 pages of
23 bytes each to work with.

Questions, comments and concerns are most welcome.

On Tue, Oct 1, 2019 at 10:20 AM Wiethuechter, Adam <
[email-masked]> wrote:

> On Fri, Sep 27, 2019 at 12:37 PM Robert Moskowitz <
> [email-masked]> wrote:
>

-- 
73's,
Adam T. Wiethuechter