Function ContextR_Open

Source
pub fn ContextR_Open(
    aead_id: AEAD,
    context: (Key, Nonce, u32, Vec<u8>),
    aad: &[u8],
    ct: &[u8],
) -> Result<(Vec<u8>, (Key, Nonce, u32, Vec<u8>)), HpkeError>
Expand description

§Stateful open.

See ContextR.Open for more details.

The recipient’s context can decrypt a ciphertext ct with associated data aad as follows:

def ContextR.Open(aad, ct):
  pt = Open(self.key, self.ComputeNonce(self.seq), aad, ct)
  if pt == OpenError:
    raise OpenError
  self.IncrementSeq()
  return pt