All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.pqc.jcajce.spec.RainbowParameterSpec Maven / Gradle / Ivy

Go to download

The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.5 to JDK 1.8.

There is a newer version: 1.79
Show newest version
package org.bouncycastle.pqc.jcajce.spec;

import java.security.spec.AlgorithmParameterSpec;
import java.util.HashMap;
import java.util.Map;

import org.bouncycastle.pqc.crypto.crystals.dilithium.DilithiumParameters;
import org.bouncycastle.pqc.crypto.rainbow.RainbowParameters;
import org.bouncycastle.util.Strings;

public class RainbowParameterSpec
    implements AlgorithmParameterSpec
{
    public static final RainbowParameterSpec rainbowIIIclassic = new RainbowParameterSpec(RainbowParameters.rainbowIIIclassic);
    public static final RainbowParameterSpec rainbowIIIcircumzenithal = new RainbowParameterSpec(RainbowParameters.rainbowIIIcircumzenithal);
    public static final RainbowParameterSpec rainbowIIIcompressed = new RainbowParameterSpec(RainbowParameters.rainbowIIIcompressed);

    public static final RainbowParameterSpec rainbowVclassic = new RainbowParameterSpec(RainbowParameters.rainbowVclassic);
    public static final RainbowParameterSpec rainbowVcircumzenithal = new RainbowParameterSpec(RainbowParameters.rainbowVcircumzenithal);
    public static final RainbowParameterSpec rainbowVcompressed = new RainbowParameterSpec(RainbowParameters.rainbowVcompressed);

    private static Map parameters = new HashMap();

    static
    {
        parameters.put("rainbow-iii-classic", rainbowIIIclassic);
        parameters.put("rainbow-iii-circumzenithal", rainbowIIIcircumzenithal);
        parameters.put("rainbow-iii-compressed", rainbowIIIcompressed);
        parameters.put("rainbow-v-classic", rainbowVclassic);
        parameters.put("rainbow-v-circumzenithal", rainbowVcircumzenithal);
        parameters.put("rainbow-v-compressed", rainbowVcompressed);
    }

    private final String name;

    private RainbowParameterSpec(RainbowParameters parameters)
    {
        this.name = Strings.toUpperCase(parameters.getName());
    }

    public String getName()
    {
        return name;
    }

    public static RainbowParameterSpec fromName(String name)
    {
        return (RainbowParameterSpec)parameters.get(Strings.toLowerCase(name));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy