/home/abui.../ecc_key.h(3)
π NAME π
/home/abuild/rpmbuild/BUILD/libzpc-legacy-1.5.0-build/libzpc-1.5.0/include/zpc/ecc_key.h β ECC key API. This page is from the libzpc Library Functions Manual, page /home/abui.../ecc_key.h(3), bestie. We're doing elliptic curve key management and it's giving crypto-main-character energy. π₯
β¨ SYNOPSIS β¨
Here's the whole shape of it, no skips:
Macros
#define ZPC_EC_KEY_TYPE_CCA 0x1f
#define ZPC_EC_KEY_TYPE_EP11 7
#define ZPC_EC_KEY_TYPE_PVSECRET 9
#define ZPC_EC_KEY_REENCIPHER_OLD_TO_CURRENT 1
#define ZPC_EC_KEY_REENCIPHER_CURRENT_TO_NEW 2
Enumerations
enum zpc_ec_curve_t { ZPC_EC_CURVE_NOT_SET = -2, ZPC_EC_CURVE_INVALID =
-1, ZPC_EC_CURVE_P256 = 0, ZPC_EC_CURVE_P384, ZPC_EC_CURVE_P521,
ZPC_EC_CURVE_ED25519, ZPC_EC_CURVE_ED448 }
enum zpc_ecsecret_type_t { ZPC_EC_SECRET_TYPE_NOT_SET = -2,
ZPC_EC_SECRET_TYPE_INVALID = -1, ZPC_EC_SECRET_ECDSA_P256 = 0x0011,
ZPC_EC_SECRET_ECDSA_P384 = 0x0012, ZPC_EC_SECRET_ECDSA_P521 =
0x0013, ZPC_EC_SECRET_EDDSA_ED25519 = 0x0014,
ZPC_EC_SECRET_EDDSA_ED448 = 0x0015 }
Functions
int zpc_ec_key_alloc (struct zpc_ec_key **key)
int zpc_ec_key_set_curve (struct zpc_ec_key *key, zpc_ec_curve_t curve)
int zpc_ec_key_set_type (struct zpc_ec_key *key, int type)
int zpc_ec_key_set_flags (struct zpc_ec_key *key, unsigned int flags)
int zpc_ec_key_set_mkvp (struct zpc_ec_key *key, const char *mkvp)
int zpc_ec_key_set_apqns (struct zpc_ec_key *key, const char *apqns[])
int zpc_ec_key_import (struct zpc_ec_key *key, const unsigned char
*seckey, unsigned int seckeylen)
int zpc_ec_key_import_clear (struct zpc_ec_key *key, const unsigned char
*pubkey, unsigned int publen, const unsigned char *privkey, unsigned
int privlen)
int zpc_ec_key_export (struct zpc_ec_key *key, unsigned char *seckey,
unsigned int *seckeylen)
int zpc_ec_key_export_public (struct zpc_ec_key *key, unsigned char
*pubkey, unsigned int *pubkeylen)
int zpc_ec_key_generate (struct zpc_ec_key *key)
int zpc_ec_key_reencipher (struct zpc_ec_key *key, unsigned int reenc)
void zpc_ec_key_free (struct zpc_ec_key **key)
π Detailed Description π
ECC key API. Manage elliptic curve cryptography (ECC) cipher [4] keys.
Definition in file ecc_key.h.
πΈ Macro Definition Documentation πΈ
#define ZPC_EC_KEY_TYPE_CCA 0x1fβ Definition at line 29 of fileecc_key.h.#define ZPC_EC_KEY_TYPE_EP11 7β Definition at line 30 of fileecc_key.h.#define ZPC_EC_KEY_TYPE_PVSECRET 9β Definition at line 31 of fileecc_key.h.#define ZPC_EC_KEY_REENCIPHER_OLD_TO_CURRENT 1β Definition at line 34 of fileecc_key.h.#define ZPC_EC_KEY_REENCIPHER_CURRENT_TO_NEW 2β Definition at line 35 of fileecc_key.h.
π¦ Enumeration Type Documentation π¦
enum zpc_ec_curve_t
Definition at line 37 of file ecc_key.h.
enum zpc_ecsecret_type_t
Definition at line 47 of file ecc_key.h.
π Function Documentation π
π§ zpc_ec_key_alloc
int zpc_ec_key_alloc (struct zpc_ec_key ** key)
Allocate a new EC key object with reference count 1.
keyβ EC key.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_set_curve
int zpc_ec_key_set_curve (struct zpc_ec_key * key, zpc_ec_curve_t curve)
Set the EC curve.
keyβ EC key.curveβ EC curve.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_set_type
int zpc_ec_key_set_type (struct zpc_ec_key * key, int type)
Set the EC key type.
keyβ EC key.typeβZPC_EC_KEY_TYPE_CCAorZPC_EC_KEY_TYPE_EP11.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_set_flags
int zpc_ec_key_set_flags (struct zpc_ec_key * key, unsigned int flags)
Set the EC key flags.
keyβ EC key.flagsβ key flags.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_set_mkvp
int zpc_ec_key_set_mkvp (struct zpc_ec_key * key, const char * mkvp)
Set the EC key Master Key Verification Pattern.
keyβ EC key.mkvpβ master key verification pattern (8bytes for CCA keys,16or32bytes for EP11 keys, only the first16bytes are relevant). This function has no effect for keys of typePVSECRET.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_set_apqns
int zpc_ec_key_set_apqns (struct zpc_ec_key * key, const char * apqns[])
Set the EC key APQNs.
keyβ EC key.apqnsβNULL-terminated APQN list. This function has no effect for keys of typePVSECRET.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_import
int zpc_ec_key_import (struct zpc_ec_key * key, const unsigned char *
seckey, unsigned int seckeylen)
Import an EC secure-key. Depending on the key type (CCA or EP11), the secure key buffer must contain either a CCA secure key token or an EP11 secure key structure. For EP11 type keys, a SubjectPublicKeyInfo encoding (SPKI) of the related public EC key may be appended to the secure key data.
keyβ EC key.seckeyβ EC secure-key.seckeylenβ EC key secure-length [bytes].
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_import_clear
int zpc_ec_key_import_clear (struct zpc_ec_key * key, const unsigned char *
pubkey, unsigned int publen, const unsigned char * privkey, unsigned int
privlen)
Import an EC clear-key pair. At least one of the key parts must be non-NULL. A NULL key part leaves a previously set key part untouched, so it is e.g. possible to first import a secure key using the zpc_ec_key_import() function, and then adding the corresponding public key with a subsequent zpc_ec_import_clear() call. No integrity check is performed on the imported key material, except of a plausibility check on the length of the provided key parts. The application is responsible for providing valid key parts or pairs. Public keys are considered to be the concatenated X and Y values without a leading 0x04 byte that would indicate an uncompressed public key. For PVSECRET type keys it is possible to add the public key to the key object by importing the clear public key. The privkey parm must be NULL and privlen must be 0 when doing this.
keyβ EC key.pubkeyβ an uncompressed EC public key (can beNULL).publenβ EC public key length [bytes].privkeyβ EC private key (can beNULL).privlenβ EC private key length [bytes].
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_export
int zpc_ec_key_export (struct zpc_ec_key * key, unsigned char * seckey,
unsigned int * seckeylen)
Export an EC secure-key. Depending on the key type (CCA or EP11), the secure key is either a CCA secure key token or an EP11 secure key structure. For EP11 type keys, a SubjectPublicKeyInfo encoding (SPKI) of the related public EC key is appended to the secure key data if the key object has a public key.
keyβ EC key.seckeyβ EC secure-key.seckeylenβ secure EC secure-key length [bytes].
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_export_public
int zpc_ec_key_export_public (struct zpc_ec_key * key, unsigned char *
pubkey, unsigned int * pubkeylen)
Export an EC public-key.
keyβ EC key.pubkeyβ uncompressed EC public-key (can beNULLto obtain the length only). The output buffer contains the concatenated X and Y values of the public key without a leading byte indicating an uncompressed key.pubkeylenβ EC public-key length [bytes].
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_generate
int zpc_ec_key_generate (struct zpc_ec_key * key)
Generate an EC secure-key.
keyβ EC key.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_reencipher
int zpc_ec_key_reencipher (struct zpc_ec_key * key, unsigned int reenc)
Reencipher an EC secure-key.
keyβ EC key.reencβZPC_EC_KEY_REENCIPHER_OLD_TO_CURRENTorZPC_EC_KEY_REENCIPHER_CURRENT_TO_NEW. This function is not applicable for pvsecret-type keys and returnsZPC_ERROR_KEYTYPEwhen called for such keys.
Returns: 0 on success. Otherwise, a non-zero error code is returned.
π§ zpc_ec_key_free
void zpc_ec_key_free (struct zpc_ec_key ** key)
Decrease the reference count of an EC key object and free it when the count reaches 0.
keyβ EC key.
π Author π
Generated automatically by Doxygen for libzpc from the source code.
Okay bestie, that's the whole page. Footer energy: libzpc, Version 1.4, page /home/abui.../ecc_key.h(3). Bye π
β¨π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: libzpc-legacy-devel 1.5.0-160000.2.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms