We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ee49ca commit dd27c12Copy full SHA for dd27c12
Sources/SRP/srp.swift
@@ -31,7 +31,9 @@ public struct SRP<H: HashFunction> {
31
// M = H(H(N)^ H(g)) | H(username) | salt | client key | server key | shared secret)
32
let N_xor_g = [UInt8](H.hash(data: configuration.N.bytes)) ^ [UInt8](H.hash(data: configuration.g.bytes))
33
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)
+ let M1 = [UInt8](N_xor_g) + hashUser + salt
35
+ let M2 = clientPublicKey.bytes + serverPublicKey.bytes + hashSharedSecret
36
+ let M = H.hash(data: M1 + M2)
37
return [UInt8](M)
38
}
39
0 commit comments