@ -1,4 +1,4 @@
"use strict" ; var sjcl = { cipher : { } , hash : { } , keyexchange : { } , mode : { } , misc : { } , codec : { } , exception : { corrupt : function ( a ) { this . toString = function ( ) { return "CORRUPT: " + this . message } ; this . message = a } , invalid : function ( a ) { this . toString = function ( ) { return "INVALID: " + this . message } ; this . message = a } , bug : function ( a ) { this . toString = function ( ) { return "BUG: " + this . message } ; this . message = a } , notReady : function ( a ) { this . toString = function ( ) { return " GENERATOR NOT READY: "+ this . message } ; this . message = a } } } ;
"use strict" ; var sjcl = { cipher : { } , hash : { } , keyexchange : { } , mode : { } , misc : { } , codec : { } , exception : { corrupt : function ( a ) { this . toString = function ( ) { return "CORRUPT: " + this . message } ; this . message = a } , invalid : function ( a ) { this . toString = function ( ) { return "INVALID: " + this . message } ; this . message = a } , bug : function ( a ) { this . toString = function ( ) { return "BUG: " + this . message } ; this . message = a } , notReady : function ( a ) { this . toString = function ( ) { return " NOT READY: "+ this . message } ; this . message = a } } } ;
sjcl . cipher . aes = function ( a ) { this . p [ 0 ] [ 0 ] [ 0 ] || this . M ( ) ; var b , c , d , e , f = this . p [ 0 ] [ 4 ] , g = this . p [ 1 ] ; b = a . length ; var h = 1 ; if ( b !== 4 && b !== 6 && b !== 8 ) throw new sjcl . exception . invalid ( "invalid aes key size" ) ; this . c = [ d = a . slice ( 0 ) , e = [ ] ] ; for ( a = b ; a < 4 * b + 28 ; a ++ ) { c = d [ a - 1 ] ; if ( a % b === 0 || b === 8 && a % b === 4 ) { c = f [ c >>> 24 ] << 24 ^ f [ c >> 16 & 255 ] << 16 ^ f [ c >> 8 & 255 ] << 8 ^ f [ c & 255 ] ; if ( a % b === 0 ) { c = c << 8 ^ c >>> 24 ^ h << 24 ; h = h << 1 ^ ( h >> 7 ) * 283 } } d [ a ] = d [ a - b ] ^ c } for ( b = 0 ; a ; b ++ , a -- ) { c = d [ b & 3 ? a : a - 4 ] ; e [ b ] = a <= 4 || b < 4 ? c : g [ 0 ] [ f [ c >>> 24 ] ] ^ g [ 1 ] [ f [ c >> 16 & 255 ] ] ^ g [ 2 ] [ f [ c >> 8 & 255 ] ] ^
g [ 3 ] [ f [ c & 255 ] ] } } ;
sjcl . cipher . aes . prototype = { encrypt : function ( a ) { return this . U ( a , 0 ) } , decrypt : function ( a ) { return this . U ( a , 1 ) } , p : [ [ [ ] , [ ] , [ ] , [ ] , [ ] ] , [ [ ] , [ ] , [ ] , [ ] , [ ] ] ] , M : function ( ) { var a = this . p [ 0 ] , b = this . p [ 1 ] , c = a [ 4 ] , d = b [ 4 ] , e , f , g , h = [ ] , i = [ ] , j , k , l , m ; for ( e = 0 ; e < 0x100 ; e ++ ) i [ ( h [ e ] = e << 1 ^ ( e >> 7 ) * 283 ) ^ e ] = e ; for ( f = g = 0 ; ! c [ f ] ; f ^= j || 1 , g = i [ g ] || 1 ) { l = g ^ g << 1 ^ g << 2 ^ g << 3 ^ g << 4 ; l = l >> 8 ^ l & 255 ^ 99 ; c [ f ] = l ; d [ l ] = f ; k = h [ e = h [ j = h [ f ] ] ] ; m = k * 0x1010101 ^ e * 0x10001 ^ j * 0x101 ^ f * 0x1010100 ; k = h [ l ] * 0x101 ^ l * 0x1010100 ; for ( e = 0 ; e < 4 ; e ++ ) { a [ e ] [ f ] = k = k << 24 ^ k >>> 8 ; b [ e ] [ l ] = m = m << 24 ^ m >>> 8 } } for ( e =
@ -10,13 +10,13 @@ a[d]^b[d];return c===0},fa:function(a,b,c,d){var e;e=0;if(d===undefined)d=[];for
sjcl . codec . utf8String = { fromBits : function ( a ) { var b = "" , c = sjcl . bitArray . bitLength ( a ) , d , e ; for ( d = 0 ; d < c / 8 ; d ++ ) { if ( ( d & 3 ) === 0 ) e = a [ d / 4 ] ; b += String . fromCharCode ( e >>> 24 ) ; e <<= 8 } return decodeURIComponent ( escape ( b ) ) } , toBits : function ( a ) { a = unescape ( encodeURIComponent ( a ) ) ; var b = [ ] , c , d = 0 ; for ( c = 0 ; c < a . length ; c ++ ) { d = d << 8 | a . charCodeAt ( c ) ; if ( ( c & 3 ) === 3 ) { b . push ( d ) ; d = 0 } } c & 3 && b . push ( sjcl . bitArray . partial ( 8 * ( c & 3 ) , d ) ) ; return b } } ;
sjcl . codec . hex = { fromBits : function ( a ) { var b = "" , c ; for ( c = 0 ; c < a . length ; c ++ ) b += ( ( a [ c ] | 0 ) + 0xf00000000000 ) . toString ( 16 ) . substr ( 4 ) ; return b . substr ( 0 , sjcl . bitArray . bitLength ( a ) / 4 ) } , toBits : function ( a ) { var b , c = [ ] , d ; a = a . replace ( /\s|0x/g , "" ) ; d = a . length ; a += "00000000" ; for ( b = 0 ; b < a . length ; b += 8 ) c . push ( parseInt ( a . substr ( b , 8 ) , 16 ) ^ 0 ) ; return sjcl . bitArray . clamp ( c , d * 4 ) } } ;
sjcl . codec . base64 = { R : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" , fromBits : function ( a , b ) { var c = "" , d , e = 0 , f = sjcl . codec . base64 . R , g = 0 , h = sjcl . bitArray . bitLength ( a ) ; for ( d = 0 ; c . length * 6 < h ; ) { c += f . charAt ( ( g ^ a [ d ] >>> e ) >>> 26 ) ; if ( e < 6 ) { g = a [ d ] << 6 - e ; e += 26 ; d ++ } else { g <<= 6 ; e -= 6 } } for ( ; c . length & 3 && ! b ; ) c += "=" ; return c } , toBits : function ( a ) { a = a . replace ( /\s|=/g , "" ) ; var b = [ ] , c , d = 0 , e = sjcl . codec . base64 . R , f = 0 , g ; for ( c = 0 ; c < a . length ; c ++ ) { g = e . indexOf ( a . charAt ( c ) ) ; if ( g < 0 ) throw new sjcl . exception . invalid ( "this isn't base64!" ) ;
if ( d > 26 ) { d -= 26 ; b . push ( f ^ g >>> d ) ; f = g << 32 - d } else { d += 6 ; f ^= g << 32 - d } } d & 56 && b . push ( sjcl . bitArray . partial ( d & 56 , f , 1 ) ) ; return b } } ; sjcl . hash . sha1 = function ( a ) { if ( a ) { this . h = a . h . slice ( 0 ) ; this . e = a . e . slice ( 0 ) ; this . d = a . d } else this . reset ( ) } ; sjcl . hash . sha1 . hash = function ( a ) { return ( new sjcl . hash . sha1 ) . update ( a ) . finalize ( ) } ;
sjcl . hash . sha1 . prototype = { blockSize : 512 , reset : function ( ) { this . h = this . w . slice ( 0 ) ; this . e = [ ] ; this . d = 0 ; return this } , update : function ( a ) { if ( typeof a === "string" ) a = sjcl . codec . utf8String . toBits ( a ) ; var b , c = this . e = sjcl . bitArray . concat ( this . e , a ) ; b = this . d ; a = this . d = b + sjcl . bitArray . bitLength ( a ) ; for ( b = this . blockSize + b & - this . blockSize ; b <= a ; b += this . blockSize ) this . q ( c . splice ( 0 , 16 ) ) ; return this } , finalize : function ( ) { var a , b = this . e , c = this . h ; b = sjcl . bitArray . concat ( b , [ sjcl . bitArray . partial ( 1 , 1 ) ] ) ; for ( a = b . length + 2 ; a & 15 ; a ++ ) b . push ( 0 ) ;
b . push ( Math . floor ( this . d / 0x100000000 ) ) ; for ( b . push ( this . d | 0 ) ; b . length ; ) this . q ( b . splice ( 0 , 16 ) ) ; this . reset ( ) ; return c } , w : [ 1732584193 , 4023233417 , 2562383102 , 271733878 , 3285377520 ] , c : [ 1518500249 , 1859775393 , 2400959708 , 3395469782 ] , ja : function ( a , b , c , d ) { if ( a <= 19 ) return b & c | ~ b & d ; else if ( a <= 39 ) return b ^ c ^ d ; else if ( a <= 59 ) return b & c | b & d | c & d ; else if ( a <= 79 ) return b ^ c ^ d } , D : function ( a , b ) { return b << a | b >>> 32 - a } , q : function ( a ) { var b , c , d , e , f , g , h = a . slice ( 0 ) , i = this . h ; c = i [ 0 ] ; d = i [ 1 ] ; e = i [ 2 ] ; f = i [ 3 ] ; g = i [ 4 ] ; for ( a = 0 ; a <= 79 ; a ++ ) { if ( a >=
16 ) h [ a ] = this . D ( 1 , h [ a - 3 ] ^ h [ a - 8 ] ^ h [ a - 14 ] ^ h [ a - 16 ] ) ; b = this . D ( 5 , c ) + this . ja ( a , d , e , f ) + g + h [ a ] + this . c [ Math . floor ( a / 20 ) ] | 0 ; g = f ; f = e ; e = this . D ( 30 , d ) ; d = c ; c = b } i [ 0 ] = i [ 0 ] + c | 0 ; i [ 1 ] = i [ 1 ] + d | 0 ; i [ 2 ] = i [ 2 ] + e | 0 ; i [ 3 ] = i [ 3 ] + f | 0 ; i [ 4 ] = i [ 4 ] + g | 0 } } ; sjcl . hash . sha256 = function ( a ) { this . c [ 0 ] || this . M ( ) ; if ( a ) { this . h = a . h . slice ( 0 ) ; this . e = a . e . slice ( 0 ) ; this . d = a . d } else this . reset ( ) } ; sjcl . hash . sha256 . hash = function ( a ) { return ( new sjcl . hash . sha256 ) . update ( a ) . finalize ( ) } ;
if ( d > 26 ) { d -= 26 ; b . push ( f ^ g >>> d ) ; f = g << 32 - d } else { d += 6 ; f ^= g << 32 - d } } d & 56 && b . push ( sjcl . bitArray . partial ( d & 56 , f , 1 ) ) ; return b } } ; sjcl . hash . sha256 = function ( a ) { this . c [ 0 ] || this . M ( ) ; if ( a ) { this . h = a . h . slice ( 0 ) ; this . e = a . e . slice ( 0 ) ; this . d = a . d } else this . reset ( ) } ; sjcl . hash . sha256 . hash = function ( a ) { return ( new sjcl . hash . sha256 ) . update ( a ) . finalize ( ) } ;
sjcl . hash . sha256 . prototype = { blockSize : 512 , reset : function ( ) { this . h = this . w . slice ( 0 ) ; this . e = [ ] ; this . d = 0 ; return this } , update : function ( a ) { if ( typeof a === "string" ) a = sjcl . codec . utf8String . toBits ( a ) ; var b , c = this . e = sjcl . bitArray . concat ( this . e , a ) ; b = this . d ; a = this . d = b + sjcl . bitArray . bitLength ( a ) ; for ( b = 512 + b & - 512 ; b <= a ; b += 512 ) this . q ( c . splice ( 0 , 16 ) ) ; return this } , finalize : function ( ) { var a , b = this . e , c = this . h ; b = sjcl . bitArray . concat ( b , [ sjcl . bitArray . partial ( 1 , 1 ) ] ) ; for ( a = b . length + 2 ; a & 15 ; a ++ ) b . push ( 0 ) ; b . push ( Math . floor ( this . d /
4294967296 ) ) ; for ( b . push ( this . d | 0 ) ; b . length ; ) this . q ( b . splice ( 0 , 16 ) ) ; this . reset ( ) ; return c } , w : [ ] , c : [ ] , M : function ( ) { function a ( e ) { return ( e - Math . floor ( e ) ) * 0x100000000 | 0 } var b = 0 , c = 2 , d ; a : for ( ; b < 64 ; c ++ ) { for ( d = 2 ; d * d <= c ; d ++ ) if ( c % d === 0 ) continue a ; if ( b < 8 ) this . w [ b ] = a ( Math . pow ( c , 0.5 ) ) ; this . c [ b ] = a ( Math . pow ( c , 1 / 3 ) ) ; b ++ } } , q : function ( a ) { var b , c , d = a . slice ( 0 ) , e = this . h , f = this . c , g = e [ 0 ] , h = e [ 1 ] , i = e [ 2 ] , j = e [ 3 ] , k = e [ 4 ] , l = e [ 5 ] , m = e [ 6 ] , n = e [ 7 ] ; for ( a = 0 ; a < 64 ; a ++ ) { if ( a < 16 ) b = d [ a ] ; else { b = d [ a + 1 & 15 ] ; c = d [ a + 14 & 15 ] ; b = d [ a & 15 ] = ( b >>> 7 ^ b >>> 18 ^
b >>> 3 ^ b << 25 ^ b << 14 ) + ( c >>> 17 ^ c >>> 19 ^ c >>> 10 ^ c << 15 ^ c << 13 ) + d [ a & 15 ] + d [ a + 9 & 15 ] | 0 } b = b + n + ( k >>> 6 ^ k >>> 11 ^ k >>> 25 ^ k << 26 ^ k << 21 ^ k << 7 ) + ( m ^ k & ( l ^ m ) ) + f [ a ] ; n = m ; m = l ; l = k ; k = j + b | 0 ; j = i ; i = h ; h = g ; g = b + ( h & i ^ j & ( h ^ i ) ) + ( h >>> 2 ^ h >>> 13 ^ h >>> 22 ^ h << 30 ^ h << 19 ^ h << 10 ) | 0 } e [ 0 ] = e [ 0 ] + g | 0 ; e [ 1 ] = e [ 1 ] + h | 0 ; e [ 2 ] = e [ 2 ] + i | 0 ; e [ 3 ] = e [ 3 ] + j | 0 ; e [ 4 ] = e [ 4 ] + k | 0 ; e [ 5 ] = e [ 5 ] + l | 0 ; e [ 6 ] = e [ 6 ] + m | 0 ; e [ 7 ] = e [ 7 ] + n | 0 } } ;
b >>> 3 ^ b << 25 ^ b << 14 ) + ( c >>> 17 ^ c >>> 19 ^ c >>> 10 ^ c << 15 ^ c << 13 ) + d [ a & 15 ] + d [ a + 9 & 15 ] | 0 } b = b + n + ( k >>> 6 ^ k >>> 11 ^ k >>> 25 ^ k << 26 ^ k << 21 ^ k << 7 ) + ( m ^ k & ( l ^ m ) ) + f [ a ] ; n = m ; m = l ; l = k ; k = j + b | 0 ; j = i ; i = h ; h = g ; g = b + ( h & i ^ j & ( h ^ i ) ) + ( h >>> 2 ^ h >>> 13 ^ h >>> 22 ^ h << 30 ^ h << 19 ^ h << 10 ) | 0 } e [ 0 ] = e [ 0 ] + g | 0 ; e [ 1 ] = e [ 1 ] + h | 0 ; e [ 2 ] = e [ 2 ] + i | 0 ; e [ 3 ] = e [ 3 ] + j | 0 ; e [ 4 ] = e [ 4 ] + k | 0 ; e [ 5 ] = e [ 5 ] + l | 0 ; e [ 6 ] = e [ 6 ] + m | 0 ; e [ 7 ] = e [ 7 ] + n | 0 } } ; sjcl . hash . sha1 = function ( a ) { if ( a ) { this . h = a . h . slice ( 0 ) ; this . e = a . e . slice ( 0 ) ; this . d = a . d } else this . reset ( ) } ; sjcl . hash . sha1 . hash = function ( a ) { return ( new sjcl . hash . sha1 ) . update ( a ) . finalize ( ) } ;
sjcl . hash . sha1 . prototype = { blockSize : 512 , reset : function ( ) { this . h = this . w . slice ( 0 ) ; this . e = [ ] ; this . d = 0 ; return this } , update : function ( a ) { if ( typeof a === "string" ) a = sjcl . codec . utf8String . toBits ( a ) ; var b , c = this . e = sjcl . bitArray . concat ( this . e , a ) ; b = this . d ; a = this . d = b + sjcl . bitArray . bitLength ( a ) ; for ( b = this . blockSize + b & - this . blockSize ; b <= a ; b += this . blockSize ) this . q ( c . splice ( 0 , 16 ) ) ; return this } , finalize : function ( ) { var a , b = this . e , c = this . h ; b = sjcl . bitArray . concat ( b , [ sjcl . bitArray . partial ( 1 , 1 ) ] ) ; for ( a = b . length + 2 ; a & 15 ; a ++ ) b . push ( 0 ) ;
b . push ( Math . floor ( this . d / 0x100000000 ) ) ; for ( b . push ( this . d | 0 ) ; b . length ; ) this . q ( b . splice ( 0 , 16 ) ) ; this . reset ( ) ; return c } , w : [ 1732584193 , 4023233417 , 2562383102 , 271733878 , 3285377520 ] , c : [ 1518500249 , 1859775393 , 2400959708 , 3395469782 ] , ja : function ( a , b , c , d ) { if ( a <= 19 ) return b & c | ~ b & d ; else if ( a <= 39 ) return b ^ c ^ d ; else if ( a <= 59 ) return b & c | b & d | c & d ; else if ( a <= 79 ) return b ^ c ^ d } , D : function ( a , b ) { return b << a | b >>> 32 - a } , q : function ( a ) { var b , c , d , e , f , g , h = a . slice ( 0 ) , i = this . h ; c = i [ 0 ] ; d = i [ 1 ] ; e = i [ 2 ] ; f = i [ 3 ] ; g = i [ 4 ] ; for ( a = 0 ; a <= 79 ; a ++ ) { if ( a >=
16 ) h [ a ] = this . D ( 1 , h [ a - 3 ] ^ h [ a - 8 ] ^ h [ a - 14 ] ^ h [ a - 16 ] ) ; b = this . D ( 5 , c ) + this . ja ( a , d , e , f ) + g + h [ a ] + this . c [ Math . floor ( a / 20 ) ] | 0 ; g = f ; f = e ; e = this . D ( 30 , d ) ; d = c ; c = b } i [ 0 ] = i [ 0 ] + c | 0 ; i [ 1 ] = i [ 1 ] + d | 0 ; i [ 2 ] = i [ 2 ] + e | 0 ; i [ 3 ] = i [ 3 ] + f | 0 ; i [ 4 ] = i [ 4 ] + g | 0 } } ;
sjcl . mode . ccm = { name : "ccm" , encrypt : function ( a , b , c , d , e ) { var f , g = b . slice ( 0 ) , h = sjcl . bitArray , i = h . bitLength ( c ) / 8 , j = h . bitLength ( g ) / 8 ; e = e || 64 ; d = d || [ ] ; if ( i < 7 ) throw new sjcl . exception . invalid ( "ccm: iv must be at least 7 bytes" ) ; for ( f = 2 ; f < 4 && j >>> 8 * f ; f ++ ) ; if ( f < 15 - i ) f = 15 - i ; c = h . clamp ( c , 8 * ( 15 - f ) ) ; b = sjcl . mode . ccm . T ( a , b , c , d , e , f ) ; g = sjcl . mode . ccm . V ( a , g , c , b , e , f ) ; return h . concat ( g . data , g . tag ) } , decrypt : function ( a , b , c , d , e ) { e = e || 64 ; d = d || [ ] ; var f = sjcl . bitArray , g = f . bitLength ( c ) / 8 , h = f . bitLength ( b ) , i = f . clamp ( b , h - e ) , j = f . bitSlice ( b ,
h - e ) ; h = ( h - e ) / 8 ; if ( g < 7 ) throw new sjcl . exception . invalid ( "ccm: iv must be at least 7 bytes" ) ; for ( b = 2 ; b < 4 && h >>> 8 * b ; b ++ ) ; if ( b < 15 - g ) b = 15 - g ; c = f . clamp ( c , 8 * ( 15 - b ) ) ; i = sjcl . mode . ccm . V ( a , i , c , j , e , b ) ; a = sjcl . mode . ccm . T ( a , i . data , c , d , e , b ) ; if ( ! f . equal ( i . tag , a ) ) throw new sjcl . exception . corrupt ( "ccm: tag doesn't match" ) ; return i . data } , T : function ( a , b , c , d , e , f ) { var g = [ ] , h = sjcl . bitArray , i = h . m ; e /= 8 ; if ( e % 2 || e < 4 || e > 16 ) throw new sjcl . exception . invalid ( "ccm: invalid tag length" ) ; if ( d . length > 0xffffffff || b . length > 0xffffffff ) throw new sjcl . exception . bug ( "ccm: can't deal with 4GiB or more data" ) ;
f = [ h . partial ( 8 , ( d . length ? 64 : 0 ) | e - 2 << 2 | f - 1 ) ] ; f = h . concat ( f , c ) ; f [ 3 ] |= h . bitLength ( b ) / 8 ; f = a . encrypt ( f ) ; if ( d . length ) { c = h . bitLength ( d ) / 8 ; if ( c <= 65279 ) g = [ h . partial ( 16 , c ) ] ; else if ( c <= 0xffffffff ) g = h . concat ( [ h . partial ( 16 , 65534 ) ] , [ c ] ) ; g = h . concat ( g , d ) ; for ( d = 0 ; d < g . length ; d += 4 ) f = a . encrypt ( i ( f , g . slice ( d , d + 4 ) . concat ( [ 0 , 0 , 0 ] ) ) ) } for ( d = 0 ; d < b . length ; d += 4 ) f = a . encrypt ( i ( f , b . slice ( d , d + 4 ) . concat ( [ 0 , 0 , 0 ] ) ) ) ; return h . clamp ( f , e * 8 ) } , V : function ( a , b , c , d , e , f ) { var g , h = sjcl . bitArray ; g = h . m ; var i = b . length , j = h . bitLength ( b ) ; c = h . concat ( [ h . partial ( 8 ,
@ -30,8 +30,9 @@ k=a.encrypt(j(k,j(c,h(c))));if(d.length)k=j(k,f?d:sjcl.mode.ocb2.pmac(a,d));retu
d ( h ) ) ; b = e . concat ( b , [ 2147483648 | 0 , 0 , 0 , 0 ] ) } g = f ( g , b ) ; return a . encrypt ( f ( d ( f ( h , d ( h ) ) ) , g ) ) } , P : function ( a ) { return [ a [ 0 ] << 1 ^ a [ 1 ] >>> 31 , a [ 1 ] << 1 ^ a [ 2 ] >>> 31 , a [ 2 ] << 1 ^ a [ 3 ] >>> 31 , a [ 3 ] << 1 ^ ( a [ 0 ] >>> 31 ) * 135 ] } } ; sjcl . misc . hmac = function ( a , b ) { this . aa = b = b || sjcl . hash . sha256 ; var c = [ [ ] , [ ] ] , d = b . prototype . blockSize / 32 ; this . t = [ new b , new b ] ; if ( a . length > d ) a = b . hash ( a ) ; for ( b = 0 ; b < d ; b ++ ) { c [ 0 ] [ b ] = a [ b ] ^ 909522486 ; c [ 1 ] [ b ] = a [ b ] ^ 1549556828 } this . t [ 0 ] . update ( c [ 0 ] ) ; this . t [ 1 ] . update ( c [ 1 ] ) } ;
sjcl . misc . hmac . prototype . encrypt = sjcl . misc . hmac . prototype . mac = function ( a , b ) { a = ( new this . aa ( this . t [ 0 ] ) ) . update ( a , b ) . finalize ( ) ; return ( new this . aa ( this . t [ 1 ] ) ) . update ( a ) . finalize ( ) } ;
sjcl . misc . pbkdf2 = function ( a , b , c , d , e ) { c = c || 1E3 ; if ( d < 0 || c < 0 ) throw sjcl . exception . invalid ( "invalid params to pbkdf2" ) ; if ( typeof a === "string" ) a = sjcl . codec . utf8String . toBits ( a ) ; e = e || sjcl . misc . hmac ; a = new e ( a ) ; var f , g , h , i , j = [ ] , k = sjcl . bitArray ; for ( i = 1 ; 32 * j . length < ( d || 1 ) ; i ++ ) { e = f = a . encrypt ( k . concat ( b , [ i ] ) ) ; for ( g = 1 ; g < c ; g ++ ) { f = a . encrypt ( f ) ; for ( h = 0 ; h < f . length ; h ++ ) e [ h ] ^= f [ h ] } j = j . concat ( e ) } if ( d ) j = k . clamp ( j , d ) ; return j } ;
sjcl . keyexchange . srp = { makeVerifier : function ( a , b , c , d , e ) { a = this . makeX ( a , b , c ) ; a = sjcl . bn . fromBits ( a ) ; return e . powermod ( a , d ) } , makeX : function ( a , b , c ) { a = sjcl . hash . sha1 . hash ( a + ":" + b ) ; return sjcl . hash . sha1 . hash ( sjcl . bitArray . concat ( c , a ) ) } , knownGroup : function ( a ) { if ( typeof a !== "string" ) a = a . toString ( ) ; this . X || this . ka ( ) ; return this . ca [ a ] } , X : false , ka : function ( ) { var a , b ; for ( a = 0 ; a < this . ba . length ; a ++ ) { b = this . ba [ a ] . toString ( ) ; b = this . ca [ b ] ; b . N = new sjcl . bn ( b . N ) ; b . g = new sjcl . bn ( b . g ) } this . X = true } , ba : [ 1024 , 1536 , 2048 ] , ca : { "1024" : { N : "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC61D2FC0EB06E3" ,
g : 2 } , "1536" : { N : "9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA9614B19CC4D5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F84380B655BB9A22E8DCDF028A7CEC67F0D08134B1C8B97989149B609E0BE3BAB63D47548381DBC5B1FC764E3F4B53DD9DA1158BFD3E2B9C8CF56EDF019539349627DB2FD53D24B7C48665772E437D6C7F8CE442734AF7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E5A021FFF5E91479E8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB" , g : 2 } , "2048" : { N : "AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50E8083969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF747359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A436C6481F1D2B9078717461A5B9D32E688F87748544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E7303CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB694B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73" ,
sjcl . keyexchange . srp = { makeVerifier : function ( a , b , c , d ) { a = this . makeX ( a , b , c ) ; a = sjcl . bn . fromBits ( a ) ; return d . g . powermod ( a , d . N ) } , makeX : function ( a , b , c ) { a = sjcl . hash . sha1 . hash ( a + ":" + b ) ; return sjcl . hash . sha1 . hash ( sjcl . bitArray . concat ( c , a ) ) } , knownGroup : function ( a ) { if ( typeof a !== "string" ) a = a . toString ( ) ; this . X || this . ka ( ) ; return this . ca [ a ] } , X : false , ka : function ( ) { var a , b ; for ( a = 0 ; a < this . ba . length ; a ++ ) { b = this . ba [ a ] . toString ( ) ; b = this . ca [ b ] ; b . N = new sjcl . bn ( b . N ) ; b . g = new sjcl . bn ( b . g ) } this . X = true } , ba : [ 1024 , 1536 , 2048 ] ,
ca : { "1024" : { N : "EEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D8E250B98BE48E495C1D6089DAD15DC7D7B46154D6B6CE8EF4AD69B15D4982559B297BCF1885C529F566660E57EC68EDBC3C05726CC02FD4CBF4976EAA9AFD5138FE8376435B9FC61D2FC0EB06E3" , g : 2 } , "1536" : { N : "9DEF3CAFB939277AB1F12A8617A47BBBDBA51DF499AC4C80BEEEA9614B19CC4D5F4F5F556E27CBDE51C6A94BE4607A291558903BA0D0F84380B655BB9A22E8DCDF028A7CEC67F0D08134B1C8B97989149B609E0BE3BAB63D47548381DBC5B1FC764E3F4B53DD9DA1158BFD3E2B9C8CF56EDF019539349627DB2FD53D24B7C48665772E437D6C7F8CE442734AF7CCB7AE837C264AE3A9BEB87F8A2FE9B8B5292E5A021FFF5E91479E8CE7A28C2442C6F315180F93499A234DCF76E3FED135F9BB" ,
g : 2 } , "2048" : { N : "AC6BDB41324A9A9BF166DE5E1389582FAF72B6651987EE07FC3192943DB56050A37329CBB4A099ED8193E0757767A13DD52312AB4B03310DCD7F48A9DA04FD50E8083969EDB767B0CF6095179A163AB3661A05FBD5FAAAE82918A9962F0B93B855F97993EC975EEAA80D740ADBF4FF747359D041D5C33EA71D281E446B14773BCA97B43A23FB801676BD207A436C6481F1D2B9078717461A5B9D32E688F87748544523B524B0D57D5EA77A2775D2ECFA032CFBDBF52FB3786160279004E57AE6AF874E7303CE53299CCC041C7BC308D82A5698F3A8D0C38271AE35F8E9DBFBB694B5C803D89F7AE435DE236D525F54759B65E372FCD68EF20FA7111F9E4AFF73" ,
g : 2 } } } ;
sjcl . random = { randomWords : function ( a , b ) { var c = [ ] ; b = this . isReady ( b ) ; var d ; if ( b === 0 ) throw new sjcl . exception . notReady ( "generator isn't seeded" ) ; else b & 2 && this . na ( ! ( b & 1 ) ) ; for ( b = 0 ; b < a ; b += 4 ) { ( b + 1 ) % 0x10000 === 0 && this . $ ( ) ; d = this . K ( ) ; c . push ( d [ 0 ] , d [ 1 ] , d [ 2 ] , d [ 3 ] ) } this . $ ( ) ; return c . slice ( 0 , a ) } , setDefaultParanoia : function ( a ) { this . I = a } , addEntropy : function ( a , b , c ) { c = c || "user" ; var d , e , f = ( new Date ) . valueOf ( ) , g = this . C [ c ] , h = this . isReady ( ) ; d = this . S [ c ] ; if ( d === undefined ) d = this . S [ c ] = this . ia ++ ; if ( g === undefined ) g = this . C [ c ] = 0 ;
this . C [ c ] = ( this . C [ c ] + 1 ) % this . j . length ; switch ( typeof a ) { case "number" : break ; case "object" : if ( b === undefined ) for ( c = b = 0 ; c < a . length ; c ++ ) for ( e = a [ c ] ; e > 0 ; ) { b ++ ; e >>>= 1 } this . j [ g ] . update ( [ d , this . Y ++ , 2 , b , f , a . length ] . concat ( a ) ) ; break ; case "string" : if ( b === undefined ) b = a . length ; this . j [ g ] . update ( [ d , this . Y ++ , 3 , b , f , a . length ] ) ; this . j [ g ] . update ( a ) ; break ; default : throw new sjcl . exception . bug ( "random: addEntropy only supports number, array or string" ) ; } this . s [ g ] += b ; this . n += b ; if ( h === 0 ) { this . isReady ( ) !== 0 && this . Z ( "seeded" ,