//Generates the response training data public static void GenerateTrainingData(PhysicallyUncloneableFunction aPUF, double[][] trainingData, double[][] trainingResponse, Random randomGenerator) { int trainingSize = trainingData.Length; int bitNum = aPUF.BitNumber; for (int i = 0; i < trainingSize; i++) { trainingData[i] = GenerateRandomPhiVector(bitNum, randomGenerator); trainingResponse[i] = new double[1]; trainingResponse[i][0] = aPUF.ComputeResponse(trainingData[i]); } }
//Generates the reliability training data as done in Becker's paper, does m/2 - sum(r) calculation public static void GenerateReliabilityTrainingData(PhysicallyUncloneableFunction aPUF, int numberOfMeasurements, double[][] trainingData, double[][] trainingReliability, Random randomGenerator) { int trainingSize = trainingData.Length; int bitNum = aPUF.BitNumber; for (int i = 0; i < trainingSize; i++) { double sumOfResponses = 0; //trainingData[i] = GenerateRandomPhiVector(bitNum); trainingData[i] = GenerateRandomPhiVector(bitNum, randomGenerator); for (int m = 0; m < numberOfMeasurements; m++) { sumOfResponses = sumOfResponses + aPUF.ComputeNoisyResponse(trainingData[i]); //sum the measurements } trainingReliability[i] = new double[1]; //trainingReliability[i][0] = sumOfResponses / (double)numberOfMeasurements; //trainingReliability[i][0] = Math.Abs(numberOfMeasurements / 2.0 - (sumOfResponses / (double)numberOfMeasurements)); trainingReliability[i][0] = Math.Abs(numberOfMeasurements / 2.0 - sumOfResponses); } }