API Docs for: 1.0.8
Show:

File: client/lib/pbkdf2.js

  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. define(['sjcl'], function (sjcl, P) {
  5. 'use strict';
  6.  
  7. /**
  8. * @class pbkdf2
  9. * @constructor
  10. */
  11. var pbkdf2 = {
  12. /**
  13. * @method derive
  14. * @param {bitArray} input The password hex buffer.
  15. * @param {bitArray} salt The salt string buffer.
  16. * @return {int} iterations the derived key bit array.
  17. */
  18. derive: function(input, salt, iterations, len) {
  19. var result = sjcl.misc.pbkdf2(input, salt, iterations, len, sjcl.misc.hmac);
  20. return Promise.resolve(result);
  21. }
  22. };
  23.  
  24. return pbkdf2;
  25.  
  26. });
  27.