mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
Code Quality: Use enum class instead of enum to make sure enum members can only be accessed when scoped to the enum
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
class Crypto
|
||||
{
|
||||
public:
|
||||
enum RSAPaddingMode
|
||||
enum class RSAPaddingMode
|
||||
{
|
||||
RSA_PADDING_PKS1,
|
||||
RSA_PADDING_PSS,
|
||||
|
@ -5,7 +5,7 @@
|
||||
class IPublicKeyAlgorithm
|
||||
{
|
||||
public:
|
||||
enum HashingAlgorithm
|
||||
enum class HashingAlgorithm
|
||||
{
|
||||
RSA_HASH_SHA256,
|
||||
RSA_HASH_SHA512
|
||||
|
@ -13,11 +13,11 @@ class AlgorithmRSA::AlgorithmRSAImpl
|
||||
{
|
||||
switch(m_hash)
|
||||
{
|
||||
case RSA_HASH_SHA256:
|
||||
case HashingAlgorithm::RSA_HASH_SHA256:
|
||||
return &sha256_desc;
|
||||
|
||||
default:
|
||||
case RSA_HASH_SHA512:
|
||||
case HashingAlgorithm::RSA_HASH_SHA512:
|
||||
return &sha512_desc;
|
||||
}
|
||||
}
|
||||
@ -26,11 +26,11 @@ class AlgorithmRSA::AlgorithmRSAImpl
|
||||
{
|
||||
switch(m_padding)
|
||||
{
|
||||
case Crypto::RSA_PADDING_PKS1:
|
||||
case Crypto::RSAPaddingMode::RSA_PADDING_PKS1:
|
||||
return LTC_PKCS_1_V1_5;
|
||||
|
||||
default:
|
||||
case Crypto::RSA_PADDING_PSS:
|
||||
case Crypto::RSAPaddingMode::RSA_PADDING_PSS:
|
||||
return LTC_PKCS_1_PSS;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user