public object Clone() { ArbiterPUF aPUFCopy = new ArbiterPUF(Weight); //Automatically clones the weights in the constructor //Other variables must be set manually aPUFCopy.BitNumber = BitNumber; aPUFCopy.WeightMean = WeightMean; aPUFCopy.WeightVariance = WeightVariance; aPUFCopy.NoiseMean = NoiseMean; aPUFCopy.NoiseVariance = NoiseVariance; aPUFCopy.MajorityVoteCount = MajorityVoteCount; return(aPUFCopy); }
//Default constructor public XORArbiterPUF(int numPUFIN, int bitNum, double aPUFMean, double aPUFVar) { //set the input variables BitNumber = bitNum; NumPUF = numPUFIN; MeanForAPUF = aPUFMean; VarianceForAPUF = aPUFVar; ArbiterPUFArray = new ArbiterPUF[NumPUF]; //Initialize the arbiter PUF array for (int i = 0; i < NumPUF; i++) { ArbiterPUFArray[i] = new ArbiterPUF(bitNumber, MeanForAPUF, VarianceForAPUF); } }
//Copy constructor public XORArbiterPUF(int numPUFIN, int bitNum, double[][] weightsIN, double aPUFMean, double aPUFVar, double noiseMeanAPUFIN, double noiseVarianceAPUFIN) { //set the input variables BitNumber = bitNum; NumPUF = numPUFIN; MeanForAPUF = aPUFMean; VarianceForAPUF = aPUFVar; NoiseMeanForAPUF = noiseMeanAPUFIN; NoiseVarianceForAPUF = noiseVarianceAPUFIN; ArbiterPUFArray = new ArbiterPUF[NumPUF]; //Initialize the arbiter PUF array for (int i = 0; i < NumPUF; i++) { ArbiterPUFArray[i] = new ArbiterPUF(weightsIN[i], NoiseMeanForAPUF, NoiseVarianceForAPUF); } }
//Constructor that only takes a 1D double public XORArbiterPUF(int bitNum, double[] allAPUFWeights) { //set the input variables BitNumber = bitNum; NumPUF = (int)Math.Floor((double)allAPUFWeights.Length / ((double)bitNumber + 1)); //find the number of APUFs ArbiterPUFArray = new ArbiterPUF[NumPUF]; //Fill in the APUF array for (int i = 0; i < NumPUF; i++) { //Extract the weights from the double array double[] currentAPUFWeights = new double[BitNumber + 1]; int indexer = i * (bitNumber + 1); for (int j = 0; j < currentAPUFWeights.Length; j++) { currentAPUFWeights[j] = allAPUFWeights[indexer]; indexer++; } ArbiterPUFArray[i] = new ArbiterPUF(currentAPUFWeights); } }
public IPUF(int xNumPUFIN, int yNumPUFIN, int bitNum, double aPUFMean, double aPUFVar) { //set the input variables BitNumber = bitNum; NumPUFX = xNumPUFIN; NumPUFY = yNumPUFIN; MeanForAPUF = aPUFMean; VarianceForAPUF = aPUFVar; ArbiterPUFArrayX = new ArbiterPUF[xNumPUFIN]; ArbiterPUFArrayY = new ArbiterPUF[yNumPUFIN]; //Initialize the X arbiter PUF array for (int i = 0; i < NumPUFX; i++) { ArbiterPUFArrayX[i] = new ArbiterPUF(bitNumber, MeanForAPUF, VarianceForAPUF); } //Initialize the Y arbiter PUF array for (int i = 0; i < NumPUFY; i++) { ArbiterPUFArrayY[i] = new ArbiterPUF(bitNumber + 1, MeanForAPUF, VarianceForAPUF); //note this has one more bit than the X PUFs } }