|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | OPENPGP_ALGO_ECDSA 19 |
| Centralized magic-value constants for the OpenPGP smart-card application. | |
| #define | OPENPGP_ALGO_EDDSA 22 |
| OpenPGP algorithm ID for EdDSA (Ed25519). | |
| #define | OPENPGP_FINGERPRINT_SIZE 20 |
| OpenPGP v4 fingerprint size (SHA-1 digest length, in bytes). | |
| #define | SHA256_DIGEST_SIZE 32 |
| SHA-256 digest output size in bytes (FIPS 180-4). | |
| #define | P256_PUBKEY_SIZE 65 |
| P-256 uncompressed public key size: 0x04 || X(32) || Y(32). | |
| #define | P256_PRIVKEY_SIZE 32 |
| P-256 private key (scalar) size in bytes. | |
| #define | P256_ECDH_SECRET_SIZE 32 |
| P-256 ECDH shared secret size in bytes. | |
| #define | P256_PUBKEY_BITS 520 |
| P-256 public key bit-length (used as MPI bit count). | |
| #define | ED25519_PUBKEY_SIZE 32 |
| Ed25519 raw public key size in bytes. | |
| #define | MPI_HEADER_SIZE 2 |
| OpenPGP MPI header size (2-byte length prefix). | |
| #define | MPI_FULL_SIZE_ED25519 (MPI_HEADER_SIZE + ED25519_PUBKEY_SIZE) |
| Full Ed25519 MPI buffer size: 2 byte length prefix + 32 byte key. | |
| #define | MPI_FULL_SIZE_P256 (MPI_HEADER_SIZE + P256_PUBKEY_SIZE) |
| Full P-256 MPI buffer size: 2 byte length prefix + 65 byte uncompressed key. | |
| #define | PW1_CODE_1 0x81 |
| PW1 reference for signature operations (User PIN). | |
| #define | PW1_CODE_2 0x82 |
| PW1 reference for non-signature operations (User PIN, alt). | |
| #define | PW3_CODE 0x83 |
| PW3 reference (Admin PIN). | |
| #define ED25519_PUBKEY_SIZE 32 |
Ed25519 raw public key size in bytes.
Definition at line 56 of file constants.h.
Referenced by encode_pubkey_with_prefix(), key_fingerprint_generate(), and se_ecc_key_read().
| #define MPI_FULL_SIZE_ED25519 (MPI_HEADER_SIZE + ED25519_PUBKEY_SIZE) |
Full Ed25519 MPI buffer size: 2 byte length prefix + 32 byte key.
Definition at line 64 of file constants.h.
| #define MPI_FULL_SIZE_P256 (MPI_HEADER_SIZE + P256_PUBKEY_SIZE) |
Full P-256 MPI buffer size: 2 byte length prefix + 65 byte uncompressed key.
Definition at line 67 of file constants.h.
| #define MPI_HEADER_SIZE 2 |
OpenPGP MPI header size (2-byte length prefix).
Definition at line 61 of file constants.h.
| #define OPENPGP_ALGO_ECDSA 19 |
Centralized magic-value constants for the OpenPGP smart-card application.
Collects RFC 4880 algorithm identifiers, MPI sizes, OpenPGP card password reference codes, and curve specific cryptographic key/digest sizes that are used across the OpenPGP implementation in mod_gpg.
References:
OpenPGP algorithm ID for ECDSA (RFC 4880 Section 9.1).
Definition at line 26 of file constants.h.
Referenced by cdc::mod_gpg::gpgBuildSignedKeyArmored(), and cdc::mod_gpg::gpgCrossSign().
| #define OPENPGP_ALGO_EDDSA 22 |
OpenPGP algorithm ID for EdDSA (Ed25519).
Definition at line 29 of file constants.h.
Referenced by cdc::mod_gpg::gpgBuildSignedKeyArmored(), and cdc::mod_gpg::gpgCrossSign().
| #define OPENPGP_FINGERPRINT_SIZE 20 |
OpenPGP v4 fingerprint size (SHA-1 digest length, in bytes).
Definition at line 34 of file constants.h.
Referenced by build_do_app_related(), cmd_get_data(), find_put_data_desc(), fp_is_set(), load_state_from_nvs(), openpgp_get_fingerprint(), openpgp_set_key_fingerprint(), and save_state_to_nvs().
| #define P256_ECDH_SECRET_SIZE 32 |
P-256 ECDH shared secret size in bytes.
Definition at line 48 of file constants.h.
Referenced by cmd_pso_decipher().
| #define P256_PRIVKEY_SIZE 32 |
P-256 private key (scalar) size in bytes.
Definition at line 45 of file constants.h.
Referenced by cmd_pso_decipher(), cmd_put_data_odd(), generate_dec_key(), gpg_generate_key(), and read_public_key().
| #define P256_PUBKEY_BITS 520 |
P-256 public key bit-length (used as MPI bit count).
Definition at line 51 of file constants.h.
| #define P256_PUBKEY_SIZE 65 |
P-256 uncompressed public key size: 0x04 || X(32) || Y(32).
Definition at line 42 of file constants.h.
Referenced by cmd_generate_keypair(), cmd_get_data(), cmd_internal_authenticate(), cmd_pso_cds(), cmd_pso_decipher(), encode_pubkey_with_prefix(), gpg_export_pubkey_pem(), gpg_generate_key(), read_public_key(), and se_ecc_key_read().
| #define PW1_CODE_1 0x81 |
PW1 reference for signature operations (User PIN).
Definition at line 72 of file constants.h.
Referenced by cmd_change_reference_data(), cmd_reset_retry_counter(), and cmd_verify().
| #define PW1_CODE_2 0x82 |
PW1 reference for non-signature operations (User PIN, alt).
Definition at line 75 of file constants.h.
Referenced by cmd_verify().
| #define PW3_CODE 0x83 |
PW3 reference (Admin PIN).
Definition at line 78 of file constants.h.
Referenced by cmd_change_reference_data(), and cmd_verify().
| #define SHA256_DIGEST_SIZE 32 |
SHA-256 digest output size in bytes (FIPS 180-4).
Definition at line 37 of file constants.h.
Referenced by cmd_pso_cds(), key_fingerprint_from_pubkey(), and cdc::core::verify_payload_signature().