public MD4 () { super("MD4"); engineReset(); }
public MD4 () { super("MD4"); engineReset(); }
public MD4 () { super("MD4"); engineReset(); }
public MD4 () { super("MD4"); engineReset(); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }