private void keySchedule ( final int s ) { for ( int i = 0 ; i < nw ; i ++ ) { // just put in the main key first ksd [ i ] = k [ ( s + i ) % ( nw + 1 ) ] ; // don't add anything for i = 0,...,Nw - 4 if ( i == nw - 3 ) { // second to last ksd [ i ] += t [ s % TWEAK_VALUES ] ; } else if ( i == nw - 2 ) { // first to last ksd [ i ] += t [ ( s + 1 ) % TWEAK_VALUES ] ; } else if ( i == nw - 1 ) { // last ksd [ i ] += s ; } } }
Creates the subkeys .