freenode/#lisp - IRC Chatlog
Search
22:21:44
Josh_2
I pass it the base64 encoded string converted to a pointer that I receive from a different function
22:25:54
Josh_2
https://gitlab.matrix.org/matrix-org/olm/-/blob/master/python/tests/account_test.py#L74 this is the test I'm trying to copy, it uses the methods sign https://gitlab.matrix.org/matrix-org/olm/-/blob/master/python/olm/account.py#L185 and ed25519_verify https://gitlab.matrix.org/matrix-org/olm/-/blob/master/python/olm/utility.py#L83
22:26:56
Josh_2
https://github.com/K1D77A/cl-megolm/blob/master/src/account.lisp#L87 that is my lisp version of sign, and this is my lisp version of ed25519 verify https://github.com/K1D77A/cl-megolm/blob/master/src/utility.lisp#L33
22:30:34
Josh_2
You can call (%olm:utility-last-error <utility pointer>) and it will return a string telling you some information about the error
22:39:16
Josh_2
Thats why I showed you the python version of the functions because I assume they are correctly using the C library
22:43:11
Bike
but you're not interfacing with that api at all. you're using this one: https://gitlab.matrix.org/matrix-org/olm/-/blob/master/include/olm/olm.h and that's the one you need to understand
22:47:41
Josh_2
https://gitlab.matrix.org/matrix-org/olm/-/blob/master/include/olm/utility.hh here is the verify function
2:33:15
Josh_2
Some functions which expect base64 strings as input work just fine and then these two (so far) keep failing :(
2:37:59
Josh_2
hmm seems the pickle functions take a void * while the ones causing issues require uint8_t *, how do I create uint8_t * with cffi?
2:48:25
Nilby
You can ususally just use the cffi string type, but you have to make sure the cffi encoding matches the expected encoding of the foreign functions.
2:49:07
Josh_2
thats what I've been doing, but I tried utf-8 which is what the python version is using, and I've tried ascii
2:51:20
Nilby
If it's base64 I imagine it's converting aribtrary binary data, so you don't want a character encoding conversion.
2:57:05
Nilby
On some platforms you can even use the lisp array data directly without conversion with cffi:with-pointer-to-vector-data.
3:03:20
Josh_2
well when I use (cffi:with-foreign-array ..) I get an error about not being able to find an applicable method relating to cffi:dimensions
3:05:51
Josh_2
cffi:with-pointer-to-vector-data doesn't do that though, not that I can find that function in the online
4:04:58
Josh_2
bit of a pita that I'm not longer using with-foreign-string as that automatically freed pointers
4:07:56
Nilby
Josh_2: You might be able to use with-foreign-object, but really either way it's just an unwind protect wrapper.
4:59:18
mfiano
I recently took a break from game development, after approximately 20 years. I'm really having a lot of fun developing another project with Common Lisp.
5:00:36
mfiano
I've been writing a game engine/games in CL for about 15, but my burnout meter said I needed a break.
5:13:13
mfiano
I started a rather ambitious project that requires performance and interactive development, so Common Lisp makes perfect sense. But it's in its infancy, only about 10kloc so far.
5:19:52
mfiano
It will be a library and end-user application for procedurally generating images such as abstract art or 3D textures than can wrap a game actor using math. Their is another project, called WEIR, which is a similar yet with a very different, limited use-case.
5:23:31
mfiano
So far I have about 25 coherent noise algorithms and a bunch of transformations you can apply to them in a graph. Not much, but yes, it is ambitious. I made this example the other day with the limited tools I have implemented: https://i.lisp.cl/temp/art.png
5:28:01
mfiano
One day you might be able to drag graph nodes and connect transformer edges to each other and see results in real time outside of Emacs :)