|
InitialValue |
|
/* * To Do: * */ /** * * InitialValue - Tim Tyler 2001. * static utitlity classes for making IVs * * This code has been placed in the public domain. * You can do what you like with it. * Note that this code comes with no warranty. * */ public class InitialValue { // static Random rnd = new Random(); static Block generateIV(boolean iv) { // Log.log("Making an IV"); int block_size = 16; Block initial_value = new Block(block_size); if (iv) { for (int i =0; i < block_size; i++) { // Random IV... initial_value.data[i] = BIAES.getRandomByte(); } } else { initial_value.fillWith((byte)0x00); } return initial_value; } static Block returnIV(byte[] file_data) { int block_size = 16; Block initial_value = new Block(block_size); System.arraycopy(file_data, 0, initial_value.data, 0, block_size); // copy a block across... return initial_value; } public static void main(String args[]) { BIAESFrEnd.main(args); } }
|
InitialValue |
|