def crypto_aead_chacha20poly1305_encrypt(message, ad, nonce, key):
    mlen = ctypes.c_ulonglong(len(message))
adlen = ctypes.c_ulonglong(len(ad))
c = ctypes.create_string_buffer(mlen.value + 16)
clen = ctypes.c_ulonglong(0)
Python Ctypes с RaspberryPi