Current Path : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/main/ |
Current File : /home/bitrix/ext_www/klimatlend.ua/bitrix/js/main/rsasecurity.min.js |
function rl(i,t){return i<<t|i>>>32-t}function cvt(i){var t="";var r;var e;for(r=7;r>=0;r--){e=i>>>r*4&15;t=t+e.toString(16)}return t}function SHA1(i){var t;var r,e;var a=new Array(80);var n=1732584193;var s=4023233417;var g=2562383102;var d=271733878;var o=3285377520;var u,h,l,v,b;var f;var c=i.length;var m=new Array;for(r=0;r<c-3;r+=4)m.push(i.charCodeAt(r)<<24|i.charCodeAt(r+1)<<16|i.charCodeAt(r+2)<<8|i.charCodeAt(r+3));switch(c%4){case 0:r=2147483648;break;case 1:r=i.charCodeAt(c-1)<<24|8388608;break;case 2:r=i.charCodeAt(c-2)<<24|i.charCodeAt(c-1)<<16|32768;break;case 3:r=i.charCodeAt(c-3)<<24|i.charCodeAt(c-2)<<16|i.charCodeAt(c-1)<<8|128;break}m.push(r);while(m.length%16!=14)m.push(0);m.push(c>>>29);m.push(c<<3&4294967295);for(t=0;t<m.length;t+=16){for(r=0;r<16;r++)a[r]=m[t+r];for(r=16;r<=79;r++)a[r]=rl(a[r-3]^a[r-8]^a[r-14]^a[r-16],1);u=n;h=s;l=g;v=d;b=o;for(r=0;r<=19;r++){f=rl(u,5)+(h&l|~h&v)+b+a[r]+1518500249&4294967295;b=v;v=l;l=rl(h,30);h=u;u=f}for(r=20;r<=39;r++){f=rl(u,5)+(h^l^v)+b+a[r]+1859775393&4294967295;b=v;v=l;l=rl(h,30);h=u;u=f}for(r=40;r<=59;r++){f=rl(u,5)+(h&l|h&v|l&v)+b+a[r]+2400959708&4294967295;b=v;v=l;l=rl(h,30);h=u;u=f}for(r=60;r<=79;r++){f=rl(u,5)+(h^l^v)+b+a[r]+3395469782&4294967295;b=v;v=l;l=rl(h,30);h=u;u=f}n=n+u&4294967295;s=s+h&4294967295;g=g+l&4294967295;d=d+v&4294967295;o=o+b&4294967295}return cvt(n)+cvt(s)+cvt(g)+cvt(d)+cvt(o)}var ua=navigator.userAgent.toLowerCase();if(ua.indexOf(" chrome/")>=0||ua.indexOf(" firefox/")>=0||ua.indexOf(" gecko/")>=0){var StringMaker=function(){this.str="";this.length=0;this.append=function(i){this.str+=i;this.length+=i.length};this.prepend=function(i){this.str=i+this.str;this.length+=i.length};this.toString=function(){return this.str}}}else{var StringMaker=function(){this.parts=[];this.length=0;this.append=function(i){this.parts.push(i);this.length+=i.length};this.prepend=function(i){this.parts.unshift(i);this.length+=i.length};this.toString=function(){return this.parts.join("")}}}var keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function encode64(i){var t=new StringMaker;var r,e,a;var n,s,g,d;var o=0;while(o<i.length){r=i.charCodeAt(o++);e=i.charCodeAt(o++);a=i.charCodeAt(o++);n=r>>2;s=(r&3)<<4|e>>4;g=(e&15)<<2|a>>6;d=a&63;if(isNaN(e)){g=d=64}else if(isNaN(a)){d=64}t.append(keyStr.charAt(n)+keyStr.charAt(s)+keyStr.charAt(g)+keyStr.charAt(d))}return t.toString()}function decode64(i){var t=new StringMaker;var r,e,a;var n,s,g,d;var o=0;i=i.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(o<i.length){n=keyStr.indexOf(i.charAt(o++));s=keyStr.indexOf(i.charAt(o++));g=keyStr.indexOf(i.charAt(o++));d=keyStr.indexOf(i.charAt(o++));r=n<<2|s>>4;e=(s&15)<<4|g>>2;a=(g&3)<<6|d;t.append(String.fromCharCode(r));if(g!=64){t.append(String.fromCharCode(e))}if(d!=64){t.append(String.fromCharCode(a))}}return t.toString()}function decode64_2hex(i){var t=new StringMaker;var r,e,a;var n,s,g,d;var o=0;i=i.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(o<i.length){n=keyStr.indexOf(i.charAt(o++));s=keyStr.indexOf(i.charAt(o++));g=keyStr.indexOf(i.charAt(o++));d=keyStr.indexOf(i.charAt(o++));r=n<<2|s>>4;e=(s&15)<<4|g>>2;a=(g&3)<<6|d;t.append(String.fromCharCode(r));if(g!=64){t.append(String.fromCharCode(e))}if(d!=64){t.append(String.fromCharCode(a))}}return t.toString()}var biRadixBase=2;var biRadixBits=16;var bitsPerDigit=biRadixBits;var biRadix=1<<16;var biHalfRadix=biRadix>>>1;var biRadixSquared=biRadix*biRadix;var maxDigitVal=biRadix-1;var maxInteger=9999999999999998;var maxDigits;var ZERO_ARRAY;var bigZero,bigOne;function setMaxDigits(i){maxDigits=i;ZERO_ARRAY=new Array(maxDigits);for(var t=0;t<ZERO_ARRAY.length;t++)ZERO_ARRAY[t]=0;bigZero=new BigInt;bigOne=new BigInt;bigOne.digits[0]=1}setMaxDigits(20);var dpl10=15;var lr10=biFromNumber(1e15);function BigInt(i){if(typeof i=="boolean"&&i==true){this.digits=null}else{this.digits=ZERO_ARRAY.slice(0)}this.isNeg=false}function biFromDecimal(i){var t=i.charAt(0)=="-";var r=t?1:0;var e;while(r<i.length&&i.charAt(r)=="0")++r;if(r==i.length){e=new BigInt}else{var a=i.length-r;var n=a%dpl10;if(n==0)n=dpl10;e=biFromNumber(Number(i.substr(r,n)));r+=n;while(r<i.length){e=biAdd(biMultiply(e,lr10),biFromNumber(Number(i.substr(r,dpl10))));r+=dpl10}e.isNeg=t}return e}function biCopy(i){var t=new BigInt(true);t.digits=i.digits.slice(0);t.isNeg=i.isNeg;return t}function biFromNumber(i){var t=new BigInt;t.isNeg=i<0;i=Math.abs(i);var r=0;while(i>0){t.digits[r++]=i&maxDigitVal;i>>=biRadixBits}return t}function reverseStr(i){var t="";for(var r=i.length-1;r>-1;--r){t+=i.charAt(r)}return t}var hexatrigesimalToChar=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");function biToString(i,t){var r=new BigInt;r.digits[0]=t;var e=biDivideModulo(i,r);var a=hexatrigesimalToChar[e[1].digits[0]];while(biCompare(e[0],bigZero)==1){e=biDivideModulo(e[0],r);digit=e[1].digits[0];a+=hexatrigesimalToChar[e[1].digits[0]]}return(i.isNeg?"-":"")+reverseStr(a)}function biToDecimal(i){var t=new BigInt;t.digits[0]=10;var r=biDivideModulo(i,t);var e=String(r[1].digits[0]);while(biCompare(r[0],bigZero)==1){r=biDivideModulo(r[0],t);e+=String(r[1].digits[0])}return(i.isNeg?"-":"")+reverseStr(e)}var hexToChar=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");function digitToHex(t){var r=15;var e="";for(i=0;i<4;++i){e+=hexToChar[t&r];t>>>=4}return reverseStr(e)}function biToHex(i){var t="";var r=biHighIndex(i);for(var e=biHighIndex(i);e>-1;--e){t+=digitToHex(i.digits[e])}return t}function charToHex(i){var t=48;var r=t+9;var e=97;var a=e+25;var n=65;var s=65+25;var g;if(i>=t&&i<=r){g=i-t}else if(i>=n&&i<=s){g=10+i-n}else if(i>=e&&i<=a){g=10+i-e}else{g=0}return g}function hexToDigit(i){var t=0;var r=Math.min(i.length,4);for(var e=0;e<r;++e){t<<=4;t|=charToHex(i.charCodeAt(e))}return t}function biFromHex(i){var t=new BigInt;var r=i.length;for(var e=r,a=0;e>0;e-=4,++a){t.digits[a]=hexToDigit(i.substr(Math.max(e-4,0),Math.min(e,4)))}return t}function biFromString(i,t){var r=i.charAt(0)=="-";var e=r?1:0;var a=new BigInt;var n=new BigInt;n.digits[0]=1;for(var s=i.length-1;s>=e;s--){var g=i.charCodeAt(s);var d=charToHex(g);var o=biMultiplyDigit(n,d);a=biAdd(a,o);n=biMultiplyDigit(n,t)}a.isNeg=r;return a}function biDump(i){return(i.isNeg?"-":"")+i.digits.join(" ")}function biAdd(i,t){var r;if(i.isNeg!=t.isNeg){t.isNeg=!t.isNeg;r=biSubtract(i,t);t.isNeg=!t.isNeg}else{r=new BigInt;var e=0;var a;for(var n=0;n<i.digits.length;++n){a=i.digits[n]+t.digits[n]+e;r.digits[n]=a&65535;e=Number(a>=biRadix)}r.isNeg=i.isNeg}return r}function biSubtract(i,t){var r;if(i.isNeg!=t.isNeg){t.isNeg=!t.isNeg;r=biAdd(i,t);t.isNeg=!t.isNeg}else{r=new BigInt;var e,a;a=0;for(var n=0;n<i.digits.length;++n){e=i.digits[n]-t.digits[n]+a;r.digits[n]=e&65535;if(r.digits[n]<0)r.digits[n]+=biRadix;a=0-Number(e<0)}if(a==-1){a=0;for(var n=0;n<i.digits.length;++n){e=0-r.digits[n]+a;r.digits[n]=e&65535;if(r.digits[n]<0)r.digits[n]+=biRadix;a=0-Number(e<0)}r.isNeg=!i.isNeg}else{r.isNeg=i.isNeg}}return r}function biHighIndex(i){var t=i.digits.length-1;while(t>0&&i.digits[t]==0)--t;return t}function biNumBits(i){var t=biHighIndex(i);var r=i.digits[t];var e=(t+1)*bitsPerDigit;var a;for(a=e;a>e-bitsPerDigit;--a){if((r&32768)!=0)break;r<<=1}return a}function biMultiply(i,t){var r=new BigInt;var e;var a=biHighIndex(i);var n=biHighIndex(t);var s,g,d;for(var o=0;o<=n;++o){e=0;d=o;for(j=0;j<=a;++j,++d){g=r.digits[d]+i.digits[j]*t.digits[o]+e;r.digits[d]=g&maxDigitVal;e=g>>>biRadixBits}r.digits[o+a+1]=e}r.isNeg=i.isNeg!=t.isNeg;return r}function biMultiplyDigit(i,t){var r,e,a;result=new BigInt;r=biHighIndex(i);e=0;for(var n=0;n<=r;++n){a=result.digits[n]+i.digits[n]*t+e;result.digits[n]=a&maxDigitVal;e=a>>>biRadixBits}result.digits[1+r]=e;return result}function arrayCopy(i,t,r,e,a){var n=Math.min(t+a,i.length);for(var s=t,g=e;s<n;++s,++g){r[g]=i[s]}}var highBitMasks=new Array(0,32768,49152,57344,61440,63488,64512,65024,65280,65408,65472,65504,65520,65528,65532,65534,65535);function biShiftLeft(i,t){var r=Math.floor(t/bitsPerDigit);var e=new BigInt;arrayCopy(i.digits,0,e.digits,r,e.digits.length-r);var a=t%bitsPerDigit;var n=bitsPerDigit-a;for(var s=e.digits.length-1,g=s-1;s>0;--s,--g){e.digits[s]=e.digits[s]<<a&maxDigitVal|(e.digits[g]&highBitMasks[a])>>>n}e.digits[0]=e.digits[s]<<a&maxDigitVal;e.isNeg=i.isNeg;return e}var lowBitMasks=new Array(0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535);function biShiftRight(i,t){var r=Math.floor(t/bitsPerDigit);var e=new BigInt;arrayCopy(i.digits,r,e.digits,0,i.digits.length-r);var a=t%bitsPerDigit;var n=bitsPerDigit-a;for(var s=0,g=s+1;s<e.digits.length-1;++s,++g){e.digits[s]=e.digits[s]>>>a|(e.digits[g]&lowBitMasks[a])<<n}e.digits[e.digits.length-1]>>>=a;e.isNeg=i.isNeg;return e}function biMultiplyByRadixPower(i,t){var r=new BigInt;arrayCopy(i.digits,0,r.digits,t,r.digits.length-t);return r}function biDivideByRadixPower(i,t){var r=new BigInt;arrayCopy(i.digits,t,r.digits,0,r.digits.length-t);return r}function biModuloByRadixPower(i,t){var r=new BigInt;arrayCopy(i.digits,0,r.digits,0,t);return r}function biCompare(i,t){if(i.isNeg!=t.isNeg){return 1-2*Number(i.isNeg)}for(var r=i.digits.length-1;r>=0;--r){if(i.digits[r]!=t.digits[r]){if(i.isNeg){return 1-2*Number(i.digits[r]>t.digits[r])}else{return 1-2*Number(i.digits[r]<t.digits[r])}}}return 0}function biDivideModulo(i,t){var r=biNumBits(i);var e=biNumBits(t);var a=t.isNeg;var n,s;if(r<e){if(i.isNeg){n=biCopy(bigOne);n.isNeg=!t.isNeg;i.isNeg=false;t.isNeg=false;s=biSubtract(t,i);i.isNeg=true;t.isNeg=a}else{n=new BigInt;s=biCopy(i)}return new Array(n,s)}n=new BigInt;s=i;var g=Math.ceil(e/bitsPerDigit)-1;var d=0;while(t.digits[g]<biHalfRadix){t=biShiftLeft(t,1);++d;++e;g=Math.ceil(e/bitsPerDigit)-1}s=biShiftLeft(s,d);r+=d;var o=Math.ceil(r/bitsPerDigit)-1;var u=biMultiplyByRadixPower(t,o-g);while(biCompare(s,u)!=-1){++n.digits[o-g];s=biSubtract(s,u)}for(var h=o;h>g;--h){var l=h>=s.digits.length?0:s.digits[h];var v=h-1>=s.digits.length?0:s.digits[h-1];var b=h-2>=s.digits.length?0:s.digits[h-2];var f=g>=t.digits.length?0:t.digits[g];var c=g-1>=t.digits.length?0:t.digits[g-1];if(l==f){n.digits[h-g-1]=maxDigitVal}else{n.digits[h-g-1]=Math.floor((l*biRadix+v)/f)}var m=n.digits[h-g-1]*(f*biRadix+c);var p=l*biRadixSquared+(v*biRadix+b);while(m>p){--n.digits[h-g-1];m=n.digits[h-g-1]*(f*biRadix|c);p=l*biRadix*biRadix+(v*biRadix+b)}u=biMultiplyByRadixPower(t,h-g-1);s=biSubtract(s,biMultiplyDigit(u,n.digits[h-g-1]));if(s.isNeg){s=biAdd(s,u);--n.digits[h-g-1]}}s=biShiftRight(s,d);n.isNeg=i.isNeg!=a;if(i.isNeg){if(a){n=biAdd(n,bigOne)}else{n=biSubtract(n,bigOne)}t=biShiftRight(t,d);s=biSubtract(t,s)}if(s.digits[0]==0&&biHighIndex(s)==0)s.isNeg=false;return new Array(n,s)}function biDivide(i,t){return biDivideModulo(i,t)[0]}function biModulo(i,t){return biDivideModulo(i,t)[1]}function biMultiplyMod(i,t,r){return biModulo(biMultiply(i,t),r)}function biPow(i,t){var r=bigOne;var e=i;while(true){if((t&1)!=0)r=biMultiply(r,e);t>>=1;if(t==0)break;e=biMultiply(e,e)}return r}function biPowMod(i,t,r){var e=bigOne;var a=i;var n=t;while(true){if((n.digits[0]&1)!=0)e=biMultiplyMod(e,a,r);n=biShiftRight(n,1);if(n.digits[0]==0&&biHighIndex(n)==0)break;a=biMultiplyMod(a,a,r)}return e}function biFromRaw(i){var t=new BigInt;var r=i.length;for(var e=0,a=0;e<r;e+=2,++a){t.digits[a]=i.charCodeAt(e)+(e<r-1?i.charCodeAt(e+1)*256:0)}return t}function biToRaw(t){var r="";var e=biHighIndex(t);for(i=e;i>-1;--i){r+=String.fromCharCode(t.digits[i]/256,t.digits[i]%256)}return reverseStr(r)}function BarrettMu(i){this.modulus=biCopy(i);this.k=biHighIndex(this.modulus)+1;var t=new BigInt;t.digits[2*this.k]=1;this.mu=biDivide(t,this.modulus);this.bkplus1=new BigInt;this.bkplus1.digits[this.k+1]=1;this.modulo=BarrettMu_modulo;this.multiplyMod=BarrettMu_multiplyMod;this.powMod=BarrettMu_powMod}function BarrettMu_modulo(i){var t=biDivideByRadixPower(i,this.k-1);var r=biMultiply(t,this.mu);var e=biDivideByRadixPower(r,this.k+1);var a=biModuloByRadixPower(i,this.k+1);var n=biMultiply(e,this.modulus);var s=biModuloByRadixPower(n,this.k+1);var g=biSubtract(a,s);if(g.isNeg){g=biAdd(g,this.bkplus1)}var d=biCompare(g,this.modulus)>=0;while(d){g=biSubtract(g,this.modulus);d=biCompare(g,this.modulus)>=0}return g}function BarrettMu_multiplyMod(i,t){var r=biMultiply(i,t);return this.modulo(r)}function BarrettMu_powMod(i,t){var r=new BigInt;r.digits[0]=1;var e=i;var a=t;while(true){if((a.digits[0]&1)!=0)r=this.multiplyMod(r,e);a=biShiftRight(a,1);if(a.digits[0]==0&&biHighIndex(a)==0)break;e=this.multiplyMod(e,e)}return r}function rsasec_key(i,t,r){setMaxDigits(160);this.e=biFromRaw(decode64(i));this.m=biFromRaw(decode64(t));this.chunkSize=parseInt(r);this.radix=16;this.barrett=new BarrettMu(this.m)}function rsasec_crypt(i,t){var r=new Array;var e=i.length;var a=0;while(a<e){r[a]=i.charCodeAt(a);a++}while(r.length%t.chunkSize!=0){r[a++]=0}var n=r.length;var s="";var g,d,o;for(a=0;a<n;a+=t.chunkSize){o=new BigInt;g=0;for(d=a;d<a+t.chunkSize;++g){o.digits[g]=r[d++];o.digits[g]+=r[d++]<<8}var u=t.barrett.powMod(o,t.e);var h=encode64(biToRaw(u));s+=h+" "}return s.substring(0,s.length-1)}function rsasec_form_bind(i){BX.ready(function(){var t=document.forms[i.formid];if(!t)t=document.getElementById(i.formid);if(t){BX.bind(t,"submit",function(){rsasec_form(i);return true})}})}function rsasec_form(i){var t=document.forms[i.formid];if(!t)t=document.getElementById(i.formid);if(t){var r=new rsasec_key(i.key.E,i.key.M,i.key.chunk);var e="__RSA_RAND="+i.rsa_rand;for(var a=0;a<i.params.length;a++){var n=t.elements[i.params[a]];if(n){e+="&"+i.params[a]+"="+encodeURIComponent(n.value);n.disabled=true}}e=e+"&__SHA="+SHA1(e);if(!t.__RSA_DATA){var s=document.createElement("INPUT");s.type="hidden";s.name="__RSA_DATA";s.value=rsasec_crypt(e,r);t.appendChild(s)}else{t.__RSA_DATA.value=rsasec_crypt(e,r)}}} //# sourceMappingURL=rsasecurity.map.js