code: function client_getS(params, k_num, x_num, a_num, B_num, u_num) {
    assertIsBigInteger(k_num);
    assertIsBigInteger(x_num);
    assertIsBigInteger(a_num);
    assertIsBigInteger(B_num);
    assertIsBigInteger(u_num);
    if((zero.compareTo(B_num) > 0) && (N.compareTo(B_num) < 0))
      throw new Error("invalid server-supplied 'B', must be 1..N-1");
    var S_num = B_num.subtract(k_num.multiply(params.g.modPow(x_num, params.N))).modPow(a_num.add(u_num.multiply(x_num)), params.N).mod(params.N);
  
    return padToN(S_num, params);
  }
docs: /*
  The TLS premaster secret as calculated by the client
  
  params:
  params (obj)     group parameters, with .N, .g, .hash
  salt (buffer)    salt (read from server)
  I (buffer)       user identity (read from user)
  P (buffer)       user password (read from user)
  a (bignum)       ephemeral private key (generated for session)
  B (bignum)       server ephemeral public key (read from server)
  
  returns: buffer