
#include "Bunny.h"

//! Bunny24m24k CLASS
/*!
This class allows to instantiate a block cipher working on 24 bits, with a master key of 24 bits, whose s-boxes take input of nb_sbox bits, and with nround rounds.
*/
template <unsigned nb_sbox, unsigned nround>
class Bunny24m24k : public Bunny<24,24,nb_sbox,nround> {
public:

  typedef Bunny<24,24,nb_sbox,nround> BUNNY ;

  typedef typename BUNNY::msgType      msgType ;
  typedef typename BUNNY::keyType      keyType ;
  typedef typename BUNNY::sboxType     sboxType ;
  typedef typename BUNNY::wordType     wordType ;
  typedef typename BUNNY::roundkeyType roundkeyType ;

  //! Contains the round keys
  roundkeyType rk;

  // CONSTRUCTORS
  Bunny24m24k() ;

  // CODING FUNCTIONS
  virtual msgType encode(msgType m, keyType k) ;
  virtual msgType decode(msgType m, keyType k) ;

//private:

  // SBOX
  virtual sboxType sbox( unsigned nbox, sboxType x ) ;
  virtual sboxType sboxInverse( unsigned nbox, sboxType x ) ;

  // MIXING LAYER
  virtual msgType mixingLayer (msgType m ) ;
  virtual msgType mixingLayerInverse (msgType m ) ;

  // ADD ROUND KEY
  virtual msgType addRoundKey (msgType m, msgType k) ;

  // KEY SCHEDULE
  virtual void keySchedule(keyType k) ;

} ;


#include "Bunny24m24k.hxx"
