Change key types to a 16-bit encoding
All key types now have an encoding on 32 bits where the bottom 16 bits
are zero. Change to using 16 bits only.
Keep 32 bits for key types in storage, but move the significant
half-word from the top to the bottom.
Likewise, change EC curve and DH group families from 32 bits out of
which the top 8 and bottom 16 bits are zero, to 8 bits only.
Reorder psa_core_key_attributes_t to avoid padding.
diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h
index fa93111..817b3d2 100644
--- a/include/psa/crypto_extra.h
+++ b/include/psa/crypto_extra.h
@@ -329,7 +329,7 @@
* string. The length of the byte string is the length of the base prime `p`
* in bytes.
*/
-#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x60040000)
+#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x6004)
/** DSA key pair (private and public key).
*
@@ -347,7 +347,7 @@
* Add 1 to the resulting integer and use this as the private key *x*.
*
*/
-#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x70040000)
+#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x7004)
/** Whether a key type is an DSA key (pair or public-only). */
#define PSA_KEY_TYPE_IS_DSA(type) \
@@ -418,9 +418,7 @@
* #PSA_KEY_TYPE_DH_KEY_PAIR(#PSA_DH_GROUP_CUSTOM), the group data comes
* from domain parameters set by psa_set_key_domain_parameters().
*/
-/* This value is a deprecated value meaning an explicit curve in the IANA
- * registry. */
-#define PSA_DH_GROUP_CUSTOM ((psa_dh_group_t) 0xff01)
+#define PSA_DH_GROUP_CUSTOM ((psa_dh_group_t) 0x80)
/**