-
Notifications
You must be signed in to change notification settings - Fork 84
Description
In order to implement OpenPGP's X25519 decryption completely on the token, we need CKM_CONCATENATE_DATA_AND_BASE
. RFC 9580 says:
See Section 6.1 of [RFC7748] for more details on the computation of the ephemeral public key and the shared secret. The HMAC-based Key Derivation Function (HKDF) [RFC5869] is then used with SHA256 [RFC6234] and an info parameter of "OpenPGP X25519" and no salt. The input of HKDF is the concatenation of the following three values:
32 octets of the ephemeral X25519 public key from this packet.
32 octets of the recipient public key material.
32 octets of the shared secret.
Right now, we extract the shared secret, prepend the public keys and load the result back onto the token. Using CKM_CONCATENATE_DATA_AND_BASE
, this could be done entirely on token.