Closed podhrmic closed 6 years ago
The crypto should be a part of pprzlink
A good way to do it would be to make a no-std version of a crypto-lib, and then either link it with the pprzlink for embedded application, or have it as a rust crate in rustlink.
Encryption
The encryption is optional and does not depend on the scheduling described above. The encryption scheme is based on Galois Embedded Crypto and involves 16 bytes of overhead after the initial key exchange.
The encrypted pprz message v1.0 looks like this (see wiki for more details):
and v2.0 like this:
Messages
And we indeed need to define new messages for the key exchange:
Telemetry class:
Datalink class:
Implementation
The generated code needs to know when to insert the extra counter and tag, but we might be able to change/modify the message generators and then handle d/encryption in the autopilot code.
Other option is to include crypto inside pprzlink and have some sort of state machine to keep track of it.
Because everything until
DlCheckAndParse()
is the same, we need to (tentatively):CRYPTO ON/OFF
)DlCheckAndParse
to handle encryption and key exchangesend_msg_XXX
functions (either weak link against paparazzi code, or include crypto