summary refs log tree commit diff
path: root/crypto/src/pqc/crypto/crystals/dilithium/DilithiumParameters.cs
blob: e6aa6ab2117e9737bc4129b15c22e094af95eefe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Security;

namespace Org.BouncyCastle.Pqc.Crypto.Crystals.Dilithium
{
    public sealed class DilithiumParameters
        : ICipherParameters
    {
        public static DilithiumParameters Dilithium2 = new DilithiumParameters(2, false);
        public static DilithiumParameters Dilithium2Aes = new DilithiumParameters(2, true);
        
        public static DilithiumParameters Dilithium3 = new DilithiumParameters(3, false);
        public static DilithiumParameters Dilithium3Aes = new DilithiumParameters(3, true);
        
        public static DilithiumParameters Dilithium5 = new DilithiumParameters(5, false);
        public static DilithiumParameters Dilithium5Aes = new DilithiumParameters(5, true);

        private int k;
        private bool usingAes;

        private DilithiumParameters(int param, bool usingAes)
        {
            k = param;
            this.usingAes = usingAes;
        }

        internal DilithiumEngine GetEngine(SecureRandom Random)
        {
            return new DilithiumEngine(k, Random, usingAes);
        }
    }
}