Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.jcajce.provider.symmetric;
  
  
  
 
 public final class GOST28147
 {
     private GOST28147()
     {
     }
     
     public static class ECB
         extends BaseBlockCipher
     {
         public ECB()
         {
             super(new GOST28147Engine());
         }
     }
 
     public static class CBC
        extends BaseBlockCipher
     {
         public CBC()
         {
             super(new CBCBlockCipher(new GOST28147Engine()), 64);
         }
     }
 
     public static class GCFB
        extends BaseBlockCipher
     {
         public GCFB()
         {
             super(new BufferedBlockCipher(new GCFBBlockCipher(new GOST28147Engine())), 64);
         }
     }

    
GOST28147
 
     public static class Mac
         extends BaseMac
     {
         public Mac()
         {
             super(new GOST28147Mac());
         }
     }
 
     public static class KeyGen
         extends BaseKeyGenerator
     {
         public KeyGen()
         {
             this(256);
         }
 
         public KeyGen(int keySize)
         {
             super("GOST28147"keySizenew CipherKeyGenerator());
         }
     }
 
     public static class AlgParamGen
         extends BaseAlgorithmParameterGenerator
     {
         protected void engineInit(
             AlgorithmParameterSpec genParamSpec,
             SecureRandom random)
             throws InvalidAlgorithmParameterException
         {
             throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for GOST28147 parameter generation.");
         }
 
         protected AlgorithmParameters engineGenerateParameters()
         {
             byte[]  iv = new byte[16];
 
             if ( == null)
            {
                 = new SecureRandom();
            }
            .nextBytes(iv);
            AlgorithmParameters params;
            try
            {
                params = createParametersInstance("GOST28147");
                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 "GOST IV";
        }
    }
    public static class Mappings
        extends AlgorithmProvider
    {
        private static final String PREFIX = GOST28147.class.getName();
        public Mappings()
        {
        }
        public void configure(ConfigurableProvider provider)
        {
            provider.addAlgorithm("Cipher.GOST28147" + "$ECB");
            provider.addAlgorithm("Alg.Alias.Cipher.GOST""GOST28147");
            provider.addAlgorithm("Alg.Alias.Cipher.GOST-28147""GOST28147");
            provider.addAlgorithm("Cipher." + . + "$GCFB");
            provider.addAlgorithm("KeyGenerator.GOST28147" + "$KeyGen");
            provider.addAlgorithm("Alg.Alias.KeyGenerator.GOST""GOST28147");
            provider.addAlgorithm("Alg.Alias.KeyGenerator.GOST-28147""GOST28147");
            provider.addAlgorithm("Alg.Alias.KeyGenerator." + ."GOST28147");
            provider.addAlgorithm("Mac.GOST28147MAC" + "$Mac");
            provider.addAlgorithm("Alg.Alias.Mac.GOST28147""GOST28147MAC");
        }
    }
New to GrepCode? Check out our FAQ X