openmls/test_utils/frankenstein/
commit.rs1use tls_codec::*;
2
3use super::{FrankenLeafNode, FrankenProposal};
4
5#[derive(
6 Debug, Clone, PartialEq, Eq, TlsSerialize, TlsDeserialize, TlsDeserializeBytes, TlsSize,
7)]
8pub struct FrankenCommit {
9 pub proposals: Vec<FrankenProposalOrRef>,
10 pub path: Option<FrankenUpdatePathIn>,
11}
12
13#[derive(
14 Debug, Clone, PartialEq, Eq, TlsSerialize, TlsDeserialize, TlsDeserializeBytes, TlsSize,
15)]
16#[repr(u8)]
17#[allow(clippy::large_enum_variant)]
18pub enum FrankenProposalOrRef {
19 #[tls_codec(discriminant = 1)]
20 Proposal(FrankenProposal),
21 Reference(VLBytes),
22}
23
24#[derive(
25 Debug, Clone, PartialEq, Eq, TlsSerialize, TlsDeserialize, TlsDeserializeBytes, TlsSize,
26)]
27pub struct FrankenUpdatePathIn {
28 pub leaf_node: FrankenLeafNode,
29 pub nodes: Vec<FrankenUpdatePathNode>,
30}
31
32#[derive(
33 Debug, Clone, PartialEq, Eq, TlsSerialize, TlsDeserialize, TlsDeserializeBytes, TlsSize,
34)]
35pub struct FrankenUpdatePathNode {
36 pub public_key: VLBytes,
37 pub encrypted_path_secrets: Vec<FrankenHpkeCiphertext>,
38}
39
40#[derive(
41 Debug, Clone, PartialEq, Eq, TlsSerialize, TlsDeserialize, TlsDeserializeBytes, TlsSize,
42)]
43pub struct FrankenHpkeCiphertext {
44 pub kem_output: VLBytes,
45 pub ciphertext: VLBytes,
46}