|
1696 | 1696 | */
|
1697 | 1697 | #define PSA_KEY_DERIVATION_INPUT_SEED ((psa_key_derivation_step_t)0x0204)
|
1698 | 1698 |
|
| 1699 | +/** Extract the curve from an elliptic curve key type. */ |
| 1700 | +#define PSA_KEY_TYPE_ECC_GET_FAMILY(type) \ |
| 1701 | + ((psa_ecc_family_t) (PSA_KEY_TYPE_IS_ECC(type) ? \ |
| 1702 | + ((type) & PSA_KEY_TYPE_ECC_CURVE_MASK) : \ |
| 1703 | + 0)) |
| 1704 | + |
| 1705 | + |
| 1706 | +/** SEC Koblitz curves over prime fields. |
| 1707 | + * |
| 1708 | + * This family comprises the following curves: |
| 1709 | + * secp192k1, secp224k1, secp256k1. |
| 1710 | + * They are defined in _Standards for Efficient Cryptography_, |
| 1711 | + * _SEC 2: Recommended Elliptic Curve Domain Parameters_. |
| 1712 | + * https://www.secg.org/sec2-v2.pdf |
| 1713 | + */ |
| 1714 | +#define PSA_ECC_FAMILY_SECP_K1 ((psa_ecc_family_t) 0x17) |
| 1715 | + |
| 1716 | +/** SEC random curves over prime fields. |
| 1717 | + * |
| 1718 | + * This family comprises the following curves: |
| 1719 | + * secp192k1, secp224r1, secp256r1, secp384r1, secp521r1. |
| 1720 | + * They are defined in _Standards for Efficient Cryptography_, |
| 1721 | + * _SEC 2: Recommended Elliptic Curve Domain Parameters_. |
| 1722 | + * https://www.secg.org/sec2-v2.pdf |
| 1723 | + */ |
| 1724 | +#define PSA_ECC_FAMILY_SECP_R1 ((psa_ecc_family_t) 0x12) |
| 1725 | +/* SECP160R2 (SEC2 v1, obsolete) */ |
| 1726 | +#define PSA_ECC_FAMILY_SECP_R2 ((psa_ecc_family_t) 0x1b) |
| 1727 | + |
| 1728 | +/** SEC Koblitz curves over binary fields. |
| 1729 | + * |
| 1730 | + * This family comprises the following curves: |
| 1731 | + * sect163k1, sect233k1, sect239k1, sect283k1, sect409k1, sect571k1. |
| 1732 | + * They are defined in _Standards for Efficient Cryptography_, |
| 1733 | + * _SEC 2: Recommended Elliptic Curve Domain Parameters_. |
| 1734 | + * https://www.secg.org/sec2-v2.pdf |
| 1735 | + */ |
| 1736 | +#define PSA_ECC_FAMILY_SECT_K1 ((psa_ecc_family_t) 0x27) |
| 1737 | + |
| 1738 | +/** SEC random curves over binary fields. |
| 1739 | + * |
| 1740 | + * This family comprises the following curves: |
| 1741 | + * sect163r1, sect233r1, sect283r1, sect409r1, sect571r1. |
| 1742 | + * They are defined in _Standards for Efficient Cryptography_, |
| 1743 | + * _SEC 2: Recommended Elliptic Curve Domain Parameters_. |
| 1744 | + * https://www.secg.org/sec2-v2.pdf |
| 1745 | + */ |
| 1746 | +#define PSA_ECC_FAMILY_SECT_R1 ((psa_ecc_family_t) 0x22) |
| 1747 | + |
| 1748 | +/** SEC additional random curves over binary fields. |
| 1749 | + * |
| 1750 | + * This family comprises the following curve: |
| 1751 | + * sect163r2. |
| 1752 | + * It is defined in _Standards for Efficient Cryptography_, |
| 1753 | + * _SEC 2: Recommended Elliptic Curve Domain Parameters_. |
| 1754 | + * https://www.secg.org/sec2-v2.pdf |
| 1755 | + */ |
1699 | 1756 | /**@}*/
|
| 1757 | +#define PSA_ECC_FAMILY_SECT_R2 ((psa_ecc_family_t) 0x2b) |
| 1758 | + |
| 1759 | +/** Brainpool P random curves. |
| 1760 | + * |
| 1761 | + * This family comprises the following curves: |
| 1762 | + * brainpoolP160r1, brainpoolP192r1, brainpoolP224r1, brainpoolP256r1, |
| 1763 | + * brainpoolP320r1, brainpoolP384r1, brainpoolP512r1. |
| 1764 | + * It is defined in RFC 5639. |
| 1765 | + */ |
| 1766 | +#define PSA_ECC_FAMILY_BRAINPOOL_P_R1 ((psa_ecc_family_t) 0x30) |
| 1767 | + |
| 1768 | +/** Curve25519 and Curve448. |
| 1769 | + * |
| 1770 | + * This family comprises the following Montgomery curves: |
| 1771 | + * - 255-bit: Bernstein et al., |
| 1772 | + * _Curve25519: new Diffie-Hellman speed records_, LNCS 3958, 2006. |
| 1773 | + * The algorithm #PSA_ALG_ECDH performs X25519 when used with this curve. |
| 1774 | + * - 448-bit: Hamburg, |
| 1775 | + * _Ed448-Goldilocks, a new elliptic curve_, NIST ECC Workshop, 2015. |
| 1776 | + * The algorithm #PSA_ALG_ECDH performs X448 when used with this curve. |
| 1777 | + */ |
| 1778 | +#define PSA_ECC_FAMILY_MONTGOMERY ((psa_ecc_family_t) 0x41) |
1700 | 1779 |
|
1701 | 1780 | #endif /* PSA_CRYPTO_VALUES_H */
|
0 commit comments