ica_x25519_derive

Purpose

Derive a shared secret between the private key of party A stored in the context, and the given public key of party B. Requires the context to hold the private key of party A.

Format


int ica_x25519_key_derive(ICA_X25519_CTX *ctx, 
  unsigned char shared_secret[32],
  const unsigned char peer_pub[32]);

Required hardware support

The processor must have the MSA9 facility (STFLE bit 155) installed which is available starting with IBM z15® systems.

Parameters

ICA_X25519_CTX *ctx
Pointer to an X25519 context.
unsigned char shared_secret[32]
Buffer to return the derived shared secret between party A and party B.
const unsigned char peer_pub[32]
Buffer containing the given public key of party B as input.

Return codes

0
Success
-1
If at least one invalid parameter is given or MSA9 is not available, or the key derivation failed.

For return codes indicating exceptions, see Return codes.