Function get_shared_secrets
pub unconstrained fn get_shared_secrets(
address: AztecAddress,
eph_pks: EphemeralArray<EmbeddedCurvePoint>,
contract_address: AztecAddress,
) -> EphemeralArray<Field>
pub unconstrained fn get_shared_secrets(
address: AztecAddress,
eph_pks: EphemeralArray<EmbeddedCurvePoint>,
contract_address: AztecAddress,
) -> EphemeralArray<Field>
Returns app-siloed shared secrets between
addressand someone who knows the secret keys behind the given ephemeral public keys.Each returned Field
s_appis 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.Returns an empty array when the PXE does not hold
address's keys and therefore cannot derive any secrets. This happens when syncing the scope of an address the PXE does not control, and is an expected outcome rather than an error. Any other response length mismatch is a malformed oracle response.