Example usage for org.bouncycastle.util Pack longToLittleEndian

List of usage examples for org.bouncycastle.util Pack longToLittleEndian

Introduction

In this page you can find the example usage for org.bouncycastle.util Pack longToLittleEndian.

Prototype

public static byte[] longToLittleEndian(long[] ns) 

Source Link

Usage

From source file:ch.lamacrypt.internal.crypto.CPCipher.java

License:Open Source License

/**
 * Updates the state of Poly1305/*ww  w.  j a va2s  .c  o  m*/
 *
 * @param buf array containing the input
 * @param off the index in the array the data begins at
 * @param len length of the input starting at off
 */
private void updateMAC(byte[] buf, int off, int len) {
    mac.update(buf, off, len);

    byte[] longLen = Pack.longToLittleEndian(len & 0xFFFFFFFFL);
    mac.update(longLen, 0, longLen.length);
}

From source file:com.github.horrorho.inflatabledonkey.crypto.xts.XTSTweak.java

License:Open Source License

static byte[] defaultTweakFunction(long tweakValue) {
    byte[] bs = Pack.longToLittleEndian(tweakValue);
    bs = Arrays.copyOfRange(bs, 0, BLOCK_SIZE);
    return bs;/*from w ww  .ja  va2 s  . c o m*/
}

From source file:com.github.horrorho.inflatabledonkey.dataprotection.DPAESXTSCipher.java

License:Open Source License

static byte[] tweakFunction(long tweakValue) {
    byte[] bs = Pack.longToLittleEndian(tweakValue);
    return Arrays.concatenate(bs, bs);
}