Skip to content

Commit 4564459

Browse files
Prepare python interface for use of device_id callbacks.
1 parent 01fcd2a commit 4564459

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/random.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class Random(object):
3131
A Cryptographically Secure Pseudo Random Number Generator - CSPRNG
3232
"""
3333

34-
def __init__(self, nonce=_ffi.NULL):
34+
def __init__(self, nonce=_ffi.NULL, device_id=_lib.INVALID_DEVID):
3535
self.native_object = _ffi.new("WC_RNG *")
3636

3737
if nonce == _ffi.NULL:
3838
nonce_size = 0
3939
else:
4040
nonce_size = len(nonce)
41-
ret = _lib.wc_InitRngNonce(self.native_object, nonce, nonce_size)
41+
ret = _lib.wc_InitRngNonce_ex(self.native_object, nonce, nonce_size, _ffi.NULL, device_id)
4242
if ret < 0: # pragma: no cover
4343
self.native_object = None
4444
raise WolfCryptError("RNG init error (%d)" % ret)

0 commit comments

Comments
 (0)