reallyme-crypto-hpke 0.3.16

ReallyMe RFC 9180 HPKE protocol wrapper.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-FileCopyrightText: 2026 ReallyMe LLC
//
// SPDX-License-Identifier: MIT OR Apache-2.0

use super::{allocate_secret_buffer, append_piece, DhKemBufferError};

#[test]
fn authenticated_mode_secret_buffer_never_reallocates_between_dh_outputs(
) -> Result<(), DhKemBufferError> {
    let mut output = allocate_secret_buffer(32, true)?;
    append_piece(&mut output, &[0x11; 32])?;
    let allocation = output.as_ptr();
    append_piece(&mut output, &[0x22; 32])?;

    assert_eq!(output.len(), 64);
    assert_eq!(output.as_ptr(), allocation);
    Ok(())
}