-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9c8571
commit f10a853
Showing
11 changed files
with
144 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
_chacha20 | ||
|
||
.old | ||
*.o | ||
*.so | ||
src/test* | ||
*.pyc | ||
|
||
__pycache__ | ||
*.egg-info | ||
build | ||
*.pyc | ||
dist | ||
|
||
Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from .util import force_bytes | ||
from rfc7539 import _chacha20 | ||
|
||
|
||
def encrypt(key, nonce, data, counter=0): | ||
return _chacha20.cipher(bytearray(key), bytearray(nonce), bytearray(data), len(data), counter) | ||
return _chacha20.cipher(force_bytes(key), force_bytes(nonce), force_bytes(data), len(data), counter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from .util import force_bytes | ||
from rfc7539 import _poly1305 | ||
|
||
|
||
def tag(key, msg): | ||
return _poly1305.tag(bytearray(key), bytearray(msg), len(msg)) | ||
return _poly1305.tag(force_bytes(key), force_bytes(msg), len(msg)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
def force_bytes(data): | ||
if isinstance(data, bytearray): | ||
return data | ||
elif not isinstance(data, bytes): | ||
return bytearray(data, 'utf8') | ||
else: | ||
return bytearray(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ def run(self): | |
|
||
setup( | ||
name='rfc7539', | ||
version='1.0.0', | ||
version='1.1.0', | ||
author='Anton Kueltz', | ||
author_email='[email protected]', | ||
license='GNU General Public License v3 (GPLv3)', | ||
|
@@ -44,11 +44,16 @@ def run(self): | |
ext_modules=[_chacha20, _poly1305], | ||
cmdclass={'test': TestCommand}, | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Development Status :: 4 - Beta', | ||
'Intended Audience :: Developers', | ||
'Topic :: Security :: Cryptography', | ||
'Operating System :: POSIX :: Linux', | ||
'Operating System :: MacOS :: MacOS X', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Programming Language :: Python :: 2', | ||
# 'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.