 const int HASH_LEN = 20; // 160-bit hash
 uint8_t correct_hash[HASH_LEN];
 uint8_t incoming_hash[HASH_LEN];
+
+// For data collection - quantity of messages received
+long long int numReceived = 0;
 
 void setup()
 {

        CAN.readMsgBufID(&id, &dlc, data);    // read data,  len: data length, buf: data buf        
        Serial.println("\n------------------------------\n");

        // Display the message
        PrintMessage(); 

        // Authenticate the message
        if (Authenticate())
        {
          Serial.println("\tAuth Good");
          TakeAction();     // only respond to authorized messages
        }
        else
          Serial.println("\tFAILED AUTH");
    }
}


    uint8_t key[100] = {0}; // buffer for the key
    uint8_t keyLen;
    GetKey(id, &key[0], keyLen);

    Serial.print("Expected Key: ");
    for(int i = 0; i < keyLen; i++)
    {
        Serial.print(key[i]);
        Serial.print(" ");
    }
    Serial.println();

