> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function forgery_protected_eph_pk

Module: `noir_aztec::messages::delivery::handshake`

```rust
pub fn forgery_protected_eph_pk(
    eph_pk: EmbeddedCurvePoint,
    recipient_point: EmbeddedCurvePoint,
) -> EmbeddedCurvePoint
```

Applies the forgery protection to a discovered ephemeral key.

The recipient never holds the raw `S` (its side of the ECDH happens inside PXE), so it cannot call [`protect_from_forgery`](/aztec-nr-api/v6.0.0/noir_aztec/messages/delivery/handshake/fn.protect_from_forgery.md) on the secret directly. The protection is a scalar multiplication and therefore commutes through ECDH: protecting the ephemeral key before the shared-secret derivation yields the same protected secret `S'` the sender stored:

protected_eph_pk = forgery_protected_eph_pk(eph_pk, recipient_point) = k \* eph_pk recipient_priv \* protected_eph_pk = recipient_priv \* (k \* eph_pk) = k \* (recipient_priv \* eph_pk) = k \* S = S'
