MAC sender ID

This commit is contained in:
Rolfe Schmidt
2026-04-01 10:22:54 -07:00
committed by GitHub
parent 3d4e950848
commit 81afdfe2fa
30 changed files with 603 additions and 275 deletions

View File

@@ -9,12 +9,16 @@ import SignalFfi
public func signalEncrypt<Bytes: ContiguousBytes>(
message: Bytes,
for address: ProtocolAddress,
localAddress: ProtocolAddress,
sessionStore: SessionStore,
identityStore: IdentityKeyStore,
now: Date = Date(),
context: StoreContext
) throws -> CiphertextMessage {
return try withAllBorrowed(address, .bytes(message)) { addressHandle, messageBuffer in
return try withAllBorrowed(address, localAddress, .bytes(message)) {
addressHandle,
localAddressHandle,
messageBuffer in
try withSessionStore(sessionStore, context) { ffiSessionStore in
try withIdentityKeyStore(identityStore, context) { ffiIdentityStore in
try invokeFnReturningNativeHandle {
@@ -22,6 +26,7 @@ public func signalEncrypt<Bytes: ContiguousBytes>(
$0,
messageBuffer,
addressHandle.const(),
localAddressHandle.const(),
ffiSessionStore,
ffiIdentityStore,
UInt64(now.timeIntervalSince1970 * 1000)