diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-12 18:04:43 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2023-01-12 18:04:43 +0700 |
commit | d5203458eca8e5ff5463b5d92f0d4e85b884731a (patch) | |
tree | 243ea20a274fa0c617d4fce56665d0d344247890 /crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs | |
parent | Make classes static (diff) | |
download | BouncyCastle.NET-ed25519-d5203458eca8e5ff5463b5d92f0d4e85b884731a.tar.xz |
Refactoring around ParametersWithRandom
Diffstat (limited to '')
-rw-r--r-- | crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs b/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs index 5c576eb15..275148209 100644 --- a/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs +++ b/crypto/src/pqc/crypto/sphincsplus/SPHINCSPlusSigner.cs @@ -36,19 +36,23 @@ namespace Org.BouncyCastle.Pqc.Crypto.SphincsPlus { if (forSigning) { - if (param is ParametersWithRandom parametersWithRandom) + m_pubKey = null; + if (param is ParametersWithRandom withRandom) { - m_privKey = (SphincsPlusPrivateKeyParameters)parametersWithRandom.Parameters; - m_random = parametersWithRandom.Random; + m_privKey = (SphincsPlusPrivateKeyParameters)withRandom.Parameters; + m_random = withRandom.Random; } else { m_privKey = (SphincsPlusPrivateKeyParameters)param; + m_random = null; } } else { m_pubKey = (SphincsPlusPublicKeyParameters)param; + m_privKey = null; + m_random = null; } } |