JamesTheAwesomeDude / pypqc

Attempt to expose Wiggers and Stebila's PQClean via Python CFFI
Other
0 stars 1 forks source link

Remove extra copy when creating public keys and signatures #17

Closed JamesTheAwesomeDude closed 4 months ago

JamesTheAwesomeDude commented 5 months ago

Should get rid of the non-lazy """casts""" from FFI-Owned Memory to Python Bytes Objects

Obviously this is a nearly irrelevant performance improvement, premature optimization yadda yadda, but it's still something that's clearly the wrong thing to do, so we should do the right thing at some point.

JamesTheAwesomeDude commented 4 months ago

Not gonna be so easy.

What I tried:

I think if we want to construct the PyBytes object manually to avoid the extra copy, we'll have to ditch CFFI and just do things raw.

JamesTheAwesomeDude commented 4 months ago

As much as I'd like to ditch CFFI due to its throwing a wrench in #1, that would be a lot of work I'm not up for.

I'm closing this as "I won't fix it right now", but I would be glad to re-open this if anyone wants to help.