Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commit bundle support #2688

Merged
merged 18 commits into from
Sep 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split into PublicGroupStateTBS and PGS
smatting authored and pcapriotti committed Sep 19, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 8bb9a8c1e3bc9f87e1940edcb61fdc5afeb6b693
28 changes: 20 additions & 8 deletions libs/wire-api/src/Wire/API/MLS/PublicGroupState.hs
Original file line number Diff line number Diff line change
@@ -26,32 +26,44 @@ import Wire.API.MLS.Group
import Wire.API.MLS.KeyPackage
import Wire.API.MLS.Serialisation

data PublicGroupState = PublicGroupState
data PublicGroupStateTBS = PublicGroupStateTBS
{ pgsVersion :: ProtocolVersion,
pgsCipherSuite :: CipherSuite,
pgsGroupId :: GroupId,
pgsEpoch :: Epoch,
pgsTreeHash :: ByteString,
pgsInterimTranscriptHash :: ByteString,
pgsConfirmedInterimTranscriptHash :: ByteString,
pgsGroupContextExtensions :: ByteString,
pgsOtherExtensions :: ByteString,
pgsExternalPub :: ByteString,
pgsSinger :: KeyPackageRef,
pgsSignature :: ByteString
pgsSigner :: KeyPackageRef
}
deriving stock (Eq, Show, Generic)
deriving stock (Eq, Show)

instance ParseMLS PublicGroupState where
instance ParseMLS PublicGroupStateTBS where
parseMLS =
PublicGroupState
PublicGroupStateTBS
<$> label "pgsVersion" parseMLS
<*> label "pgsCipherSuite" parseMLS
<*> label "pgsGroupId" parseMLS
<*> label "pgsEpoch" parseMLS
<*> label "pgsTreeHash" (parseMLSBytes @Word8)
<*> label "pgsInterimTranscriptHash" (parseMLSBytes @Word8)
<*> label "pgsConfirmedInterimTranscriptHash" (parseMLSBytes @Word8)
<*> label "pgsGroupContextExtensions" (parseMLSBytes @Word32)
<*> label "pgsOtherExtensions" (parseMLSBytes @Word32)
<*> label "pgsExternalPub" (parseMLSBytes @Word16)
<*> label "pgsSinger" parseMLS
<*> label "pgsSignature" (parseMLSBytes @Word16)
<*> label "pgsSigner" parseMLS

data PublicGroupState = PublicGroupState
{ pgTBS :: RawMLS PublicGroupStateTBS,
pgSignature :: ByteString
}
deriving stock (Eq, Show)

instance ParseMLS PublicGroupState where
parseMLS =
PublicGroupState
<$> label "pgTBS" parseMLS
<*> label "pgSignature" (parseMLSBytes @Word16)