~brian-thomason/+junk/bouncycastle

« back to all changes in this revision

Viewing changes to src/org/bouncycastle/jce/provider/symmetric/Grain128.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:20:32 UTC
  • Revision ID: brian.thomason@canonical.com-20111220172032-rdtm13jgdxtksacr
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.bouncycastle.jce.provider.symmetric;
 
2
 
 
3
import java.util.HashMap;
 
4
 
 
5
import org.bouncycastle.crypto.CipherKeyGenerator;
 
6
import org.bouncycastle.crypto.engines.Grain128Engine;
 
7
import org.bouncycastle.jce.provider.JCEKeyGenerator;
 
8
import org.bouncycastle.jce.provider.JCEStreamCipher;
 
9
 
 
10
public final class Grain128
 
11
{
 
12
    private Grain128()
 
13
    {
 
14
    }
 
15
    
 
16
    public static class Base
 
17
        extends JCEStreamCipher
 
18
    {
 
19
        public Base()
 
20
        {
 
21
            super(new Grain128Engine(), 12);
 
22
        }
 
23
    }
 
24
 
 
25
    public static class KeyGen
 
26
        extends JCEKeyGenerator
 
27
    {
 
28
        public KeyGen()
 
29
        {
 
30
            super("Grain128", 128, new CipherKeyGenerator());
 
31
        }
 
32
    }
 
33
 
 
34
    public static class Mappings
 
35
        extends HashMap
 
36
    {
 
37
        public Mappings()
 
38
        {
 
39
            put("Cipher.Grain128", "org.bouncycastle.jce.provider.symmetric.Grain128$Base");
 
40
            put("KeyGenerator.Grain128", "org.bouncycastle.jce.provider.symmetric.Grain128$KeyGen");
 
41
        }
 
42
    }
 
43
}