Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Sources/DistributedMLS/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import Foundation

extension DiMLS {
public protocol Client: Actor, Archivable {
public protocol Client: Archivable {
associatedtype Credential: DiMLSCredential
associatedtype Group: DiGroup
where Group.WelcomeOutput == WelcomeOutput, Group.Credential == Credential
where Group.Receiver.WelcomeOutput == WelcomeOutput, Group.Credential == Credential
associatedtype WelcomeOutput: WelcomeOutputInterface

static func create(credential: Credential) throws -> Self
Expand Down
21 changes: 20 additions & 1 deletion Sources/DistributedMLS/Group/CommitInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
extension DiMLS {
public struct CommitInput<C: DiMLSCredential> {
public var localOps: Set<DiMLSOperations<C>>
public var followOps: Set<DiMLSOperations<C>>
public var followOps: [PendingState<C>.FollowOp]

public var dependencies: [KeyedDependency]

Expand Down Expand Up @@ -45,3 +45,22 @@ extension DiMLS {
}
}
}

//extension DiMLS {
// //lookup table that we pass from total group to a client to process
// public typealias AvailableDependendencies = [ReferenceID: [EpochID: KeyedDependency]]
//}
//extension DiMLS.TotalGroup {
// public var keyedDependencies: DiMLS.AvailableDependendencies {
// members.compactMapValues {
// guard case .claimed(let epochs) = $0 else {
// return nil
// }
// return epochs.reduce(into: [:]) { result, epoch in
// if let keyedDependency = epoch.keyedDependency {
// result[epoch.epoch] = keyedDependency
// }
// }
// }
// }
//}
29 changes: 22 additions & 7 deletions Sources/DistributedMLS/Group/Decrypt/DecryptOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,37 @@
import Foundation

extension DiMLS {
public struct DecryptOutput: Sendable {
let appPlaintext: AppPlaintext
let controlMessage: ControlMessage?
}
public struct DecryptOutput<C: DiMLSCredential>: Sendable {
public let appPlaintext: AppPlaintext
public let commitResult: CommitResult<C>?

public struct ControlMessage: Sendable {
public init(
appPlaintext: AppPlaintext,
commitResult: CommitResult<C>?
) {
self.appPlaintext = appPlaintext
self.commitResult = commitResult
}
}

public struct CommitResult<C: DiMLSCredential>: Sendable {
public let added: [C]
public let keyedDependency: KeyedDependency
public init(added: [C], keyedDependency: KeyedDependency) {
self.added = added
self.keyedDependency = keyedDependency
}
}

public struct AppPlaintext: Sendable {
public struct AppPlaintext: Sendable, Equatable {
public let application: Data
public let authenticating: Data
public let sender: Data

public init(application: Data, authenticating: Data) {
public init(application: Data, authenticating: Data, sender: Data) {
self.application = application
self.authenticating = authenticating
self.sender = sender
}
}
}
Loading
Loading