Subject: Re: [Cbor] [Suit] Code generation from CDDL descriptions

From: Carsten Bormann <[email-masked]>
Date: Tue, 11 Feb 2020 21:03:38 +0100

Hi Øyvind,

This is very interesting!

What is the license on this code?

Grüße, Carsten

> On 2020-02-11, at 20:26, Rønningstad, Øyvind <[email-masked]> wrote:
> 
> Hi everyone.
> 
> I’ve created a python script that parses CDDL descriptions and generates C code that decodes and validates CBOR against the description.
> 
> The repo is here: https://github.com/oyvindronningstad/cddl_gen
> 
> I created it with SUIT in mind, and I’ve added the current (not updated for -03 yet) and earlier manifest formats as test cases in https://github.com/oyvindronningstad/cddl_gen/tree/master/tests/cbor_decode.
> 
> If you want to see it in the wild, I opened a PR to MCUboot for using it in their serial recovery functionality here: https://github..com/JuulLabs-OSS/mcuboot/pull/660                                                                                                                                                                                                                                           
> 
>  
> 
> Some numbers:
> 
> The MCUboot PR reduces the code size by 1100+ bytes compared to using TinyCBOR.
> 
> The current SUIT format can be completely decoded with ~7700 bytes of code, where 652 is from the handwritten library, while the rest comes from the generated code. These numbers are taken from the test case “test2_suit”.
> 
> The generated code decodes the data into a struct. The OuterWrapper (containing everything, except SUIT_Command_Sequences) struct is 808 bytes, while a SUIT_Command_Sequence struct is 3684 bytes.
> 
> Remember that this is for the entire format. My thought is that a SUIT implementation will strip the CDDL to match whatever it supports.
> 
> I have not benchmarked runtime.
> 
>  
> 
> Any feedback, ideas, thoughts, questions are appreciated.
> 
> Thanks,
> 
> Øyvind
> 
> _______________________________________________
> Suit mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/suit

---

From: Brendan Moran <[email-masked]>
Date: Tue, 11 Feb 2020 20:28:43 +0000

Hi Øyvind,

That’s great work! I can’t wait to see what people do with it.

I have also posted a sample parser implementation, but I will send a separate mail about that.

Best Regards,
Brendan

> On 11 Feb 2020, at 20:03, Carsten Bormann <[email-masked]> wrote:
>
> Hi Øyvind,
>

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

---

From: Carsten Bormann <[email-masked]>
Date: Tue, 11 Feb 2020 21:32:23 +0100

> What is the license on this code?

Found the “SPDX-License-Identifier: Apache-2.0”.  Very useful!

Grüße, Carsten