當前位置: 首頁>>代碼示例>>Java>>正文


Java SM4Engine類代碼示例

本文整理匯總了Java中org.bouncycastle.crypto.engines.SM4Engine的典型用法代碼示例。如果您正苦於以下問題:Java SM4Engine類的具體用法?Java SM4Engine怎麽用?Java SM4Engine使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SM4Engine類屬於org.bouncycastle.crypto.engines包,在下文中一共展示了SM4Engine類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initBlockCipherEngines

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
private static void initBlockCipherEngines() {
	blockCipherEngines.put("MARS", MarsEngine.class);
	blockCipherEngines.put("AES", AESEngine.class);
	blockCipherEngines.put("Blowfish", BlowfishEngine.class);
	blockCipherEngines.put("Camellia", CamelliaEngine.class);
	blockCipherEngines.put("CAST5", CAST5Engine.class);
	blockCipherEngines.put("CAST6", CAST6Engine.class);
	blockCipherEngines.put("DESede", DESedeEngine.class);
	blockCipherEngines.put("DES", DESEngine.class);
	blockCipherEngines.put("GOST28147", GOST28147Engine.class);
	blockCipherEngines.put("IDEA", IDEAEngine.class);
	blockCipherEngines.put("Noekeon", NoekeonEngine.class);
	blockCipherEngines.put("RC2", RC2Engine.class);
	blockCipherEngines.put("RC5", RC532Engine.class);
	blockCipherEngines.put("RC6", RC6Engine.class);
	blockCipherEngines.put("SEED", SEEDEngine.class);
	blockCipherEngines.put("Serpent", SerpentEngine.class);
	blockCipherEngines.put("Shacal2", Shacal2Engine.class);
	blockCipherEngines.put("Skipjack", SkipjackEngine.class);
	blockCipherEngines.put("SM4", SM4Engine.class);
	blockCipherEngines.put("TEA", TEAEngine.class);
	blockCipherEngines.put("Twofish", TwofishEngine.class);
	blockCipherEngines.put("XTEA", XTEAEngine.class);
	blockCipherEngines.put("Threefish", ThreefishEngine.class);
}
 
開發者ID:shilongdai,項目名稱:vsDiaryWriter,代碼行數:26,代碼來源:BlockCiphers.java

示例2: test1000000

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
private void test1000000()
{
    byte[] plain = Hex.decode("0123456789abcdeffedcba9876543210");
    byte[] key = Hex.decode("0123456789abcdeffedcba9876543210");
    byte[] cipher = Hex.decode("595298c7c6fd271f0402f804c33d3f66");
    byte[] buf = new byte[16];

    BlockCipher engine = new SM4Engine();

    engine.init(true, new KeyParameter(key));

    System.arraycopy(plain, 0, buf, 0, buf.length);

    for (int i = 0; i != 1000000; i++)
    {
        engine.processBlock(buf, 0, buf, 0);
    }

    if (!areEqual(cipher, buf))
    {
        fail("1000000 encryption test failed");
    }

    engine.init(false, new KeyParameter(key));

    for (int i = 0; i != 1000000; i++)
    {
        engine.processBlock(buf, 0, buf, 0);
    }

    if (!areEqual(plain, buf))
    {
        fail("1000000 decryption test failed");
    }
}
 
開發者ID:ttt43ttt,項目名稱:gwt-crypto,代碼行數:36,代碼來源:SM4Test.java

示例3: ECB

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
public ECB()
{
    super(new BlockCipherProvider()
    {
        public BlockCipher get()
        {
            return new SM4Engine();
        }
    });
}
 
開發者ID:thedrummeraki,項目名稱:Aki-SSL,代碼行數:11,代碼來源:SM4.java

示例4: SM4Test

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
SM4Test()
{
    super(tests, new SM4Engine(), new KeyParameter(new byte[16]));
}
 
開發者ID:ttt43ttt,項目名稱:gwt-crypto,代碼行數:5,代碼來源:SM4Test.java

示例5: CMAC

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
public CMAC()
{
    super(new CMac(new SM4Engine()));
}
 
開發者ID:thedrummeraki,項目名稱:Aki-SSL,代碼行數:5,代碼來源:SM4.java

示例6: GMAC

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
public GMAC()
{
    super(new GMac(new GCMBlockCipher(new SM4Engine())));
}
 
開發者ID:thedrummeraki,項目名稱:Aki-SSL,代碼行數:5,代碼來源:SM4.java

示例7: Poly1305

import org.bouncycastle.crypto.engines.SM4Engine; //導入依賴的package包/類
public Poly1305()
{
    super(new org.bouncycastle.crypto.macs.Poly1305(new SM4Engine()));
}
 
開發者ID:thedrummeraki,項目名稱:Aki-SSL,代碼行數:5,代碼來源:SM4.java


注:本文中的org.bouncycastle.crypto.engines.SM4Engine類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。