CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
fingerprint.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace cdc::mod_gpg {
7
17bool calculateFingerprintV4(uint8_t curve,
18 const uint8_t* pubkey, size_t pubkey_len,
19 uint32_t created_at,
20 uint8_t out_fp[20]);
21
29bool calculateFingerprintV5(uint8_t curve,
30 const uint8_t* pubkey, size_t pubkey_len,
31 uint32_t created_at,
32 uint8_t out_fp[32]);
33
48size_t buildEcdhPubkeyBody(const uint8_t* pubkey, uint32_t created_at,
49 uint8_t* out, size_t out_size);
50
62bool calculateFingerprintV4Ecdh(const uint8_t* pubkey, uint32_t created_at,
63 uint8_t out_fp[20]);
64
72bool gpgCrossSignDigest(const uint8_t fp_v4[20],
73 const char* user_id,
74 uint8_t out_hash[32]);
75
76} // namespace cdc::mod_gpg
uint8_t curve
uint8_t user_id[FIDO2_USER_ID_MAX_LEN]
bool calculateFingerprintV4(uint8_t curve, const uint8_t *pubkey, size_t pubkey_len, uint32_t created_at, uint8_t out_fp[20])
Compute the RFC 4880 V4 OpenPGP fingerprint (SHA-1, 20 bytes).
bool calculateFingerprintV4Ecdh(const uint8_t *pubkey, uint32_t created_at, uint8_t out_fp[20])
Compute the V4 fingerprint of an ECDH (DEC) subkey.
size_t buildEcdhPubkeyBody(const uint8_t *pubkey, uint32_t created_at, uint8_t *out, size_t out_size)
Serialise an RFC 6637 ECDH Public Key Packet body (algorithm 18).
bool gpgCrossSignDigest(const uint8_t fp_v4[20], const char *user_id, uint8_t out_hash[32])
Build the digest input for a cross-signature.
bool calculateFingerprintV5(uint8_t curve, const uint8_t *pubkey, size_t pubkey_len, uint32_t created_at, uint8_t out_fp[32])
Compute the V5 / RFC 9580 OpenPGP fingerprint (SHA-256, 32 bytes).