 
 		result = B
 			.subtract(
-				@params.g.modPow(x, @params.N)
+				@k().multiply(
+					@params.g.modPow(x, @params.N)
+				)
 			)
 			.modPow(
 				a.add(


		return result

	# B = (v + g^b) % N
	B: (options) ->
		# Expects v, which should be the client verifier BigInteger, and b,
		# which should be a random BigInteger

		result = transform.pad.toN result, @params
		return result

	# SRP-6 multiplier
	# Returns BigInteger
	k: ->
		result = crypto
			.createHash(@params.hash)
			.update(
				transform.pad.toN(@params.N, @params)
			)
			.update(
				transform.pad.toN(@params.g, @params)
			)
			.digest()

		result = transform.buffer.toBigInteger result
		return result

	K: (options) ->
		S = options.S # Buffer

