Home
last modified time | relevance | path

Searched refs:probabilityOfSetBit (Results 1 – 1 of 1) sorted by relevance

/cts/tests/tests/keystore/src/android/keystore/cts/
DKeyAttestationTest.java1000 … double probabilityOfSetBit = countSetBits(verifiedBootKey) / (double)(verifiedBootKey.length * 8); in checkShannonEntropy() local
1001 return calculateShannonEntropy(probabilityOfSetBit) > 0.8; in checkShannonEntropy()
1004 private double calculateShannonEntropy(double probabilityOfSetBit) { in calculateShannonEntropy() argument
1005 if (probabilityOfSetBit <= 0.001 || probabilityOfSetBit >= .999) return 0; in calculateShannonEntropy()
1006 double entropy = (-probabilityOfSetBit * logTwo(probabilityOfSetBit)) - in calculateShannonEntropy()
1007 ((1 - probabilityOfSetBit) * logTwo(1 - probabilityOfSetBit)); in calculateShannonEntropy()
1015 double probabilityOfSetBit = 0; in checkTresBiEntropy() local
1018 probabilityOfSetBit = countSetBits(verifiedBootKey) / (double)length; in checkTresBiEntropy()
1020 weightedEntropy += calculateShannonEntropy(probabilityOfSetBit) * logTwo(i+2); in checkTresBiEntropy()