Implementation of encrypt block.