Function get_shared_secret
pub unconstrained fn get_shared_secret(
address: AztecAddress,
ephPk: EmbeddedCurvePoint,
contract_address: AztecAddress,
) -> Field
pub unconstrained fn get_shared_secret(
address: AztecAddress,
ephPk: EmbeddedCurvePoint,
contract_address: AztecAddress,
) -> Field
Returns an app-siloed shared secret between
addressand someone who knows the secret key behind an ephemeral public keyephPk.The returned value is a Field
s_app, computed as:where
contractis the address of the calling contract. The oracle host validates this matches its execution context.Without app-siloing, a malicious contract could call this oracle with public information (address, ephPk) and obtain the same raw secret as the legitimate contract, enabling cross-contract decryption. By including the contract address in the hash, each contract receives a different
s_app, preventing this attack.Callers derive indexed subkeys from
s_appviaderive_shared_secret_subkey.