public void init() throws Exception { int tmp=Util.getNextHigherPowerOfTwo(cipher_pool_size); if(tmp != cipher_pool_size) { log.warn("%s: setting cipher_pool_size (%d) to %d (power of 2) for faster modulo operation", local_addr, cipher_pool_size, tmp); cipher_pool_size=tmp; } key_map=new BoundedHashMap<>(key_map_max_size); initSymCiphers(sym_algorithm, secret_key); }
public void init() throws Exception { int tmp=Util.getNextHigherPowerOfTwo(cipher_pool_size); if(tmp != cipher_pool_size) { log.warn("%s: setting cipher_pool_size (%d) to %d (power of 2) for faster modulo operation", local_addr, cipher_pool_size, tmp); cipher_pool_size=tmp; } key_map=new BoundedHashMap<>(key_map_max_size); encoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); decoding_ciphers=new ArrayBlockingQueue<>(cipher_pool_size); initSymCiphers(sym_algorithm, secret_key); }