mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
Add support for PECL xxtea
This commit is contained in:
parent
15ceddc202
commit
2266affa5b
|
@ -31,6 +31,10 @@ class Crypt
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\is_callable('xxtea_encrypt')) {
|
||||||
|
return xxtea_encrypt($sString, $sKey);
|
||||||
|
}
|
||||||
|
|
||||||
$aV = self::str2long($sString, true);
|
$aV = self::str2long($sString, true);
|
||||||
$aK = self::str2long($sKey, false);
|
$aK = self::str2long($sKey, false);
|
||||||
if (\count($aK) < 4)
|
if (\count($aK) < 4)
|
||||||
|
@ -80,6 +84,10 @@ class Crypt
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (\is_callable('xxtea_decrypt')) {
|
||||||
|
return xxtea_decrypt($sEncriptedString, $sKey);
|
||||||
|
}
|
||||||
|
|
||||||
$aV = self::str2long($sEncriptedString, false);
|
$aV = self::str2long($sEncriptedString, false);
|
||||||
$aK = self::str2long($sKey, false);
|
$aK = self::str2long($sKey, false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue