test for Windows when switching RNGs (#21)
diff --git a/examples/rand.py b/examples/rand.py index 2a3c93d..a928834 100644 --- a/examples/rand.py +++ b/examples/rand.py
@@ -1,5 +1,6 @@ # various RNGs Python example +import platform # to learn the OS we're on import oqs.rand as oqsrand # must be explicitly imported ####################################################################### @@ -16,8 +17,10 @@ oqsrand.randombytes_switch_algorithm('NIST-KAT') print('{:17s}'.format("NIST-KAT:"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32))) -oqsrand.randombytes_switch_algorithm("OpenSSL") -print('{:17s}'.format("OpenSSL:"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32))) +# we do not yet support OpenSSL under Windows +if platform.system() != 'Windows': + oqsrand.randombytes_switch_algorithm("OpenSSL") + print('{:17s}'.format("OpenSSL:"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32))) oqsrand.randombytes_switch_algorithm("system") print('{:17s}'.format("System (default):"), ' '.join('{:02X}'.format(x) for x in oqsrand.randombytes(32)))