Welcome to mirror list, hosted at ThFree Co, Russian Federation.

McElieceCCA2ParameterSpec.java « spec « jcajce « pqc « bouncycastle « org « java « main « src « prov - gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d98a8f5ef28521e5ed9e0bfea81484d03facd1f3 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.bouncycastle.pqc.jcajce.spec;


import java.security.spec.AlgorithmParameterSpec;

/**
 * This class provides a specification for the parameters of the CCA2-secure
 * variants of the McEliece PKCS that are used with
 * {@link McElieceFujisakiCipher}, {@link McElieceKobaraImaiCipher}, and
 * {@link McEliecePointchevalCipher}.
 *
 * @see McElieceFujisakiCipher
 * @see McElieceKobaraImaiCipher
 * @see McEliecePointchevalCipher
 */
public class McElieceCCA2ParameterSpec
    implements AlgorithmParameterSpec
{

    /**
     * The default message digest ("SHA256").
     */
    public static final String DEFAULT_MD = "SHA256";

    private String mdName;

    /**
     * Construct the default parameters. Choose the
     */
    public McElieceCCA2ParameterSpec()
    {
        this(DEFAULT_MD);
    }

    /**
     * Constructor.
     *
     * @param mdName the name of the hash function
     */
    public McElieceCCA2ParameterSpec(String mdName)
    {
        // check whether message digest is available
        // TODO: this method not used!
//        try {
//            Registry.getMessageDigest(mdName);
//        } catch (NoSuchAlgorithmException nsae) {
//            throw new InvalidParameterException("Message digest '" + mdName
//                    + "' not found'.");
//        }

        // assign message digest name
        this.mdName = mdName;
    }

    /**
     * @return the name of the hash function
     */
    public String getMDName()
    {
        return mdName;
    }

}