public BlockCipher get() { return new RC6Engine(); } });
int A = bytesToWord(in, inOff); int B = bytesToWord(in, inOff + bytesPerWord); int C = bytesToWord(in, inOff + bytesPerWord*2); int D = bytesToWord(in, inOff + bytesPerWord*3); t = rotateLeft(t, LGW); u = rotateLeft(u, LGW); C = rotateRight(C,t); C ^= u; A = rotateRight(A,u); A ^= t; B -= _S[0]; wordToBytes(A, out, outOff); wordToBytes(B, out, outOff + bytesPerWord); wordToBytes(C, out, outOff + bytesPerWord*2); wordToBytes(D, out, outOff + bytesPerWord*3);
int A = bytesToWord(in, inOff); int B = bytesToWord(in, inOff + bytesPerWord); int C = bytesToWord(in, inOff + bytesPerWord*2); int D = bytesToWord(in, inOff + bytesPerWord*3); t = rotateLeft(t,5); u = rotateLeft(u,5); A = rotateLeft(A,u); A += _S[2*i]; C = rotateLeft(C,t); C += _S[2*i+1]; wordToBytes(A, out, outOff); wordToBytes(B, out, outOff + bytesPerWord); wordToBytes(C, out, outOff + bytesPerWord*2); wordToBytes(D, out, outOff + bytesPerWord*3);
public int processBlock( byte[] in, int inOff, byte[] out, int outOff) { int blockSize = getBlockSize(); if (_S == null) { throw new IllegalStateException("RC6 engine not initialised"); } if ((inOff + blockSize) > in.length) { throw new DataLengthException("input buffer too short"); } if ((outOff + blockSize) > out.length) { throw new OutputLengthException("output buffer too short"); } return (forEncryption) ? encryptBlock(in, inOff, out, outOff) : decryptBlock(in, inOff, out, outOff); }
/** * initialise a RC5-32 cipher. * * @param forEncryption whether or not we are for encryption. * @param params the parameters required to set up the cipher. * @exception IllegalArgumentException if the params argument is * inappropriate. */ public void init( boolean forEncryption, CipherParameters params) { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("invalid parameter passed to RC6 init - " + params.getClass().getName()); } KeyParameter p = (KeyParameter)params; this.forEncryption = forEncryption; setKey(p.getKey()); }
A = _S[i] = rotateLeft(_S[i] + A + B, 3); B = L[j] = rotateLeft(L[j] + A + B, A+B); i = (i+1) % _S.length; j = (j+1) % L.length;
public int processBlock( byte[] in, int inOff, byte[] out, int outOff) { int blockSize = getBlockSize(); if (_S == null) { throw new IllegalStateException("RC6 engine not initialised"); } if ((inOff + blockSize) > in.length) { throw new DataLengthException("input buffer too short"); } if ((outOff + blockSize) > out.length) { throw new OutputLengthException("output buffer too short"); } return (forEncryption) ? encryptBlock(in, inOff, out, outOff) : decryptBlock(in, inOff, out, outOff); }
int A = bytesToWord(in, inOff); int B = bytesToWord(in, inOff + bytesPerWord); int C = bytesToWord(in, inOff + bytesPerWord*2); int D = bytesToWord(in, inOff + bytesPerWord*3); t = rotateLeft(t,5); u = rotateLeft(u,5); A = rotateLeft(A,u); A += _S[2*i]; C = rotateLeft(C,t); C += _S[2*i+1]; wordToBytes(A, out, outOff); wordToBytes(B, out, outOff + bytesPerWord); wordToBytes(C, out, outOff + bytesPerWord*2); wordToBytes(D, out, outOff + bytesPerWord*3);
/** * initialise a RC5-32 cipher. * * @param forEncryption whether or not we are for encryption. * @param params the parameters required to set up the cipher. * @exception IllegalArgumentException if the params argument is * inappropriate. */ public void init( boolean forEncryption, CipherParameters params) { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("invalid parameter passed to RC6 init - " + params.getClass().getName()); } KeyParameter p = (KeyParameter)params; this.forEncryption = forEncryption; setKey(p.getKey()); }
A = _S[i] = rotateLeft(_S[i] + A + B, 3); B = L[j] = rotateLeft(L[j] + A + B, A+B); i = (i+1) % _S.length; j = (j+1) % L.length;
int A = bytesToWord(in, inOff); int B = bytesToWord(in, inOff + bytesPerWord); int C = bytesToWord(in, inOff + bytesPerWord*2); int D = bytesToWord(in, inOff + bytesPerWord*3); t = rotateLeft(t, LGW); u = rotateLeft(u, LGW); C = rotateRight(C,t); C ^= u; A = rotateRight(A,u); A ^= t; B -= _S[0]; wordToBytes(A, out, outOff); wordToBytes(B, out, outOff + bytesPerWord); wordToBytes(C, out, outOff + bytesPerWord*2); wordToBytes(D, out, outOff + bytesPerWord*3);
public Poly1305() { super(new org.bouncycastle.crypto.macs.Poly1305(new RC6Engine())); } }
public CBC() { super(new CBCBlockCipher(new RC6Engine()), 128); } }
public GMAC() { super(new GMac(new GCMBlockCipher(new RC6Engine()))); } }
public OFB() { super(new BufferedBlockCipher(new OFBBlockCipher(new RC6Engine(), 128)), 128); } }
public CFB() { super(new BufferedBlockCipher(new CFBBlockCipher(new RC6Engine(), 128)), 128); } }
cipher = new RC564Engine(); } else if ("RC6".equalsIgnoreCase(algorithm)) { cipher = new RC6Engine(); } else if ("SEED".equalsIgnoreCase(algorithm)) { cipher = new SEEDEngine();