convert pynacl test to direct nacl driver in C