# Function ring::aead::seal_in_place [−] [src]

    pub fn seal_in_place(
        key: &SealingKey,
        nonce: &[u8],
        ad: &[u8],
        in_out: &mut [u8],
        out_suffix_capacity: usize
    ) -> Result<usize, Unspecified>

Encrypts and signs (“seals”) data in place.

`nonce` must be unique for every use of the key to seal data.

The input is `in_out[..(in_out.len() - out_suffix_capacity)]`; i.e. the input is the part of `in_out` that precedes the suffix. When `seal_in_place()` returns `Ok(out_len)`, the encrypted and signed output is `in_out[..out_len]`; i.e. the output has been written over input and at least part of the data reserved for the suffix. (The input/output buffer is expressed this way because Rust's type system does not allow us to have two slices, one mutable and one immutable, that reference overlapping memory at the same time.)

`out_suffix_capacity` must be at least `key.algorithm().tag_len()`. See also `MAX_TAG_LEN`.

`ad` is the additional authenticated data, if any.

C analog: `EVP_AEAD_CTX_seal`.

Go analog: `AEAD.Seal`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)