diff --git a/boot/boot.js b/boot/boot.js index 64cedab77..dad30ec14 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -786,6 +786,7 @@ $tw.utils.Crypto = function() { } return outputText; }; + $tw.sjcl = sjcl; this.setPassword = function(newPassword) { currentPassword = newPassword; this.updateCryptoStateTiddler(); diff --git a/core/modules/filters/crypto.js b/core/modules/filters/crypto.js index 24f1a0df9..0b51281ae 100644 --- a/core/modules/filters/crypto.js +++ b/core/modules/filters/crypto.js @@ -16,7 +16,7 @@ exports.sha256 = function(source,operator,options) { var results = [], length = parseInt(operator.operand,10) || 20, sha256 = function(text) { - return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(text)).substr(0,length); + return $tw.sjcl.codec.hex.fromBits($tw.sjcl.hash.sha256.hash(text)).substr(0,length); }; source(function(tiddler,title) { results.push(sha256(title));