private void authenticatePacketHMCSHA1 ( RawPacket pkt , int rocIn ) { ByteBuffer buf = pkt . getBuffer ( ) ; buf . rewind ( ) ; int len = buf . remaining ( ) ; buf . get ( tempBuffer , 0 , len ) ; mac . update ( tempBuffer , 0 , len ) ; rbStore [ 0 ] = ( byte ) ( rocIn >> 24 ) ; rbStore [ 1 ] = ( byte ) ( rocIn >> 16 ) ; rbStore [ 2 ] = ( byte ) ( rocIn >> 8 ) ; rbStore [ 3 ] = ( byte ) rocIn ; mac . update ( rbStore , 0 , rbStore . length ) ; mac . doFinal ( tagStore , 0 ) ; }
Authenticate a packet . Calculated authentication tag is returned .