Skip to content

Commit a3b0fca

Browse files
committed
Don't automatically pad sharedSecret
1 parent 5e00a2c commit a3b0fca

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/SRP/client.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public extension SRPClient {
198198
// calculate S = (B - k*g^x)^(a+u*x)
199199
let S = (serverPublicKey.number - configuration.k * configuration.g.power(x, modulus: configuration.N)).power(clientKeys.private.number + u * x, modulus: configuration.N)
200200

201-
return .init(S, padding: configuration.sizeN)
201+
return SRPKey(S)
202202
}
203203

204204
/// generate password verifier

Sources/SRP/server.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public struct SRPServer<H: HashFunction> {
5959
// calculate S
6060
let S = ((clientPublicKey.number * verifier.number.power(u, modulus: configuration.N)).power(serverKeys.private.number, modulus: configuration.N))
6161

62-
return SRPKey(S, padding: configuration.sizeN)
62+
return SRPKey(S)
6363
}
6464

6565
/// verify proof that client has shared secret and return a server verification proof. If verification fails a `invalidClientCode` error is thrown

0 commit comments

Comments
 (0)