mirror of
https://github.com/polhenarejos/pico-keys-sdk
synced 2026-05-28 09:01:24 +02:00
Add PHY option to enable specific curves. It's in the app side the management.
Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
@@ -54,6 +54,10 @@ int phy_serialize_data(const phy_data_t *phy, uint8_t *data, uint16_t *len) {
|
||||
p += strlen(phy->usb_product);
|
||||
*p++ = '\0';
|
||||
}
|
||||
if (phy->enabled_curves_present) {
|
||||
*p++ = PHY_ENABLED_CURVES;
|
||||
p += put_uint32_t_be(phy->enabled_curves, p);
|
||||
}
|
||||
|
||||
*len = p - data;
|
||||
return PICOKEY_OK;
|
||||
@@ -96,6 +100,11 @@ int phy_unserialize_data(const uint8_t *data, uint16_t len, phy_data_t *phy) {
|
||||
phy->usb_product_present = true;
|
||||
p += strlen(phy->usb_product) + 1;
|
||||
break;
|
||||
case PHY_ENABLED_CURVES:
|
||||
phy->enabled_curves = get_uint32_t_be(p);
|
||||
p += sizeof(uint32_t);
|
||||
phy->enabled_curves_present = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return PICOKEY_OK;
|
||||
|
||||
Reference in New Issue
Block a user