initial commit

This commit is contained in:
Filip
2026-03-11 16:06:00 +01:00
parent b3c69053f6
commit 5fd80e6dd6
127 changed files with 39684 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import Foundation
enum Constants {
static let version = "0.8.2"
static let maxMessageBytes = 65536
static let maxImageBytes = 5 * 1024 * 1024 // 5 MB
static let maxFileBytes = 50 * 1024 * 1024 // 50 MB
static let imageChunkSize = 32768 // 32 KB
static let selfDeviceId = "00000000-0000-0000-0000-000000000000"
static let opkReplenishThreshold = 20
static let opkBatchSize = 50
static let spkRotationDays = 7
static let maxSkip = 256
static let maxSenderKeySkip = 256
static let deviceBundleCacheTTL: TimeInterval = 300 // 5 minutes
static let sendReceiveTimeout: TimeInterval = 30
static let reconnectBaseDelay: TimeInterval = 1
static let reconnectMaxDelay: TimeInterval = 30
static let pbkdf2Iterations: UInt32 = 600_000
static let ecp1Magic = Data([0x45, 0x43, 0x50, 0x31]) // "ECP1"
// HKDF info/salt strings matching Python
static let x3dhInfo = "EncryptedChat_X3DH"
static let rootKeyInfo = "EncryptedChat_RootKey"
static let selfEncryptionSalt = "self_encryption"
static let selfEncryptionInfo = "EncryptedChat_SelfKey"
static let localStorageSalt = "local_storage"
static let localStorageInfo = "EncryptedChat_LocalStorage"
static let senderKeyChainInfo = "SenderKeyChain"
// Server connection defaults
static let defaultHost = "127.0.0.1"
static let defaultPort: UInt16 = 9999
}