antonkueltz / rfc7539 Goto Github PK
View Code? Open in Web Editor NEWAEAD cipher based on ChaCha20 stream cipher and Poly1305 MAC
Home Page: https://tools.ietf.org/html/rfc7539
License: GNU General Public License v3.0
AEAD cipher based on ChaCha20 stream cipher and Poly1305 MAC
Home Page: https://tools.ietf.org/html/rfc7539
License: GNU General Public License v3.0
pip install rfc7539
fails with:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/test.py -> build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/cipher.py -> build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/mac.py -> build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/__init__.py -> build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/util.py -> build/lib.linux-x86_64-3.6/rfc7539
copying rfc7539/aead.py -> build/lib.linux-x86_64-3.6/rfc7539
running build_ext
building 'rfc7539._chacha20' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ -I/usr/include/python3.6m -I/home/str4d/env/include/python3.6m -c src/_chacha20.c -o build/temp.linux-x86_64-3.6/src/_chacha20.o -std=c99 -O2
src/_chacha20.c:13:10: fatal error: _chacha20.h: No such file or directory
#include "_chacha20.h"
^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Looking at the log output, it is using the tarball from https://files.pythonhosted.org/packages/f8/e1/212ca9b09c017b767c09a553380eb2ff4af6bf7443f3dc134888ead469f4/rfc7539-1.1.0.tar.gz which appears to not contain the header files.
Hi,
I've been trying to pip install rfc7539
and failing miserably today on multiple systems with the error below. I've tried installing multiple libgcrypt/libgcrypt20 libraries, but no change. Any help would be appreciated. I can post the full pip error logs if you want them. I see this may be similar to Issue #2.
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isrc/ -I/usr/local/include/python2.7 -c src/_chacha20.c -o build/temp.linux-x86_64-2.7/src/_chacha20.o -std=c99 -O2
In file included from /usr/local/include/python2.7/Python.h:8,
from src/_chacha20.c:10:
/usr/local/include/python2.7/pyconfig.h:1223: warning: "_POSIX_C_SOURCE" redefined
#define _POSIX_C_SOURCE 200112L
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26,
from src/_chacha20.c:7:
/usr/include/features.h:294: note: this is the location of the previous definition
# define _POSIX_C_SOURCE 199506L
src/_chacha20.c:141:15: error: variable ‘moduledef’ has initializer but incomplete type
static struct PyModuleDef moduledef = {
^~~~~~~~~~~
src/_chacha20.c:142:5: error: ‘PyModuleDef_HEAD_INIT’ undeclared here (not in a function); did you mean ‘PyObject_HEAD_INIT’?
PyModuleDef_HEAD_INIT,
^~~~~~~~~~~~~~~~~~~~~
PyObject_HEAD_INIT
Per RFC 7539, no padding should be applied to the AAD or ciphertext if they are already an integral multiple of 16 bytes (which includes a zero-length AAD):
- Finally, the Poly1305 function is called with the Poly1305 key
calculated above, and a message constructed as a concatenation of
the following:
- The AAD
- padding1 -- the padding is up to 15 zero bytes, and it brings
the total length so far to an integral multiple of 16. If the
length of the AAD was already an integral multiple of 16 bytes,
this field is zero-length.- The ciphertext
- padding2 -- the padding is up to 15 zero bytes, and it brings
the total length so far to an integral multiple of 16. If the
length of the ciphertext was already an integral multiple of 16
bytes, this field is zero-length.- The length of the additional data in octets (as a 64-bit
little-endian integer).- The length of the ciphertext in octets (as a 64-bit little-
endian integer).
pad16(x):
if (len(x) % 16)==0
then return NULL
else return copies(0, 16-(len(x)%16))
end
However, the current implementation applies 16 bytes of padding in this case:
Lines 30 to 32 in 10e0284
Hello !
It seems that the version on pip is not up to date with the current repository, preventing it to work with Python 3.10. Coud you update it please?
Thanx a lot! :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.