directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [17/50] [abbrv] directory-kerberos git commit: Renaming packages in haox-kerb projects, using "apache"
Date Mon, 12 Jan 2015 13:06:25 GMT
http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Cmac.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Cmac.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Cmac.java
deleted file mode 100644
index c1ffb6f..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Cmac.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.haox.kerb.crypto;
-
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.KrbException;
-
-import java.util.Arrays;
-
-public class Cmac {
-
-    private static byte[] constRb = {
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0x87
-    };
-
-    public static byte[] cmac(EncryptProvider encProvider, byte[] key,
-                       byte[] data, int outputSize) throws KrbException {
-        return cmac(encProvider, key, data, 0, data.length, outputSize);
-    }
-
-    public static byte[] cmac(EncryptProvider encProvider, byte[] key, byte[] data,
-                       int start, int len, int outputSize) throws KrbException {
-        byte[] hash = Cmac.cmac(encProvider, key, data, start, len);
-        if (hash.length > outputSize) {
-            byte[] output = new byte[outputSize];
-            System.arraycopy(hash, 0, output, 0, outputSize);
-            return output;
-        } else {
-            return hash;
-        }
-    }
-
-    public static byte[] cmac(EncryptProvider encProvider,
-                              byte[] key, byte[] data) throws KrbException {
-        return cmac(encProvider, key, data, 0, data.length);
-    }
-
-    public static byte[] cmac(EncryptProvider encProvider,
-                              byte[] key, byte[] data, int start, int len) throws KrbException {
-
-        int blockSize = encProvider.blockSize();
-
-        byte[] Y = new byte[blockSize];
-        byte[] mLast = new byte[blockSize];
-        byte[] padded = new byte[blockSize];
-        byte[] K1 = new byte[blockSize];
-        byte[] K2 = new byte[blockSize];
-
-        // step 1
-        makeSubkey(encProvider, key, K1, K2);
-
-        // step 2
-        int n = (len + blockSize - 1) / blockSize;
-
-        // step 3
-        boolean lastIsComplete;
-        if (n == 0) {
-            n = 1;
-            lastIsComplete = false;
-        } else {
-            lastIsComplete = ((len % blockSize) == 0);
-        }
-
-        // Step 6 (all but last block)
-        byte[] cipherState = new byte[blockSize];
-        byte[] cipher = new byte[blockSize];
-        for (int i = 0; i < n - 1; i++) {
-            System.arraycopy(data, i * blockSize, cipher, 0, blockSize);
-            encryptBlock(encProvider, key, cipherState, cipher);
-            System.arraycopy(cipher, 0, cipherState, 0, blockSize);
-        }
-
-        // step 5
-        System.arraycopy(cipher, 0, Y, 0, blockSize);
-
-        // step 4
-        int lastPos = (n - 1) * blockSize;
-        int lastLen = lastIsComplete ? blockSize : len % blockSize;
-        byte[] lastBlock = new byte[lastLen];
-        System.arraycopy(data, lastPos, lastBlock, 0, lastLen);
-        if (lastIsComplete) {
-            Util.xor(lastBlock, K1, mLast);
-        } else {
-            padding(lastBlock, padded);
-            Util.xor(padded, K2, mLast);
-        }
-
-        // Step 6 (last block)
-        encryptBlock(encProvider, key, cipherState, mLast);
-
-        return mLast;
-    }
-
-    // Generate subkeys K1 and K2 as described in RFC 4493 figure 2.2.
-    private static void makeSubkey(EncryptProvider encProvider,
-                              byte[] key, byte[] K1, byte[] K2) throws KrbException {
-
-        // L := encrypt(K, const_Zero)
-        byte[] L = new byte[K1.length];
-        Arrays.fill(L, (byte) 0);
-        encryptBlock(encProvider, key, null, L);
-
-        // K1 := (MSB(L) == 0) ? L << 1 : (L << 1) XOR const_Rb
-        if ((L[0] & 0x80) == 0) {
-            leftShiftByOne(L, K1);
-        } else {
-            byte[] tmp = new byte[K1.length];
-            leftShiftByOne(L, tmp);
-            Util.xor(tmp, constRb, K1);
-        }
-
-        // K2 := (MSB(K1) == 0) ? K1 << 1 : (K1 << 1) XOR const_Rb
-        if ((K1[0] & 0x80) == 0) {
-            leftShiftByOne(K1, K2);
-        } else {
-            byte[] tmp = new byte[K1.length];
-            leftShiftByOne(K1, tmp);
-            Util.xor(tmp, constRb, K2);
-        }
-    }
-
-    private static void encryptBlock(EncryptProvider encProvider,
-                                     byte[] key, byte[] cipherState, byte[] block) throws KrbException {
-        if (cipherState == null) {
-            cipherState = new byte[encProvider.blockSize()];
-        }
-        if (encProvider.supportCbcMac()) {
-            encProvider.cbcMac(key, cipherState, block);
-        } else {
-            encProvider.encrypt(key, cipherState, block);
-        }
-    }
-
-    private static void leftShiftByOne(byte[] input, byte[] output) {
-        byte overflow = 0;
-
-        for (int i = input.length - 1; i >= 0; i--) {
-            output[i] = (byte) (input[i] << 1);
-            output[i] |= overflow;
-            overflow = (byte) ((input[i] & 0x80) != 0 ? 1 : 0);
-        }
-    }
-
-    // Padding out data with a 1 bit followed by 0 bits, placing the result in pad
-    private static void padding(byte[] data, byte[] padded) {
-        int len = data.length;
-
-        // original last block
-        System.arraycopy(data, 0, padded, 0, len);
-
-        padded[len] = (byte) 0x80;
-
-        for (int i = len + 1; i < padded.length; i++) {
-            padded[i] = 0x00;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Confounder.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Confounder.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Confounder.java
deleted file mode 100644
index c3918d1..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Confounder.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.haox.kerb.crypto;
-
-import java.security.SecureRandom;
-
-public final class Confounder {
-
-    private static SecureRandom srand = new SecureRandom();
-
-    public static byte[] makeBytes(int size) {
-        byte[] data = new byte[size];
-        srand.nextBytes(data);
-        return data;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Crc32.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Crc32.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Crc32.java
deleted file mode 100644
index 152d786..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Crc32.java
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.haox.kerb.crypto;
-
-public class Crc32 {
-
-    private static long[] crcTable = {
-            0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
-            0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
-            0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
-            0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
-            0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
-            0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
-            0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
-            0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
-            0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
-            0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
-            0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
-            0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
-            0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
-            0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
-            0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
-            0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
-            0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
-            0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
-            0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
-            0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
-            0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
-            0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
-            0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
-            0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
-            0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
-            0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
-            0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
-            0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
-            0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
-            0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
-            0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
-            0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
-            0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
-            0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
-            0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
-            0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
-            0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
-            0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
-            0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
-            0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
-            0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
-            0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
-            0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
-            0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
-            0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
-            0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
-            0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
-            0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
-            0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
-            0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
-            0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
-            0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
-            0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
-            0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
-            0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
-            0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
-            0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
-            0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
-            0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
-            0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
-            0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
-            0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
-            0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
-            0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-    };
-
-    public static byte[] crc(byte[] data, int start, int size) {
-        long c = crc(0, data, start, size);
-        return convert((int) c);
-    }
-
-    public static long crc(long seed, byte[] data, int start, int len) {
-        long c = seed;
-
-        int idx;
-        for (int i = 0; i < len; i++) {
-            idx = (int) ((data[start + i] ^ c) & 0xff);
-            c = ((c & 0xffffffffL) >>> 8) ^ crcTable[idx]; // why?
-        }
-
-        return c;
-    }
-
-    private static byte[] convert(int val) {
-        byte[] p = new byte[4];
-
-        p[3] = (byte) ((val >> 24) & 0xff);
-        p[2] = (byte) ((val >> 16) & 0xff);
-        p[1] = (byte) ((val >>  8) & 0xff);
-        p[0] = (byte) ((val      ) & 0xff);
-
-        return p;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/CryptoTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/CryptoTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/CryptoTypeHandler.java
deleted file mode 100644
index 560ee0c..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/CryptoTypeHandler.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.haox.kerb.crypto;
-
-import org.haox.kerb.crypto.cksum.HashProvider;
-import org.haox.kerb.crypto.enc.EncryptProvider;
-
-public interface CryptoTypeHandler {
-
-    public String name();
-
-    public String displayName();
-
-    public EncryptProvider encProvider();
-
-    public HashProvider hashProvider();
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Des.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Des.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Des.java
deleted file mode 100644
index d6ec1e6..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Des.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.haox.kerb.crypto;
-
-import javax.crypto.spec.DESKeySpec;
-import java.security.InvalidKeyException;
-
-public class Des {
-
-    public static boolean isWeakKey(byte[] key) {
-        try {
-            return (DESKeySpec.isWeak(key, 0));
-        } catch (InvalidKeyException ex) {
-            return true;
-        }
-    }
-
-    public static byte[] fixKey(byte[] key) {
-        if (Des.isWeakKey(key)) {
-            key[7] ^= 0xf0;
-        }
-        return key;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncTypeHandler.java
deleted file mode 100644
index c317077..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncTypeHandler.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.haox.kerb.crypto;
-
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.CheckSumType;
-import org.haox.kerb.spec.common.EncryptionType;
-
-public interface EncTypeHandler extends CryptoTypeHandler {
-
-    public EncryptionType eType();
-
-    public int keyInputSize();
-
-    public int keySize();
-
-    public int confounderSize();
-
-    public int checksumSize();
-
-    public int paddingSize();
-
-    public byte[] str2key(String string,
-                          String salt, byte[] param) throws KrbException;
-
-    public byte[] random2Key(byte[] randomBits) throws KrbException;
-
-    public CheckSumType checksumType();
-
-    public byte[] encrypt(byte[] data, byte[] key, int usage)
-        throws KrbException;
-
-    public byte[] encrypt(byte[] data, byte[] key, byte[] ivec,
-        int usage) throws KrbException;
-
-    public byte[] decrypt(byte[] cipher, byte[] key, int usage)
-        throws KrbException;
-
-    public byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec,
-        int usage) throws KrbException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncryptionHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncryptionHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncryptionHandler.java
deleted file mode 100644
index b173465..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/EncryptionHandler.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.haox.kerb.crypto;
-
-import org.haox.kerb.KrbErrorCode;
-import org.haox.kerb.crypto.enc.*;
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.*;
-
-public class EncryptionHandler {
-
-    public static EncryptionType getEncryptionType(String eType) throws KrbException {
-        EncryptionType result = EncryptionType.fromName(eType);
-        return result;
-    }
-
-    public static EncTypeHandler getEncHandler(String eType) throws KrbException {
-        EncryptionType result = EncryptionType.fromName(eType);
-        return getEncHandler(result);
-    }
-
-    public static EncTypeHandler getEncHandler(int eType) throws KrbException {
-        EncryptionType eTypeEnum = EncryptionType.fromValue(eType);
-        return getEncHandler(eTypeEnum);
-    }
-
-    public static EncTypeHandler getEncHandler(EncryptionType eType) throws KrbException {
-        return getEncHandler(eType, false);
-    }
-
-    private static EncTypeHandler getEncHandler(EncryptionType eType, boolean check) throws KrbException {
-        EncTypeHandler encHandler = null;
-        switch (eType) {
-            case DES_CBC_CRC:
-                encHandler = new DesCbcCrcEnc();
-                break;
-
-            case DES_CBC_MD5:
-            case DES:
-                encHandler = new DesCbcMd5Enc();
-                break;
-
-            case DES_CBC_MD4:
-                encHandler = new DesCbcMd4Enc();
-                break;
-
-            case DES3_CBC_SHA1:
-            case DES3_CBC_SHA1_KD:
-            case DES3_HMAC_SHA1:
-                encHandler = new Des3CbcSha1Enc();
-                break;
-
-            case AES128_CTS_HMAC_SHA1_96:
-            case AES128_CTS:
-                encHandler = new Aes128CtsHmacSha1Enc();
-                break;
-
-            case AES256_CTS_HMAC_SHA1_96:
-            case AES256_CTS:
-                encHandler = new Aes256CtsHmacSha1Enc();
-                break;
-
-            case CAMELLIA128_CTS_CMAC:
-            case CAMELLIA128_CTS:
-                encHandler = new Camellia128CtsCmacEnc();
-                break;
-
-            case CAMELLIA256_CTS_CMAC:
-            case CAMELLIA256_CTS:
-                encHandler = new Camellia256CtsCmacEnc();
-                break;
-
-            case RC4_HMAC:
-            case ARCFOUR_HMAC:
-            case ARCFOUR_HMAC_MD5:
-                encHandler = new Rc4HmacEnc();
-                break;
-
-            case RC4_HMAC_EXP:
-            case ARCFOUR_HMAC_EXP:
-            case ARCFOUR_HMAC_MD5_EXP:
-                encHandler = new Rc4HmacExpEnc();
-                break;
-
-            case NONE:
-            default:
-                break;
-        }
-
-        if (encHandler == null && ! check) {
-            String message = "Unsupported encryption type: " + eType.name();
-            throw new KrbException(KrbErrorCode.KDC_ERR_ETYPE_NOSUPP, message);
-        }
-
-        return encHandler;
-    }
-
-    public static EncryptedData encrypt(byte[] plainText, EncryptionKey key, KeyUsage usage) throws KrbException {
-        EncTypeHandler handler = getEncHandler(key.getKeyType());
-        byte[] cipher = handler.encrypt(plainText, key.getKeyData(), usage.getValue());
-
-        EncryptedData ed = new EncryptedData();
-        ed.setCipher(cipher);
-        ed.setEType(key.getKeyType());
-        ed.setKvno(key.getKvno());
-
-        return ed;
-    }
-
-    public static byte[] decrypt(byte[] data, EncryptionKey key, KeyUsage usage) throws KrbException {
-        EncTypeHandler handler = getEncHandler(key.getKeyType());
-
-        byte[] plainData = handler.decrypt(data, key.getKeyData(), usage.getValue());
-        return plainData;
-    }
-
-    public static byte[] decrypt(EncryptedData data, EncryptionKey key, KeyUsage usage) throws KrbException {
-        EncTypeHandler handler = getEncHandler(key.getKeyType());
-
-        byte[] plainData = handler.decrypt(data.getCipher(), key.getKeyData(), usage.getValue());
-        return plainData;
-    }
-
-    public static boolean isImplemented(EncryptionType eType) {
-        EncTypeHandler handler = null;
-        try {
-            handler = getEncHandler(eType, true);
-        } catch (KrbException e) {
-            return false;
-        }
-        return  handler != null;
-    }
-
-    public static EncryptionKey string2Key(String principalName,
-          String passPhrase, EncryptionType eType) throws KrbException {
-        PrincipalName principal = new PrincipalName(principalName);
-        return string2Key(passPhrase,
-                PrincipalName.makeSalt(principal), null, eType);
-    }
-
-    public static EncryptionKey string2Key(String string, String salt,
-                   byte[] s2kparams, EncryptionType eType) throws KrbException {
-        EncTypeHandler handler = getEncHandler(eType);
-        byte[] keyBytes = handler.str2key(string, salt, s2kparams);
-        return new EncryptionKey(eType, keyBytes);
-    }
-
-    public static EncryptionKey random2Key(EncryptionType eType) throws KrbException {
-        EncTypeHandler handler = getEncHandler(eType);
-
-        byte[] randomBytes = Random.makeBytes(handler.keyInputSize());
-        byte[] keyBytes = handler.random2Key(randomBytes);
-        EncryptionKey encKey = new EncryptionKey(eType, keyBytes);
-        return encKey;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Hmac.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Hmac.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Hmac.java
deleted file mode 100644
index a5b58dd..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Hmac.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.haox.kerb.crypto;
-
-import org.haox.kerb.crypto.cksum.HashProvider;
-import org.haox.kerb.KrbException;
-
-public class Hmac {
-
-    public static byte[] hmac(HashProvider hashProvider, byte[] key,
-                       byte[] data, int outputSize) throws KrbException {
-        return hmac(hashProvider, key, data, 0, data.length, outputSize);
-    }
-
-    public static byte[] hmac(HashProvider hashProvider, byte[] key, byte[] data,
-                       int start, int len, int outputSize) throws KrbException {
-        byte[] hash = Hmac.hmac(hashProvider, key, data, start, len);
-
-        byte[] output = new byte[outputSize];
-        System.arraycopy(hash, 0, output, 0, outputSize);
-        return output;
-    }
-
-    public static byte[] hmac(HashProvider hashProvider,
-                              byte[] key, byte[] data) throws KrbException {
-        return hmac(hashProvider, key, data, 0, data.length);
-    }
-
-    public static byte[] hmac(HashProvider hashProvider,
-                              byte[] key, byte[] data, int start, int len) throws KrbException {
-
-        int blockLen = hashProvider.blockSize();
-        byte[] ipad = new byte[blockLen];
-        byte[] opad = new byte[blockLen];
-
-        int ki;
-        for (int i = 0; i < blockLen; i++) {
-            ki = (i < key.length) ? key[i] : 0;
-            ipad[i] = (byte)(ki ^ 0x36);
-            opad[i] = (byte)(ki ^ 0x5c);
-        }
-
-        hashProvider.hash(ipad);
-
-        hashProvider.hash(data, start, len);
-
-        byte[] tmp = hashProvider.output();
-
-        hashProvider.hash(opad);
-        hashProvider.hash(tmp);
-
-        tmp = hashProvider.output();
-        return tmp;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Md4.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Md4.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Md4.java
deleted file mode 100644
index 0c09cbf..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Md4.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package org.haox.kerb.crypto;
-
-//http://www.java2s.com/Code/Java/Security/ImplementstheMD4messagedigestalgorithminJava.htm
-
-/*
- * Copyright (c) 1997 Systemics Ltd
- * on behalf of the Cryptix Development Team.  All rights reserved.
- */
-
-import java.security.MessageDigest;
-
-/**
- * Implements the MD4 message digest algorithm in Java.
- * <p>
- * <b>References:</b>
- * <ol>
- *   <li> Ronald L. Rivest,
- *        "<a href="http://www.roxen.com/rfc/rfc1320.html">
- *        The MD4 Message-Digest Algorithm</a>",
- *        IETF RFC-1320 (informational).
- * </ol>
- *
- * <p><b>$Revision: 1.2 $</b>
- * @author  Raif S. Naffah
- */
-public  class Md4 extends MessageDigest implements Cloneable
-{
-    /**
-     * The size in bytes of the input block to the tranformation algorithm.
-     */
-    private static final int BLOCK_LENGTH = 64;       //    = 512 / 8;
-
-    /**
-     * 4 32-bit words (interim result)
-     */
-    private int[] context = new int[4];
-
-    /**
-     * Number of bytes processed so far mod. 2 power of 64.
-     */
-    private long count;
-
-    /**
-     * 512 bits input buffer = 16 x 32-bit words holds until reaches 512 bits.
-     */
-    private byte[] buffer = new byte[BLOCK_LENGTH];
-
-    /**
-     * 512 bits work buffer = 16 x 32-bit words
-     */
-    private int[] X = new int[16];
-
-    public Md4() {
-        super("MD4");
-        engineReset();
-    }
-
-    /**
-     *    This constructor is here to implement cloneability of this class.
-     */
-    private Md4(Md4 md) {
-        this();
-        context = (int[])md.context.clone();
-        buffer = (byte[])md.buffer.clone();
-        count = md.count;
-    }
-
-    /**
-     * Returns a copy of this MD object.
-     */
-    public Object clone() { return new Md4(this); }
-
-    /**
-     * Resets this object disregarding any temporary data present at the
-     * time of the invocation of this call.
-     */
-    public void engineReset () {
-        // initial values of MD4 i.e. A, B, C, D
-        // as per rfc-1320; they are low-order byte first
-        context[0] = 0x67452301;
-        context[1] = 0xEFCDAB89;
-        context[2] = 0x98BADCFE;
-        context[3] = 0x10325476;
-        count = 0L;
-        for (int i = 0; i < BLOCK_LENGTH; i++)
-            buffer[i] = 0;
-    }
-
-    /**
-     * Continues an MD4 message digest using the input byte.
-     */
-    public void engineUpdate (byte b) {
-        // compute number of bytes still unhashed; ie. present in buffer
-        int i = (int)(count % BLOCK_LENGTH);
-        count++;                                        // update number of bytes
-        buffer[i] = b;
-        if (i == BLOCK_LENGTH - 1)
-            transform(buffer, 0);
-    }
-
-    /**
-     * MD4 block update operation.
-     * <p>
-     * Continues an MD4 message digest operation, by filling the buffer,
-     * transform(ing) data in 512-bit message block(s), updating the variables
-     * context and count, and leaving (buffering) the remaining bytes in buffer
-     * for the next update or finish.
-     *
-     * @param    input    input block
-     * @param    offset    start of meaningful bytes in input
-     * @param    len        count of bytes in input block to consider
-     */
-    public void engineUpdate (byte[] input, int offset, int len) {
-        // make sure we don't exceed input's allocated size/length
-        if (offset < 0 || len < 0 || (long)offset + len > input.length)
-            throw new ArrayIndexOutOfBoundsException();
-
-        // compute number of bytes still unhashed; ie. present in buffer
-        int bufferNdx = (int)(count % BLOCK_LENGTH);
-        count += len;                                        // update number of bytes
-        int partLen = BLOCK_LENGTH - bufferNdx;
-        int i = 0;
-        if (len >= partLen) {
-            System.arraycopy(input, offset, buffer, bufferNdx, partLen);
-
-
-            transform(buffer, 0);
-
-            for (i = partLen; i + BLOCK_LENGTH - 1 < len; i+= BLOCK_LENGTH)
-                transform(input, offset + i);
-            bufferNdx = 0;
-        }
-        // buffer remaining input
-        if (i < len)
-            System.arraycopy(input, offset + i, buffer, bufferNdx, len - i);
-    }
-
-    /**
-     * Completes the hash computation by performing final operations such
-     * as padding. At the return of this engineDigest, the MD engine is
-     * reset.
-     *
-     * @return the array of bytes for the resulting hash value.
-     */
-    public byte[] engineDigest () {
-        // pad output to 56 mod 64; as RFC1320 puts it: congruent to 448 mod 512
-        int bufferNdx = (int)(count % BLOCK_LENGTH);
-        int padLen = (bufferNdx < 56) ? (56 - bufferNdx) : (120 - bufferNdx);
-
-        // padding is alwas binary 1 followed by binary 0s
-        byte[] tail = new byte[padLen + 8];
-        tail[0] = (byte)0x80;
-
-        // append length before final transform:
-        // save number of bits, casting the long to an array of 8 bytes
-        // save low-order byte first.
-        for (int i = 0; i < 8; i++)
-            tail[padLen + i] = (byte)((count * 8) >>> (8 * i));
-
-        engineUpdate(tail, 0, tail.length);
-
-        byte[] result = new byte[16];
-        // cast this MD4's context (array of 4 ints) into an array of 16 bytes.
-        for (int i = 0; i < 4; i++)
-            for (int j = 0; j < 4; j++)
-                result[i * 4 + j] = (byte)(context[i] >>> (8 * j));
-
-        // reset the engine
-        engineReset();
-        return result;
-    }
-
-    /**
-     *    MD4 basic transformation.
-     *    <p>
-     *    Transforms context based on 512 bits from input block starting
-     *    from the offset'th byte.
-     *
-     *    @param    block    input sub-array.
-     *    @param    offset    starting position of sub-array.
-     */
-    private void transform (byte[] block, int offset) {
-
-        // encodes 64 bytes from input block into an array of 16 32-bit
-        // entities. Use A as a temp var.
-        for (int i = 0; i < 16; i++)
-            X[i] = (block[offset++] & 0xFF)       |
-                    (block[offset++] & 0xFF) <<  8 |
-                    (block[offset++] & 0xFF) << 16 |
-                    (block[offset++] & 0xFF) << 24;
-
-
-        int A = context[0];
-        int B = context[1];
-        int C = context[2];
-        int D = context[3];
-
-        A = FF(A, B, C, D, X[ 0],  3);
-        D = FF(D, A, B, C, X[ 1],  7);
-        C = FF(C, D, A, B, X[ 2], 11);
-        B = FF(B, C, D, A, X[ 3], 19);
-        A = FF(A, B, C, D, X[ 4],  3);
-        D = FF(D, A, B, C, X[ 5],  7);
-        C = FF(C, D, A, B, X[ 6], 11);
-        B = FF(B, C, D, A, X[ 7], 19);
-        A = FF(A, B, C, D, X[ 8],  3);
-        D = FF(D, A, B, C, X[ 9],  7);
-        C = FF(C, D, A, B, X[10], 11);
-        B = FF(B, C, D, A, X[11], 19);
-        A = FF(A, B, C, D, X[12],  3);
-        D = FF(D, A, B, C, X[13],  7);
-        C = FF(C, D, A, B, X[14], 11);
-        B = FF(B, C, D, A, X[15], 19);
-
-        A = GG(A, B, C, D, X[ 0],  3);
-        D = GG(D, A, B, C, X[ 4],  5);
-        C = GG(C, D, A, B, X[ 8],  9);
-        B = GG(B, C, D, A, X[12], 13);
-        A = GG(A, B, C, D, X[ 1],  3);
-        D = GG(D, A, B, C, X[ 5],  5);
-        C = GG(C, D, A, B, X[ 9],  9);
-        B = GG(B, C, D, A, X[13], 13);
-        A = GG(A, B, C, D, X[ 2],  3);
-        D = GG(D, A, B, C, X[ 6],  5);
-        C = GG(C, D, A, B, X[10],  9);
-        B = GG(B, C, D, A, X[14], 13);
-        A = GG(A, B, C, D, X[ 3],  3);
-        D = GG(D, A, B, C, X[ 7],  5);
-        C = GG(C, D, A, B, X[11],  9);
-        B = GG(B, C, D, A, X[15], 13);
-
-        A = HH(A, B, C, D, X[ 0],  3);
-        D = HH(D, A, B, C, X[ 8],  9);
-        C = HH(C, D, A, B, X[ 4], 11);
-        B = HH(B, C, D, A, X[12], 15);
-        A = HH(A, B, C, D, X[ 2],  3);
-        D = HH(D, A, B, C, X[10],  9);
-        C = HH(C, D, A, B, X[ 6], 11);
-        B = HH(B, C, D, A, X[14], 15);
-        A = HH(A, B, C, D, X[ 1],  3);
-        D = HH(D, A, B, C, X[ 9],  9);
-        C = HH(C, D, A, B, X[ 5], 11);
-        B = HH(B, C, D, A, X[13], 15);
-        A = HH(A, B, C, D, X[ 3],  3);
-        D = HH(D, A, B, C, X[11],  9);
-        C = HH(C, D, A, B, X[ 7], 11);
-        B = HH(B, C, D, A, X[15], 15);
-
-        context[0] += A;
-        context[1] += B;
-        context[2] += C;
-        context[3] += D;
-    }
-
-    // The basic MD4 atomic functions.
-
-    private int FF (int a, int b, int c, int d, int x, int s) {
-        int t = a + ((b & c) | (~b & d)) + x;
-        return t << s | t >>> (32 - s);
-    }
-    private int GG (int a, int b, int c, int d, int x, int s) {
-        int t = a + ((b & (c | d)) | (c & d)) + x + 0x5A827999;
-        return t << s | t >>> (32 - s);
-    }
-    private int HH (int a, int b, int c, int d, int x, int s) {
-        int t = a + (b ^ c ^ d) + x + 0x6ED9EBA1;
-        return t << s | t >>> (32 - s);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nfold.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nfold.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nfold.java
deleted file mode 100644
index 3e1aeba..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nfold.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.haox.kerb.crypto;
-
-import java.util.Arrays;
-
-public class Nfold {
-
-    public static byte[] nfold(byte[] input, int size) {
-
-        int inbits = input.length;
-
-        int a, b, c, lcm;
-        a = size;
-        b = inbits;
-
-        while (b != 0) {
-            c = b;
-            b = a % b;
-            a = c;
-        }
-        lcm = size*inbits/a;
-
-        byte[] out = new byte[size];
-        Arrays.fill(out, (byte)0);
-
-        int thisbyte = 0;
-        int msbit, i, bval, oval;
-
-        for (i = lcm-1; i >= 0; i--) {
-            msbit = (
-                ((inbits<<3)-1)
-                + (((inbits<<3)+13)*(i/inbits))
-                + ((inbits-(i%inbits)) << 3)) % (inbits << 3);
-
-            bval =  ((((input[((inbits-1)-(msbit>>>3))%inbits]&0xff)<<8)|
-                (input[((inbits)-(msbit>>>3))%inbits]&0xff))
-                >>>((msbit&7)+1))&0xff;
-
-            thisbyte += bval;
-            oval = (out[i%size]&0xff);
-            thisbyte += oval;
-            out[i%size] = (byte) (thisbyte&0xff);
-
-            thisbyte >>>= 8;
-        }
-
-        if (thisbyte != 0) {
-            for (i = size-1; i >= 0; i--) {
-                thisbyte += (out[i]&0xff);
-                out[i] = (byte) (thisbyte&0xff);
-
-                thisbyte >>>= 8;
-            }
-        }
-
-        return out;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nonce.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nonce.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nonce.java
deleted file mode 100644
index 7062ddd..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Nonce.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.haox.kerb.crypto;
-
-import java.security.SecureRandom;
-
-public class Nonce {
-
-    private static SecureRandom srand = new SecureRandom();
-
-    public static synchronized int value() {
-        int value = srand.nextInt();
-        return value & 0x7fffffff;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Pbkdf.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Pbkdf.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Pbkdf.java
deleted file mode 100644
index 3ad7a65..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Pbkdf.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.haox.kerb.crypto;
-
-import javax.crypto.SecretKey;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.PBEKeySpec;
-import java.security.GeneralSecurityException;
-
-public class Pbkdf {
-
-    public static byte[] PBKDF2(char[] secret, byte[] salt,
-                                   int count, int keySize) throws GeneralSecurityException {
-
-        PBEKeySpec ks = new PBEKeySpec(secret, salt, count, keySize * 8);
-        SecretKeyFactory skf =
-                SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
-        SecretKey key = skf.generateSecret(ks);
-        byte[] result = key.getEncoded();
-
-        return result;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Random.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Random.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Random.java
deleted file mode 100644
index 463f6ea..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Random.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.haox.kerb.crypto;
-
-import java.security.SecureRandom;
-
-public final class Random {
-
-    private static SecureRandom srand = new SecureRandom();
-
-    public static byte[] makeBytes(int size) {
-        byte[] data = new byte[size];
-        srand.nextBytes(data);
-        return data;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Rc4.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Rc4.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Rc4.java
deleted file mode 100644
index af3959b..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Rc4.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.haox.kerb.crypto;
-
-public class Rc4 {
-
-    private static byte[] L40 = "fortybits".getBytes();
-
-    public static byte[] getSalt(int usage, boolean exportable) {
-        int msUsage = convertUsage(usage);
-        byte[] salt;
-
-        if (exportable) {
-            salt = new byte[14];
-            System.arraycopy(L40, 0, salt, 0, 9);
-            BytesUtil.int2bytes(msUsage, salt, 10, false);
-        } else {
-            salt = new byte[4];
-            BytesUtil.int2bytes(msUsage, salt, 0, false);
-        }
-
-        return salt;
-    }
-
-    public static int convertUsage(int usage) {
-        switch (usage) {
-            case 3: return 8;
-            case 9: return 8;
-            case 23: return 13;
-            default: return usage;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Util.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Util.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Util.java
deleted file mode 100644
index 61cc2dd..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/Util.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.haox.kerb.crypto;
-
-public class Util {
-
-    public static void xor(byte[] input, int offset, byte[] output) {
-        int a, b;
-        for (int i = 0; i < output.length / 4; ++i) {
-            a = BytesUtil.bytes2int(input, offset + i * 4, true);
-            b = BytesUtil.bytes2int(output, i * 4, true);
-            b = a ^ b;
-            BytesUtil.int2bytes(b, output, i * 4, true);
-        }
-    }
-
-    public static void xor(byte[] a, byte[] b, byte[] output) {
-        int av, bv, v;
-        for (int i = 0; i < a.length / 4; ++i) {
-            av = BytesUtil.bytes2int(a, i * 4, true);
-            bv = BytesUtil.bytes2int(b, i * 4, true);
-            v = av ^ bv;
-            BytesUtil.int2bytes(v, output, i * 4, true);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractCheckSumTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractCheckSumTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractCheckSumTypeHandler.java
deleted file mode 100644
index 2099875..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractCheckSumTypeHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.AbstractCryptoTypeHandler;
-import org.haox.kerb.crypto.CheckSumTypeHandler;
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.KrbException;
-
-public abstract class AbstractCheckSumTypeHandler
-        extends AbstractCryptoTypeHandler implements CheckSumTypeHandler {
-
-    private int computeSize;
-    private int outputSize;
-
-    public AbstractCheckSumTypeHandler(EncryptProvider encProvider, HashProvider hashProvider,
-                                       int computeSize, int outputSize) {
-        super(encProvider, hashProvider);
-        this.computeSize = computeSize;
-        this.outputSize = outputSize;
-    }
-
-    @Override
-    public String name() {
-        return cksumType().getName();
-    }
-
-    @Override
-    public String displayName() {
-        return cksumType().getDisplayName();
-    }
-
-    @Override
-    public int computeSize() {
-        return computeSize;
-    }
-
-    @Override
-    public int outputSize() {
-        return outputSize;
-    }
-
-    public boolean isSafe() {
-        return false;
-    }
-
-    public int cksumSize() {
-        return 4;
-    }
-
-    public int keySize() {
-        return 0;
-    }
-
-    public int confounderSize() {
-        return 0;
-    }
-
-    @Override
-    public byte[] checksum(byte[] data) throws KrbException {
-        return checksum(data, 0, data.length);
-    }
-
-    @Override
-    public byte[] checksum(byte[] data, int start, int size) throws KrbException {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public boolean verify(byte[] data, byte[] checksum) throws KrbException {
-        return verify(data, 0, data.length, checksum);
-    }
-
-    @Override
-    public boolean verify(byte[] data, int start, int size, byte[] checksum) throws KrbException {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public byte[] checksumWithKey(byte[] data,
-                                  byte[] key, int usage) throws KrbException {
-        return checksumWithKey(data, 0, data.length, key, usage);
-    }
-
-    @Override
-    public byte[] checksumWithKey(byte[] data, int start, int size,
-                                  byte[] key, int usage) throws KrbException {
-        throw new UnsupportedOperationException();
-    }
-    @Override
-    public boolean verifyWithKey(byte[] data,
-                                 byte[] key, int usage, byte[] checksum) throws KrbException {
-        throw new UnsupportedOperationException();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractKeyedCheckSumTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractKeyedCheckSumTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractKeyedCheckSumTypeHandler.java
deleted file mode 100644
index bfc84e5..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/AbstractKeyedCheckSumTypeHandler.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.crypto.key.KeyMaker;
-import org.haox.kerb.KrbException;
-
-public abstract class AbstractKeyedCheckSumTypeHandler extends AbstractCheckSumTypeHandler {
-
-    private KeyMaker keyMaker;
-
-    public AbstractKeyedCheckSumTypeHandler(EncryptProvider encProvider, HashProvider hashProvider,
-                                            int computeSize, int outputSize) {
-        super(encProvider, hashProvider, computeSize, outputSize);
-    }
-
-    protected void keyMaker(KeyMaker keyMaker) {
-        this.keyMaker = keyMaker;
-    }
-
-    protected KeyMaker keyMaker() {
-        return keyMaker;
-    }
-
-    @Override
-    public byte[] checksumWithKey(byte[] data,
-                                  byte[] key, int usage) throws KrbException {
-        return checksumWithKey(data, 0, data.length, key, usage);
-    }
-
-    @Override
-    public byte[] checksumWithKey(byte[] data, int start, int len,
-                                  byte[] key, int usage) throws KrbException {
-        int outputSize = outputSize();
-
-        byte[] tmp = doChecksumWithKey(data, start, len, key, usage);
-        if (outputSize < tmp.length) {
-            byte[] output = new byte[outputSize];
-            System.arraycopy(tmp, 0, output, 0, outputSize);
-            return output;
-        } else {
-            return tmp;
-        }
-    }
-
-    protected byte[] doChecksumWithKey(byte[] data, int start, int len,
-                                       byte[] key, int usage) throws KrbException {
-        return new byte[0];
-    }
-
-    @Override
-    public boolean verifyWithKey(byte[] data, byte[] key,
-                                 int usage, byte[] checksum) throws KrbException {
-        byte[] newCksum = checksumWithKey(data, key, usage);
-        return checksumEqual(checksum, newCksum);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia128CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia128CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia128CheckSum.java
deleted file mode 100644
index 96c4d50..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia128CheckSum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.provider.Camellia128Provider;
-import org.haox.kerb.crypto.key.CamelliaKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class CmacCamellia128CheckSum extends CmacKcCheckSum {
-
-    public CmacCamellia128CheckSum() {
-        super(new Camellia128Provider(), 16, 16);
-
-        keyMaker(new CamelliaKeyMaker((Camellia128Provider) encProvider()));
-    }
-
-    public int confounderSize() {
-        return 16;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.CMAC_CAMELLIA128;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 16;  // bytes
-    }
-
-    public int keySize() {
-        return 16;   // bytes
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia256CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia256CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia256CheckSum.java
deleted file mode 100644
index 5c16758..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacCamellia256CheckSum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.provider.Camellia256Provider;
-import org.haox.kerb.crypto.key.CamelliaKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class CmacCamellia256CheckSum extends CmacKcCheckSum {
-
-    public CmacCamellia256CheckSum() {
-        super(new Camellia256Provider(), 16, 16);
-
-        keyMaker(new CamelliaKeyMaker((Camellia256Provider) encProvider()));
-    }
-
-    public int confounderSize() {
-        return 16;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.CMAC_CAMELLIA256;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 16;  // bytes
-    }
-
-    public int keySize() {
-        return 16;   // bytes
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacKcCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacKcCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacKcCheckSum.java
deleted file mode 100644
index 3ceaf4b..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/CmacKcCheckSum.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.Cmac;
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.KrbException;
-
-public abstract class CmacKcCheckSum extends KcCheckSum {
-
-    public CmacKcCheckSum(EncryptProvider encProvider, int computeSize, int outputSize) {
-        super(encProvider, null, computeSize, outputSize);
-    }
-
-    protected byte[] mac(byte[] Kc, byte[] data, int start, int len) throws KrbException {
-        byte[] mac = Cmac.cmac(encProvider(), Kc, data, start, len);
-        return mac;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/ConfounderedDesCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/ConfounderedDesCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/ConfounderedDesCheckSum.java
deleted file mode 100644
index 2339b03..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/ConfounderedDesCheckSum.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.Confounder;
-import org.haox.kerb.crypto.enc.provider.DesProvider;
-import org.haox.kerb.KrbException;
-
-import javax.crypto.spec.DESKeySpec;
-import java.security.InvalidKeyException;
-
-public abstract class ConfounderedDesCheckSum extends AbstractKeyedCheckSumTypeHandler {
-
-    public ConfounderedDesCheckSum(HashProvider hashProvider,
-                                   int computeSize, int outputSize) {
-        super(new DesProvider(), hashProvider, computeSize, outputSize);
-    }
-
-    @Override
-    protected byte[] doChecksumWithKey(byte[] data, int start, int len,
-                                       byte[] key, int usage) throws KrbException {
-        int computeSize = computeSize();
-        int blockSize = encProvider().blockSize();
-        int hashSize = hashProvider().hashSize();
-
-        byte[] workBuffer = new byte[computeSize];
-
-        // confounder
-        byte[] conf = Confounder.makeBytes(blockSize);
-
-        // confounder | data
-        byte[] toHash = new byte[blockSize + len];
-        System.arraycopy(conf, 0, toHash, 0, blockSize);
-        System.arraycopy(data, start, toHash, blockSize, len);
-
-        HashProvider hashProvider = hashProvider();
-        hashProvider.hash(toHash);
-        byte[] hash = hashProvider.output();
-
-        // confounder | hash
-        System.arraycopy(conf, 0, workBuffer, 0, blockSize);
-        System.arraycopy(hash, 0, workBuffer, blockSize, hashSize);
-
-        // key
-        byte[] newKey = deriveKey(key);
-
-        encProvider().encrypt(newKey, workBuffer);
-        return workBuffer;
-    }
-
-    protected byte[] deriveKey(byte[] key) {
-        return fixKey(xorKey(key));
-    }
-
-    protected byte[] xorKey(byte[] key) {
-        byte[] xorKey = new byte[encProvider().keySize()];
-        System.arraycopy(key, 0, xorKey, 0, key.length);
-        for (int i = 0; i < xorKey.length; i++) {
-            xorKey[i] = (byte) (xorKey[i] ^ 0xf0);
-        }
-
-        return xorKey;
-    }
-
-    private byte[] fixKey(byte[] key) {
-        boolean isWeak = true;
-        try {
-            isWeak = DESKeySpec.isWeak(key, 0);
-        } catch (InvalidKeyException e) {
-            e.printStackTrace();
-        }
-        if (isWeak) {
-            key[7] = (byte)(key[7] ^ 0xF0);
-        }
-
-        return key;
-    }
-
-    @Override
-    public boolean verifyWithKey(byte[] data,byte[] key,
-                                 int usage, byte[] checksum) throws KrbException {
-        int computeSize = computeSize();
-        int blockSize = encProvider().blockSize();
-        int hashSize = hashProvider().hashSize();
-
-        // key
-        byte[] newKey = deriveKey(key);
-
-        encProvider().decrypt(newKey, checksum);
-        byte[] decrypted = checksum; // confounder | hash
-
-        // confounder | data
-        byte[] toHash = new byte[blockSize + data.length];
-        System.arraycopy(decrypted, 0, toHash, 0, blockSize);
-        System.arraycopy(data, 0, toHash, blockSize, data.length);
-
-        HashProvider hashProvider = hashProvider();
-        hashProvider.hash(toHash);
-        byte[] newHash = hashProvider.output();
-
-        return checksumEqual(newHash, decrypted, blockSize, hashSize);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Crc32CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Crc32CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Crc32CheckSum.java
deleted file mode 100644
index f37f0ef..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Crc32CheckSum.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.AbstractUnkeyedCheckSumTypeHandler;
-import org.haox.kerb.crypto.cksum.provider.Crc32Provider;
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class Crc32CheckSum extends AbstractUnkeyedCheckSumTypeHandler {
-
-    public Crc32CheckSum() {
-        super(new Crc32Provider(), 4, 4);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.CRC32;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/DesCbcCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/DesCbcCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/DesCbcCheckSum.java
deleted file mode 100644
index ebaf035..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/DesCbcCheckSum.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class DesCbcCheckSum extends ConfounderedDesCheckSum {
-
-    public DesCbcCheckSum() {
-        super(null, 8, 8);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.DES_CBC;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HashProvider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HashProvider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HashProvider.java
deleted file mode 100644
index f19accc..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HashProvider.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.KrbException;
-
-/**
- * krb5_hash_provider
- */
-public interface HashProvider {
-
-    public int hashSize();
-    public int blockSize();
-
-    public void hash(byte[] data, int start, int size) throws KrbException;
-    public void hash(byte[] data) throws KrbException;
-    public byte[] output();
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacKcCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacKcCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacKcCheckSum.java
deleted file mode 100644
index 3c33470..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacKcCheckSum.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.Hmac;
-import org.haox.kerb.crypto.cksum.provider.Sha1Provider;
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.KrbException;
-
-public abstract class HmacKcCheckSum extends KcCheckSum {
-
-    public HmacKcCheckSum(EncryptProvider encProvider, int computeSize, int outputSize) {
-        super(encProvider, new Sha1Provider(), computeSize, outputSize);
-    }
-
-    protected byte[] mac(byte[] Kc, byte[] data, int start, int len) throws KrbException {
-        byte[] hmac = Hmac.hmac(hashProvider(), Kc, data, start, len);
-        return hmac;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacMd5Rc4CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacMd5Rc4CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacMd5Rc4CheckSum.java
deleted file mode 100644
index 99bf909..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacMd5Rc4CheckSum.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.Hmac;
-import org.haox.kerb.crypto.Rc4;
-import org.haox.kerb.crypto.cksum.provider.Md5Provider;
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class HmacMd5Rc4CheckSum extends AbstractKeyedCheckSumTypeHandler {
-
-    public HmacMd5Rc4CheckSum() {
-        super(null, new Md5Provider(), 16, 16);
-    }
-
-    public int confounderSize() {
-        return 8;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.HMAC_MD5_ARCFOUR;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 16;  // bytes
-    }
-
-    public int keySize() {
-        return 16;   // bytes
-    }
-
-    @Override
-    protected byte[] doChecksumWithKey(byte[] data, int start, int len,
-                                       byte[] key, int usage) throws KrbException {
-
-        byte[] Ksign = null;
-        byte[] signKey = "signaturekey".getBytes();
-        byte[] newSignKey = new byte[signKey.length + 1];
-        System.arraycopy(signKey, 0, newSignKey, 0, signKey.length);
-        Ksign = Hmac.hmac(hashProvider(), key, newSignKey);
-
-        byte[] salt = Rc4.getSalt(usage, false);
-
-        hashProvider().hash(salt);
-        hashProvider().hash(data, start, len);
-        byte[] hashTmp = hashProvider().output();
-
-        byte[] hmac = Hmac.hmac(hashProvider(), Ksign, hashTmp);
-        return hmac;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes128CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes128CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes128CheckSum.java
deleted file mode 100644
index 090252a..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes128CheckSum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.provider.Aes128Provider;
-import org.haox.kerb.crypto.key.AesKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class HmacSha1Aes128CheckSum extends HmacKcCheckSum {
-
-    public HmacSha1Aes128CheckSum() {
-        super(new Aes128Provider(), 20, 12);
-
-        keyMaker(new AesKeyMaker((Aes128Provider) encProvider()));
-    }
-
-    public int confounderSize() {
-        return 16;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.HMAC_SHA1_96_AES128;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 12;  // bytes
-    }
-
-    public int keySize() {
-        return 16;   // bytes
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes256CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes256CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes256CheckSum.java
deleted file mode 100644
index fa7c8dc..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Aes256CheckSum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.provider.Aes256Provider;
-import org.haox.kerb.crypto.key.AesKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class HmacSha1Aes256CheckSum extends HmacKcCheckSum {
-
-    public HmacSha1Aes256CheckSum() {
-        super(new Aes256Provider(), 20, 12);
-
-        keyMaker(new AesKeyMaker((Aes256Provider) encProvider()));
-    }
-
-    public int confounderSize() {
-        return 16;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.HMAC_SHA1_96_AES256;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 12;  // bytes
-    }
-
-    public int keySize() {
-        return 32;   // bytes
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Des3CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Des3CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Des3CheckSum.java
deleted file mode 100644
index dafa537..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/HmacSha1Des3CheckSum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.enc.provider.Des3Provider;
-import org.haox.kerb.crypto.key.Des3KeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class HmacSha1Des3CheckSum extends HmacKcCheckSum {
-
-    public HmacSha1Des3CheckSum() {
-        super(new Des3Provider(), 20, 20);
-
-        keyMaker(new Des3KeyMaker(encProvider()));
-    }
-
-    public int confounderSize() {
-        return 8;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.HMAC_SHA1_DES3;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 20;  // bytes
-    }
-
-    public int keySize() {
-        return 24;   // bytes
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/KcCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/KcCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/KcCheckSum.java
deleted file mode 100644
index d497fd7..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/KcCheckSum.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.BytesUtil;
-import org.haox.kerb.crypto.enc.EncryptProvider;
-import org.haox.kerb.crypto.key.DkKeyMaker;
-import org.haox.kerb.KrbException;
-
-public abstract class KcCheckSum extends AbstractKeyedCheckSumTypeHandler {
-
-    public KcCheckSum(EncryptProvider encProvider, HashProvider hashProvider,
-                      int computeSize, int outputSize) {
-        super(encProvider, hashProvider, computeSize, outputSize);
-    }
-
-    @Override
-    protected byte[] doChecksumWithKey(byte[] data, int start, int len,
-                                       byte[] key, int usage) throws KrbException {
-        byte[] Kc;
-        byte[] constant = new byte[5];
-        BytesUtil.int2bytes(usage, constant, 0, true);
-        constant[4] = (byte) 0x99;
-        Kc = ((DkKeyMaker) keyMaker()).dk(key, constant);
-
-        byte[] mac = mac(Kc, data, start, len);
-        return mac;
-    }
-
-    protected abstract byte[] mac(byte[] Kc, byte[] data, int start, int len) throws KrbException;
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Md5HmacRc4CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Md5HmacRc4CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Md5HmacRc4CheckSum.java
deleted file mode 100644
index db0c658..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Md5HmacRc4CheckSum.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.Hmac;
-import org.haox.kerb.crypto.Rc4;
-import org.haox.kerb.crypto.cksum.provider.Md5Provider;
-import org.haox.kerb.crypto.enc.provider.Rc4Provider;
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class Md5HmacRc4CheckSum extends AbstractKeyedCheckSumTypeHandler {
-
-    public Md5HmacRc4CheckSum() {
-        super(new Rc4Provider(), new Md5Provider(), 16, 16);
-    }
-
-    public int confounderSize() {
-        return 8;
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.MD5_HMAC_ARCFOUR;
-    }
-
-    public boolean isSafe() {
-        return true;
-    }
-
-    public int cksumSize() {
-        return 16;  // bytes
-    }
-
-    public int keySize() {
-        return 16;   // bytes
-    }
-
-    @Override
-    protected byte[] doChecksumWithKey(byte[] data, int start, int len,
-                                       byte[] key, int usage) throws KrbException {
-
-        byte[] Ksign = key;
-
-        byte[] salt = Rc4.getSalt(usage, false);
-
-        hashProvider().hash(salt);
-        hashProvider().hash(data, start, len);
-        byte[] hashTmp = hashProvider().output();
-
-        byte[] hmac = Hmac.hmac(hashProvider(), Ksign, hashTmp);
-        return hmac;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4CheckSum.java
deleted file mode 100644
index 7062a54..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4CheckSum.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.AbstractUnkeyedCheckSumTypeHandler;
-import org.haox.kerb.crypto.cksum.provider.Md4Provider;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class RsaMd4CheckSum extends AbstractUnkeyedCheckSumTypeHandler {
-
-    public RsaMd4CheckSum() {
-        super(new Md4Provider(), 16, 16);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.RSA_MD4;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4DesCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4DesCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4DesCheckSum.java
deleted file mode 100644
index 95397f9..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd4DesCheckSum.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.Md4Provider;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class RsaMd4DesCheckSum extends ConfounderedDesCheckSum {
-
-    public RsaMd4DesCheckSum() {
-        super(new Md4Provider(), 24, 24);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.RSA_MD4_DES;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5CheckSum.java
deleted file mode 100644
index 2aa4db8..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5CheckSum.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.AbstractUnkeyedCheckSumTypeHandler;
-import org.haox.kerb.crypto.cksum.provider.Md5Provider;
-import org.haox.kerb.KrbException;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class RsaMd5CheckSum extends AbstractUnkeyedCheckSumTypeHandler {
-
-    public RsaMd5CheckSum() {
-        super(new Md5Provider(), 16, 16);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.RSA_MD5;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5DesCheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5DesCheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5DesCheckSum.java
deleted file mode 100644
index 7ba2ae3..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/RsaMd5DesCheckSum.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.Md5Provider;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public final class RsaMd5DesCheckSum extends ConfounderedDesCheckSum {
-
-    public RsaMd5DesCheckSum() {
-        super(new Md5Provider(), 24, 24);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.RSA_MD5_DES;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Sha1CheckSum.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Sha1CheckSum.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Sha1CheckSum.java
deleted file mode 100644
index a39fbae..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/Sha1CheckSum.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.haox.kerb.crypto.cksum;
-
-import org.haox.kerb.crypto.cksum.provider.AbstractUnkeyedCheckSumTypeHandler;
-import org.haox.kerb.crypto.cksum.provider.Sha1Provider;
-import org.haox.kerb.spec.common.CheckSumType;
-
-public class Sha1CheckSum extends AbstractUnkeyedCheckSumTypeHandler {
-
-    public Sha1CheckSum() {
-        super(new Sha1Provider(), 20, 20);
-    }
-
-    public CheckSumType cksumType() {
-        return CheckSumType.NIST_SHA;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractHashProvider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractHashProvider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractHashProvider.java
deleted file mode 100644
index 4607e43..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractHashProvider.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.crypto.cksum.HashProvider;
-import org.haox.kerb.KrbException;
-
-public abstract class AbstractHashProvider implements HashProvider {
-    private int blockSize;
-    private int hashSize;
-
-    public AbstractHashProvider(int hashSize, int blockSize) {
-        this.hashSize = hashSize;
-        this.blockSize = blockSize;
-    }
-
-    protected void init() {
-
-    }
-
-    @Override
-    public int hashSize() {
-        return hashSize;
-    }
-
-    @Override
-    public int blockSize() {
-        return blockSize;
-    }
-
-    @Override
-    public void hash(byte[] data) throws KrbException {
-        hash(data, 0, data.length);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractUnkeyedCheckSumTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractUnkeyedCheckSumTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractUnkeyedCheckSumTypeHandler.java
deleted file mode 100644
index 6df26cc..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/AbstractUnkeyedCheckSumTypeHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.crypto.cksum.AbstractCheckSumTypeHandler;
-import org.haox.kerb.crypto.cksum.HashProvider;
-import org.haox.kerb.KrbException;
-
-public abstract class AbstractUnkeyedCheckSumTypeHandler extends AbstractCheckSumTypeHandler {
-
-    public AbstractUnkeyedCheckSumTypeHandler(HashProvider hashProvider,
-                                              int computeSize, int outputSize) {
-        super(null, hashProvider, computeSize, outputSize);
-    }
-
-    @Override
-    public byte[] checksum(byte[] data, int start, int len) throws KrbException {
-        int outputSize = outputSize();
-
-        HashProvider hp = hashProvider();
-        hp.hash(data, start, len);
-        byte[] workBuffer = hp.output();
-
-        if (outputSize < workBuffer.length) {
-            byte[] output = new byte[outputSize];
-            System.arraycopy(workBuffer, 0, output, 0, outputSize);
-            return output;
-        }
-        return workBuffer;
-    }
-
-    @Override
-    public boolean verify(byte[] data, int start, int len, byte[] checksum) throws KrbException {
-        byte[] newCksum = checksum(data, start, len);
-        return checksumEqual(newCksum, checksum);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Crc32Provider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Crc32Provider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Crc32Provider.java
deleted file mode 100644
index cd5da8c..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Crc32Provider.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.crypto.Crc32;
-
-public class Crc32Provider extends AbstractHashProvider {
-    private byte[] output;
-
-    public Crc32Provider() {
-        super(4, 1);
-    }
-
-    @Override
-    public void hash(byte[] data, int start, int size) {
-        output = Crc32.crc(data, start, size);
-    }
-
-    @Override
-    public byte[] output() {
-        return output;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md4Provider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md4Provider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md4Provider.java
deleted file mode 100644
index 7fa16f9..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md4Provider.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.crypto.Md4;
-
-public class Md4Provider extends MessageDigestHashProvider {
-
-    public Md4Provider() {
-        super(16, 64, "MD4");
-    }
-
-    @Override
-    protected void init() {
-        messageDigest = new Md4();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md5Provider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md5Provider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md5Provider.java
deleted file mode 100644
index 4021184..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Md5Provider.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.KrbException;
-
-public class Md5Provider extends MessageDigestHashProvider {
-
-    public Md5Provider() {
-        super(16, 64, "MD5");
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/MessageDigestHashProvider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/MessageDigestHashProvider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/MessageDigestHashProvider.java
deleted file mode 100644
index 117e8ad..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/MessageDigestHashProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.KrbException;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class MessageDigestHashProvider extends AbstractHashProvider {
-    private String algorithm;
-    protected MessageDigest messageDigest;
-
-    public MessageDigestHashProvider(int hashSize, int blockSize, String algorithm) {
-        super(hashSize, blockSize);
-        this.algorithm = algorithm;
-
-        init();
-    }
-
-    @Override
-    protected void init() {
-        try {
-            messageDigest = MessageDigest.getInstance(algorithm);
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException("Failed to init JCE provider", e);
-        }
-    }
-
-    @Override
-    public void hash(byte[] data, int start, int len) throws KrbException {
-        messageDigest.update(data, start, len);
-    }
-
-    @Override
-    public byte[] output() {
-        return messageDigest.digest();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Sha1Provider.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Sha1Provider.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Sha1Provider.java
deleted file mode 100644
index 304ebe4..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/cksum/provider/Sha1Provider.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.haox.kerb.crypto.cksum.provider;
-
-import org.haox.kerb.KrbException;
-
-public class Sha1Provider extends MessageDigestHashProvider {
-
-    public Sha1Provider() {
-        super(20, 64, "SHA1");
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/AbstractEncTypeHandler.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/AbstractEncTypeHandler.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/AbstractEncTypeHandler.java
deleted file mode 100644
index 4d3372f..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/AbstractEncTypeHandler.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package org.haox.kerb.crypto.enc;
-
-import org.haox.kerb.crypto.AbstractCryptoTypeHandler;
-import org.haox.kerb.crypto.EncTypeHandler;
-import org.haox.kerb.crypto.cksum.HashProvider;
-import org.haox.kerb.crypto.key.KeyMaker;
-import org.haox.kerb.KrbException;
-
-public abstract class AbstractEncTypeHandler
-        extends AbstractCryptoTypeHandler implements EncTypeHandler {
-
-    private KeyMaker keyMaker;
-
-    public AbstractEncTypeHandler(EncryptProvider encProvider,
-                                  HashProvider hashProvider) {
-        super(encProvider, hashProvider);
-    }
-
-    protected void keyMaker(KeyMaker keyMaker) {
-        this.keyMaker = keyMaker;
-    }
-
-    protected KeyMaker keyMaker() {
-        return keyMaker;
-    }
-
-    @Override
-    public String name() {
-        return eType().getName();
-    }
-
-    @Override
-    public String displayName() {
-        return eType().getDisplayName();
-    }
-
-    protected int paddingLength(int inputLen) {
-        int payloadLen = confounderSize() + checksumSize() + inputLen;
-        int padding = paddingSize();
-
-        if (padding == 0 || (payloadLen % padding) == 0) {
-            return 0;
-        }
-
-        return padding - (payloadLen % padding);
-    }
-
-    @Override
-    public int keyInputSize() {
-        return encProvider().keyInputSize();
-    }
-
-    @Override
-    public int keySize() {
-        return encProvider().keySize();
-    }
-
-    @Override
-    public int confounderSize() {
-        return encProvider().blockSize();
-    }
-
-    @Override
-    public int checksumSize() {
-        return hashProvider().hashSize();
-    }
-
-    @Override
-    public int paddingSize() {
-        return encProvider().blockSize();
-    }
-
-    @Override
-    public byte[] str2key(String string, String salt, byte[] param) throws KrbException {
-        return keyMaker.str2key(string, salt, param);
-    }
-
-    @Override
-    public byte[] random2Key(byte[] randomBits) throws KrbException {
-        return keyMaker.random2Key(randomBits);
-    }
-
-    @Override
-    public byte[] encrypt(byte[] data, byte[] key, int usage) throws KrbException {
-        byte[] iv = new byte[encProvider().blockSize()];
-        return encrypt(data, key, iv, usage);
-    }
-
-    @Override
-    public byte[] encrypt(byte[] data, byte[] key, byte[] iv, int usage) throws KrbException {
-        int confounderLen = confounderSize();
-        int checksumLen = checksumSize();
-        int headerLen = confounderLen + checksumLen;
-        int inputLen = data.length;
-        int paddingLen = paddingLength(inputLen);
-
-        /**
-         *  E(Confounder | Checksum | Plaintext | Padding), or
-         *  header | data | padding | trailer, where trailer may be absent
-         */
-
-        int workLength = headerLen + inputLen + paddingLen;
-
-        byte[] workBuffer = new byte[workLength];
-        System.arraycopy(data, 0, workBuffer, headerLen, data.length);
-
-        int [] workLens = new int[] {confounderLen, checksumLen,
-                inputLen, paddingLen};
-
-        encryptWith(workBuffer, workLens, key, iv, usage);
-        return workBuffer;
-    }
-
-    protected void encryptWith(byte[] workBuffer, int[] workLens,
-                          byte[] key, byte[] iv, int usage) throws KrbException {
-
-    }
-
-    public byte[] decrypt(byte[] cipher, byte[] key, int usage)
-            throws KrbException {
-        byte[] iv = new byte[encProvider().blockSize()];
-        return decrypt(cipher, key, iv, usage);
-    }
-
-    public byte[] decrypt(byte[] cipher, byte[] key, byte[] iv, int usage)
-            throws KrbException {
-
-        int totalLen = cipher.length;
-        int confounderLen = confounderSize();
-        int checksumLen = checksumSize();
-        int dataLen = totalLen - (confounderLen + checksumLen);
-
-        int[] workLens = new int[] {confounderLen, checksumLen, dataLen};
-        return decryptWith(cipher, workLens, key, iv, usage);
-    }
-
-    protected byte[] decryptWith(byte[] workBuffer, int[] workLens,
-                               byte[] key, byte[] iv, int usage) throws KrbException {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
deleted file mode 100644
index 84876a0..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes128CtsHmacSha1Enc.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.haox.kerb.crypto.enc;
-
-import org.haox.kerb.crypto.cksum.provider.Sha1Provider;
-import org.haox.kerb.crypto.enc.provider.Aes128Provider;
-import org.haox.kerb.crypto.enc.provider.AesProvider;
-import org.haox.kerb.crypto.key.AesKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-import org.haox.kerb.spec.common.EncryptionType;
-
-public class Aes128CtsHmacSha1Enc extends KeKiHmacSha1Enc {
-
-    public Aes128CtsHmacSha1Enc() {
-        super(new Aes128Provider(), new Sha1Provider());
-        keyMaker(new AesKeyMaker((AesProvider) encProvider()));
-    }
-
-    @Override
-    public int checksumSize() {
-        return 96 / 8;
-    }
-
-    public EncryptionType eType() {
-        return EncryptionType.AES128_CTS_HMAC_SHA1_96;
-    }
-
-    public CheckSumType checksumType() {
-        return CheckSumType.HMAC_SHA1_96_AES128;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/967d7e1c/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
----------------------------------------------------------------------
diff --git a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java b/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
deleted file mode 100644
index 4d48dae..0000000
--- a/haox-kerb/kerb-crypto/src/main/java/org/haox/kerb/crypto/enc/Aes256CtsHmacSha1Enc.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.haox.kerb.crypto.enc;
-
-import org.haox.kerb.crypto.cksum.provider.Sha1Provider;
-import org.haox.kerb.crypto.enc.provider.Aes256Provider;
-import org.haox.kerb.crypto.enc.provider.AesProvider;
-import org.haox.kerb.crypto.key.AesKeyMaker;
-import org.haox.kerb.spec.common.CheckSumType;
-import org.haox.kerb.spec.common.EncryptionType;
-
-public class Aes256CtsHmacSha1Enc extends KeKiHmacSha1Enc {
-
-    public Aes256CtsHmacSha1Enc() {
-        super(new Aes256Provider(), new Sha1Provider());
-        keyMaker(new AesKeyMaker((AesProvider) encProvider()));
-    }
-
-    public EncryptionType eType() {
-        return EncryptionType.AES256_CTS_HMAC_SHA1_96;
-    }
-
-    public CheckSumType checksumType() {
-        return CheckSumType.HMAC_SHA1_96_AES256;
-    }
-
-    @Override
-    public int checksumSize() {
-        return 96 / 8;
-    }
-}


Mime
View raw message