mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-14 10:53:09 +00:00
SymmetricKey: add getMode()
This commit is contained in:
parent
a85c2f0d6e
commit
1bd5b40ee1
@ -3288,4 +3288,17 @@ abstract class SymmetricKey
|
||||
$mask = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";
|
||||
return strrev($r->toBytes()) & $mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mode
|
||||
*
|
||||
* You can do $obj instanceof AES or whatever to get the cipher but you can't do that to get the mode
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getMode()
|
||||
{
|
||||
return array_flip(self::MODE_MAP)[$this->mode];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user