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:
Pol Henarejos
2025-03-11 18:43:08 +01:00
parent 2c3fe5bebf
commit 7191cda6d3
2 changed files with 33 additions and 4 deletions

View File

@@ -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;