Abstract. Many applications rely on the security of their random number generator. It is therefore essential that such devices be extensively tested for malfunction. The purpose of a statistical test is to detect specific weaknesses in random sources. Maurer’s universal test is a very common randomness test, capable of detecting a wide range of statistical defects. The test is based on the computation of a function which is asymptotically related to the source’s entropy, which measures the effective key-size of block ciphers keyed by the source’s output. In this work we develop a variant of Maurer’s test where the test function is in theory exactly equal to the source’s entropy, thereby enabling a better detection of defects in the tested source.