Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.jcajce.provider.symmetric;
  
  
  
 
 public final class Camellia
 {
     private Camellia()
     {
     }
     
     public static class ECB
         extends BaseBlockCipher
     {
         public ECB()
         {
             super(new BlockCipherProvider()
             {
                 public BlockCipher get()
                 {
                     return new CamelliaEngine();
                 }
             });
         }
     }
 
     public static class CBC
        extends BaseBlockCipher
     {
         public CBC()
         {
             super(new CBCBlockCipher(new CamelliaEngine()), 128);
         }
     }
 
     public static class Wrap
         extends BaseWrapCipher
     {
         public Wrap()
         {
             super(new CamelliaWrapEngine());
         }
     }
 
     public static class RFC3211Wrap
         extends BaseWrapCipher
     {
         public RFC3211Wrap()
         {
             super(new RFC3211WrapEngine(new CamelliaEngine()), 16);
         }
     }
 
     public static class GMAC
         extends BaseMac
     {
         public GMAC()
         {
             super(new GMac(new GCMBlockCipher(new CamelliaEngine())));
         }
     }
 
     public static class Poly1305
         extends BaseMac
     {
         public Poly1305()
         {
             super(new org.bouncycastle.crypto.macs.Poly1305(new CamelliaEngine()));
         }
     }
 
     public static class Poly1305KeyGen
         extends BaseKeyGenerator
     {
         public Poly1305KeyGen()
         {
            super("Poly1305-Camellia", 256, new Poly1305KeyGenerator());
        }
    }
    public static class KeyGen
        extends BaseKeyGenerator
    {
        public KeyGen()
        {
            this(256);
        }
        public KeyGen(int keySize)
        {
            super("Camellia"keySizenew CipherKeyGenerator());
        }
    }
    public static class KeyGen128
        extends KeyGen
    {
        public KeyGen128()
        {
            super(128);
        }
    }
    public static class KeyGen192
        extends KeyGen
    {
        public KeyGen192()
        {
            super(192);
        }
    }
    public static class KeyGen256
        extends KeyGen
    {
        public KeyGen256()
        {
            super(256);
        }
    }
    public static class AlgParamGen
        extends BaseAlgorithmParameterGenerator
    {
        protected void engineInit(
            AlgorithmParameterSpec genParamSpec,
            SecureRandom random)
            throws InvalidAlgorithmParameterException
        {
            throw new InvalidAlgorithmParameterException("No supported AlgorithmParameterSpec for Camellia parameter generation.");
        }
        protected AlgorithmParameters engineGenerateParameters()
        {
            byte[] iv = new byte[16];
            if ( == null)
            {
                 = new SecureRandom();
            }
            .nextBytes(iv);
            AlgorithmParameters params;
            try
            {
                params = createParametersInstance("Camellia");
                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 "Camellia IV";
        }
    }
    public static class Mappings
        extends SymmetricAlgorithmProvider
    {
        private static final String PREFIX = Camellia.class.getName();
        public Mappings()
        {
        }
        public void configure(ConfigurableProvider provider)
        {
            provider.addAlgorithm("AlgorithmParameters.CAMELLIA" + "$AlgParams");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameters." + ."CAMELLIA");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameters." + ."CAMELLIA");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameters." + ."CAMELLIA");
            provider.addAlgorithm("AlgorithmParameterGenerator.CAMELLIA" + "$AlgParamGen");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator." + ."CAMELLIA");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator." + ."CAMELLIA");
            provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator." + ."CAMELLIA");
            provider.addAlgorithm("Cipher.CAMELLIA" + "$ECB");
            provider.addAlgorithm("Cipher." + . + "$CBC");
            provider.addAlgorithm("Cipher." + . + "$CBC");
            provider.addAlgorithm("Cipher." + . + "$CBC");
            provider.addAlgorithm("Cipher.CAMELLIARFC3211WRAP" + "$RFC3211Wrap");
            provider.addAlgorithm("Cipher.CAMELLIAWRAP" + "$Wrap");
            provider.addAlgorithm("Alg.Alias.Cipher." + ."CAMELLIAWRAP");
            provider.addAlgorithm("Alg.Alias.Cipher." + ."CAMELLIAWRAP");
            provider.addAlgorithm("Alg.Alias.Cipher." + ."CAMELLIAWRAP");
            provider.addAlgorithm("KeyGenerator.CAMELLIA" + "$KeyGen");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen128");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen192");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen256");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen128");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen192");
            provider.addAlgorithm("KeyGenerator." + . + "$KeyGen256");
            addGMacAlgorithm(provider"CAMELLIA" + "$GMAC" + "$KeyGen");
            addPoly1305Algorithm(provider"CAMELLIA" + "$Poly1305" + "$Poly1305KeyGen");
        }
    }
New to GrepCode? Check out our FAQ X