// Path: src/main/java/com/github/aelstad/keccakj/core/KeccakStateUtils.java
// public enum StateOp {
// 	ZERO, GET, VALIDATE, XOR_IN, XOR_TRANSFORM, WRAP, UNWRAP;
// 
// 	public boolean isIn() {
// 		return (this ==StateOp.XOR_IN || this == XOR_TRANSFORM || this ==StateOp.WRAP || this == StateOp.UNWRAP || this == VALIDATE);
// 	}
// 
// 	public boolean isOut() {
// 		return (this == StateOp.GET || this == XOR_TRANSFORM || this==StateOp.WRAP || this == StateOp.UNWRAP);
// 	}
// 
// };


import java.util.Arrays;
import com.github.aelstad.keccakj.core.KeccakStateUtils.StateOp;
/*
 * Copyright 2014 Amund Elstad.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.aelstad.keccakj.core;



/**
 * Java port of the reference implementation of Keccack-1600 permuation
 * from https://github.com/gvanas/KeccakCodePackage
 *
 */
public final class Keccak1600 {

	public Keccak1600()
	{
		this(256, 24);
	}

	public Keccak1600(int capacitityInBits) {
		this(capacitityInBits, NR_ROUNDS);
	}

	public Keccak1600(int capacityInBits, int rounds) {
		this.capacitityBits = capacityInBits;
		this.rateBits = 1600-capacityInBits;
		this.rateBytes = rateBits >> 3;
		this.firstRound = NR_ROUNDS - rounds;

		clear();
	}

// Path: src/main/java/com/github/aelstad/keccakj/core/KeccakStateUtils.java
// public enum StateOp {
// 	ZERO, GET, VALIDATE, XOR_IN, XOR_TRANSFORM, WRAP, UNWRAP;
// 
// 	public boolean isIn() {
// 		return (this ==StateOp.XOR_IN || this == XOR_TRANSFORM || this ==StateOp.WRAP || this == StateOp.UNWRAP || this == VALIDATE);
// 	}
// 
// 	public boolean isOut() {
// 		return (this == StateOp.GET || this == XOR_TRANSFORM || this==StateOp.WRAP || this == StateOp.UNWRAP);
// 	}
// 
// };


// Path: src/main/java/com/github/aelstad/keccakj/core/Keccak1600.java
import java.util.Arrays;
import com.github.aelstad.keccakj.core.KeccakStateUtils.StateOp;

/*
 * Copyright 2014 Amund Elstad.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.aelstad.keccakj.core;



/**
 * Java port of the reference implementation of Keccack-1600 permuation
 * from https://github.com/gvanas/KeccakCodePackage
 *
 */
public final class Keccak1600 {

	public Keccak1600()
	{
		this(256, 24);
	}

	public Keccak1600(int capacitityInBits) {
		this(capacitityInBits, NR_ROUNDS);
	}

	public Keccak1600(int capacityInBits, int rounds) {
		this.capacitityBits = capacityInBits;
		this.rateBits = 1600-capacityInBits;
		this.rateBytes = rateBits >> 3;
		this.firstRound = NR_ROUNDS - rounds;

		clear();
	}

	byte byteOp(StateOp stateOp, int stateByteOff, byte in)