diff options
author | royb <roy.basmacier@primekey.com> | 2024-06-06 13:55:52 -0400 |
---|---|---|
committer | royb <roy.basmacier@primekey.com> | 2024-06-06 13:55:52 -0400 |
commit | c70b82eeb8e413f37e13857669bdfb001990a9e7 (patch) | |
tree | 56afdd0ef6ec8a52b8dcfda8b4bad488e0f0c4a4 /crypto/src | |
parent | Nerdbank.GitVersioning 3.6.139 (diff) | |
download | BouncyCastle.NET-ed25519-c70b82eeb8e413f37e13857669bdfb001990a9e7.tar.xz |
Dilithium SampleInBall change and KATs updated
Diffstat (limited to 'crypto/src')
-rw-r--r-- | crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs | 4 | ||||
-rw-r--r-- | crypto/src/pqc/crypto/crystals/dilithium/Poly.cs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs index 9bbdcdad4..2f37887d7 100644 --- a/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs +++ b/crypto/src/pqc/crypto/crystals/dilithium/DilithiumEngine.cs @@ -109,7 +109,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium _random = random; PolyVecHPackedBytes = Omega + K; CryptoPublicKeyBytes = SeedBytes + K * PolyT1PackedBytes; - CryptoSecretKeyBytes = 3 * SeedBytes + L * PolyEtaPackedBytes + K * PolyEtaPackedBytes + K * PolyT0PackedBytes; + CryptoSecretKeyBytes = 2 * SeedBytes + TrBytes + L * PolyEtaPackedBytes + K * PolyEtaPackedBytes + K * PolyT0PackedBytes; CryptoBytes = CTilde + L * PolyZPackedBytes + PolyVecHPackedBytes; if (Gamma1 == (1 << 17)) @@ -237,7 +237,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium ShakeDigest256.BlockUpdate(sig, 0, K * PolyW1PackedBytes); ShakeDigest256.OutputFinal(sig, 0, CTilde); - cp.Challenge(sig); // use only first SeedBytes of sig + cp.Challenge(sig); // use only first CTilde of sig cp.PolyNtt(); diff --git a/crypto/src/pqc/crypto/crystals/dilithium/Poly.cs b/crypto/src/pqc/crypto/crystals/dilithium/Poly.cs index eb209f8a2..eb08daaca 100644 --- a/crypto/src/pqc/crypto/crystals/dilithium/Poly.cs +++ b/crypto/src/pqc/crypto/crystals/dilithium/Poly.cs @@ -590,7 +590,7 @@ namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium byte[] buf = new byte[Symmetric.Stream256BlockBytes]; ShakeDigest ShakeDigest256 = new ShakeDigest(256); - ShakeDigest256.BlockUpdate(seed, 0, DilithiumEngine.SeedBytes); + ShakeDigest256.BlockUpdate(seed, 0, Engine.CTilde); ShakeDigest256.Output(buf, 0, Symmetric.Stream256BlockBytes); signs = 0; |