public ARIAWrapPadEngine() { super(new ARIAEngine()); } }
protected static void SL2(byte[] z) { z[0] = SB3(z[0]); z[1] = SB4(z[1]); z[2] = SB1(z[2]); z[3] = SB2(z[3]); z[4] = SB3(z[4]); z[5] = SB4(z[5]); z[6] = SB1(z[6]); z[7] = SB2(z[7]); z[8] = SB3(z[8]); z[9] = SB4(z[9]); z[10] = SB1(z[10]); z[11] = SB2(z[11]); z[12] = SB3(z[12]); z[13] = SB4(z[13]); z[14] = SB1(z[14]); z[15] = SB2(z[15]); }
FO(W1, CK1); xor(W1, KR); FE(W2, CK2); xor(W2, W0); FO(W3, CK3); xor(W3, W1); keyScheduleRound(rks[0], W0, W1, 19); keyScheduleRound(rks[1], W1, W2, 19); keyScheduleRound(rks[2], W2, W3, 19); keyScheduleRound(rks[3], W3, W0, 19); keyScheduleRound(rks[4], W0, W1, 31); keyScheduleRound(rks[5], W1, W2, 31); keyScheduleRound(rks[6], W2, W3, 31); keyScheduleRound(rks[7], W3, W0, 31); keyScheduleRound(rks[8], W0, W1, 67); keyScheduleRound(rks[9], W1, W2, 67); keyScheduleRound(rks[10], W2, W3, 67); keyScheduleRound(rks[11], W3, W0, 67); keyScheduleRound(rks[12], W0, W1, 97); if (numRounds > 12) keyScheduleRound(rks[13], W1, W2, 97); keyScheduleRound(rks[14], W2, W3, 97);
public int processBlock(byte[] in, int inOff, byte[] out, int outOff) throws DataLengthException, IllegalStateException { if (roundKeys == null) { throw new IllegalStateException("ARIA engine not initialised"); } if (inOff > (in.length - BLOCK_SIZE)) { throw new DataLengthException("input buffer too short"); } if (outOff > (out.length - BLOCK_SIZE)) { throw new OutputLengthException("output buffer too short"); } byte[] z = new byte[BLOCK_SIZE]; System.arraycopy(in, inOff, z, 0, BLOCK_SIZE); int i = 0, rounds = roundKeys.length - 3; while (i < rounds) { FO(z, roundKeys[i++]); FE(z, roundKeys[i++]); } FO(z, roundKeys[i++]); xor(z, roundKeys[i++]); SL2(z); xor(z, roundKeys[i]); System.arraycopy(z, 0, out, outOff, BLOCK_SIZE); return BLOCK_SIZE; }
/** * Create a regular AESWrapEngine specifying the encrypt for wrapping, decrypt for unwrapping. */ public ARIAWrapEngine() { super(new ARIAEngine()); }
protected static void SL1(byte[] z) { z[0] = SB1(z[0]); z[1] = SB2(z[1]); z[2] = SB3(z[2]); z[3] = SB4(z[3]); z[4] = SB1(z[4]); z[5] = SB2(z[5]); z[6] = SB3(z[6]); z[7] = SB4(z[7]); z[8] = SB1(z[8]); z[9] = SB2(z[9]); z[10] = SB3(z[10]); z[11] = SB4(z[11]); z[12] = SB1(z[12]); z[13] = SB2(z[13]); z[14] = SB3(z[14]); z[15] = SB4(z[15]); }
/** * Create an AESWrapEngine where the underlying cipher is set to decrypt for wrapping, encrypt for unwrapping. * * @param useReverseDirection true if underlying cipher should be used in decryption mode, false otherwise. */ public ARIAWrapEngine(boolean useReverseDirection) { super(new ARIAEngine(), useReverseDirection); } }
public BlockCipher get() { return new ARIAEngine(); } });
protected BlockCipher createARIAEngine() { return new ARIAEngine(); }
public RFC3211Wrap() { super(new RFC3211WrapEngine(new ARIAEngine()), 16); } }
public Poly1305() { super(new org.spongycastle.crypto.macs.Poly1305(new ARIAEngine())); } }
public CBC() { super(new CBCBlockCipher(new ARIAEngine()), 128); } }
public GMAC() { super(new GMac(new GCMBlockCipher(new ARIAEngine()))); } }
public OFB() { super(new BufferedBlockCipher(new OFBBlockCipher(new ARIAEngine(), 128)), 128); } }
public CFB() { super(new BufferedBlockCipher(new CFBBlockCipher(new ARIAEngine(), 128)), 128); } }