mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-10-01 01:26:10 -04:00
docs for makeX
This commit is contained in:
parent
57da29902f
commit
c085b773b7
13
core/srp.js
13
core/srp.js
@ -17,11 +17,16 @@ sjcl.keyexchange.srp = {
|
||||
return group.g.powermod(x, group.N);
|
||||
},
|
||||
|
||||
/**
|
||||
* Calculates SRP x.
|
||||
* x = SHA1(<salt> | SHA(<username> | ":" | <raw password>)) [RFC 2945]
|
||||
* @param {String} I The username.
|
||||
* @param {String} P The password.
|
||||
* @param {Object} s A bitArray of the salt.
|
||||
* @return {Object} A bitArray of SRP x.
|
||||
*/
|
||||
makeX: function(I, P, s) {
|
||||
var inner;
|
||||
// From RFC 2945:
|
||||
// x = SHA1(<salt> | SHA(<username> | ":" | <raw password>))
|
||||
inner = sjcl.hash.sha1.hash(I + ':' + P);
|
||||
var inner = sjcl.hash.sha1.hash(I + ':' + P);
|
||||
return sjcl.hash.sha1.hash(sjcl.bitArray.concat(s, inner));
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user