Skip to main content

6.2. Secret Export

6.2. Secret Export

Applications may also want to derive a secret known only to a given recipient. This section provides templates for HPKE APIs that implement stateless "single-shot" secret export using APIs specified in Section 5.3:

def SendExport<MODE>(pkR, info, exporter_context, L, ...):
enc, ctx = Setup<MODE>S(pkR, info, ...)
exported = ctx.Export(exporter_context, L)
return enc, exported

def ReceiveExport<MODE>(enc, skR, info, exporter_context, L, ...):
ctx = Setup<MODE>R(enc, skR, info, ...)
return ctx.Export(exporter_context, L)

As in Section 6.1, the MODE template parameter is one of Base, PSK, Auth, or AuthPSK. The optional parameters indicated by "..." depend on MODE and may be empty.