mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-25 07:16:21 +08:00
Add support for PECL xxtea
This commit is contained in:
parent
15ceddc202
commit
2266affa5b
1 changed files with 9 additions and 1 deletions
|
@ -31,6 +31,10 @@ class Crypt
|
|||
return '';
|
||||
}
|
||||
|
||||
if (\is_callable('xxtea_encrypt')) {
|
||||
return xxtea_encrypt($sString, $sKey);
|
||||
}
|
||||
|
||||
$aV = self::str2long($sString, true);
|
||||
$aK = self::str2long($sKey, false);
|
||||
if (\count($aK) < 4)
|
||||
|
@ -80,6 +84,10 @@ class Crypt
|
|||
return '';
|
||||
}
|
||||
|
||||
if (\is_callable('xxtea_decrypt')) {
|
||||
return xxtea_decrypt($sEncriptedString, $sKey);
|
||||
}
|
||||
|
||||
$aV = self::str2long($sEncriptedString, false);
|
||||
$aK = self::str2long($sKey, false);
|
||||
|
||||
|
@ -186,4 +194,4 @@ class Crypt
|
|||
}
|
||||
return (int) $iN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue