mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2024-03-22 13:10:41 +08: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);
|
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) {
|
makeX: function(I, P, s) {
|
||||||
var inner;
|
var inner = sjcl.hash.sha1.hash(I + ':' + P);
|
||||||
// From RFC 2945:
|
|
||||||
// x = SHA1(<salt> | SHA(<username> | ":" | <raw password>))
|
|
||||||
inner = sjcl.hash.sha1.hash(I + ':' + P);
|
|
||||||
return sjcl.hash.sha1.hash(sjcl.bitArray.concat(s, inner));
|
return sjcl.hash.sha1.hash(sjcl.bitArray.concat(s, inner));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user