Skip to content

Commit dd27c12

Browse files
authored
Split clientProof calculation as too long for swift 5.3 (#4)
1 parent 4ee49ca commit dd27c12

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/SRP/srp.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ public struct SRP<H: HashFunction> {
3131
// M = H(H(N)^ H(g)) | H(username) | salt | client key | server key | shared secret)
3232
let N_xor_g = [UInt8](H.hash(data: configuration.N.bytes)) ^ [UInt8](H.hash(data: configuration.g.bytes))
3333
let hashUser = H.hash(data: [UInt8](username.utf8))
34-
let M = H.hash(data: [UInt8](N_xor_g) + hashUser + salt + clientPublicKey.bytes + serverPublicKey.bytes + hashSharedSecret)
34+
let M1 = [UInt8](N_xor_g) + hashUser + salt
35+
let M2 = clientPublicKey.bytes + serverPublicKey.bytes + hashSharedSecret
36+
let M = H.hash(data: M1 + M2)
3537
return [UInt8](M)
3638
}
3739

0 commit comments

Comments
 (0)