Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.jcajce.provider.symmetric;
  
  
  
 
 public final class SEED
 {
     private SEED()
     {
     }
     
     public static class ECB
         extends BaseBlockCipher
     {
         public ECB()
         {
             super(new BlockCipherProvider()
             {
                 public BlockCipher get()
                 {
                     return new SEEDEngine();
                 }
             });
         }
     }
 
     public static class CBC
        extends BaseBlockCipher
     {
         public CBC()
         {
             super(new CBCBlockCipher(new SEEDEngine()), 128);
         }
     }
 
     public static class Wrap
         extends BaseWrapCipher
     {
         public Wrap()
         {
             super(new SEEDWrapEngine());
         }
     }
 
     public static class KeyGen
         extends BaseKeyGenerator
     {
         public KeyGen()
         {
             super("SEED", 128, new CipherKeyGenerator());
         }
     }
 
     public static class GMAC
         extends BaseMac
     {
         public GMAC()
         {
             super(new GMac(new GCMBlockCipher(new SEEDEngine())));
         }
     }
 
     public static class Poly1305
         extends BaseMac
     {
         public Poly1305()
         {
             super(new org.bouncycastle.crypto.macs.Poly1305(new SEEDEngine()));
         }
     }
 
     public static class Poly1305KeyGen
         extends BaseKeyGenerator
     {
         public Poly1305KeyGen()
         {
             super("Poly1305-SEED", 256, new Poly1305KeyGenerator());
        }
    }
    public static class AlgParamGen
        extends BaseAlgorithmParameterGenerator
    {
        protected void engineInit(
            AlgorithmParameterSpec genParamSpec,
            SecureRandom random)
            throws InvalidAlgorithmParameterException
        {
            throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for SEED parameter generation.");
        }
        protected AlgorithmParameters engineGenerateParameters()
        {
            byte[] iv = new byte[16];
            if ( == null)
            {
                 = new SecureRandom();
            }
            .nextBytes(iv);
            AlgorithmParameters params;
            try
            {
                params = createParametersInstance("SEED");
                params.init(new IvParameterSpec(iv));
            }
            catch (Exception e)
            {
                throw new RuntimeException(e.getMessage());
            }
            return params;
        }
    }
    public static class AlgParams
        extends IvAlgorithmParameters
    {
        protected String engineToString()
        {
            return "SEED IV";
        }
    }
    public static class Mappings
        extends SymmetricAlgorithmProvider
    {
        private static final String PREFIX = SEED.class.getName();
        public Mappings()
        {
        }
        public void configure(ConfigurableProvider provider)
        {
            provider.addAlgorithm("AlgorithmParameters.SEED" + "$AlgParams");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameters." + ."SEED");
            provider.addAlgorithm("AlgorithmParameterGenerator.SEED" + "$AlgParamGen");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator." + ."SEED");
            provider.addAlgorithm("Cipher.SEED" + "$ECB");
            provider.addAlgorithm("Cipher." + . + "$CBC");
            provider.addAlgorithm("Cipher.SEEDWRAP" + "$Wrap");
            provider.addAlgorithm("Alg.Alias.Cipher." + ."SEEDWRAP");
            provider.addAlgorithm("KeyGenerator.SEED" + "$KeyGen");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen");
            addGMacAlgorithm(provider"SEED" + "$GMAC" + "$KeyGen");
            addPoly1305Algorithm(provider"SEED" + "$Poly1305" + "$Poly1305KeyGen");
        }
    }
New to GrepCode? Check out our FAQ X