Hi,
The example uses Key Identifier Mode = 3. (STATIC CONST ApiMac_keyIdMode_t secKeyIdMode = ApiMac_keyIdMode_8)
In this mode a "key source" of 8 bytes are sent in all security enabled frames - in addition to a "key index". This adds a lot of overhead to the transmitted frames.
By instead using Key Identifier Mode = 1 (STATIC CONST ApiMac_keyIdMode_t secKeyIdMode = ApiMac_keyIdMode_1), the key source is not transmitted in every frame (solely key index is sent), and instead a default key source is used.
It looks to me that the default key source is: #define JDLLC_DEFAULT_KEY_SOURCE {0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33}
However, there is another struct with almost the same data in it (are they somehow related?):
static CONST ApiMac_keyIdLookupDescriptor_t keyIdLookupList[] = { { /* Key identity data */ { 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x03 }, // (looks like 0x03 is related to: STATIC CONST uint8_t secKeyIndex = 3;) 0x01 /* 9 octets */ // (looks like this is related Key Identifier Mode 2 and 3. } };
I am not sure what the default key source actually is. And what the "key index" is. It looks to me that the final key used for encryption of packets is derived from the key source, key index, (possibly addresses) and the KEY_TABLE_DEFAULT_KEY. Could someone clarify this?
As of now, it looks like the example does not alter the default key source or the key index in transmitted frames. So what is the point of having them in the frames, when they can be defined as constants, more like "Key Identifier Mode = 1"?
And what is the use case for the "key index". STATIC CONST uint8_t secKeyIndex = 3; Can multiple key index values be used in the same operating network?
Thanks