Commit Graph

43 Commits (add-github-workflows)

Author SHA1 Message Date
Andrew Hutchings 1b6d6d76a1 Update to 5.3.0 2022-05-06 13:40:50 +02:00
Andrew Hutchings b9072e60c6 Add get_aad() function 2022-05-06 13:34:57 +02:00
Andrew Hutchings fbefe7e7e5 Simplify OAEP and PSS
Makes things a little bit more like similar APIs.

* Hash type is now set in constructor.
* MGF is set automtically or manually with `set_mgf()`
* Label defaults to empty
2022-05-06 13:34:57 +02:00
Andrew Hutchings e34a0ece53 Completely refactor AES GCM
Some bad assumptions were made during the creation of our Python AES GCM
code. This is now modified to be more in-line with other libraries. This
is an API breaking change on unreleased code.

This now allows for aad data to be used, varying length of
authentication tags and fixes a bug for multipart.

1. Now unified to a single class AesGcmStream()
2. Used `encrypt()` and `decrypt()` instead of `update()` to avoid
   confusion over encryption and aad semantics
3. final tag_bytes is configurable in the constructor
4. `set_aad()` added to add the aad data
5. aad data is cleared after first `encrypt()` or `decrypt()` call due
   to quirk in the C API.
6. More tests added
2022-03-07 23:24:23 -08:00
Andrew Hutchings 7482e9d20f Don't use submodule if env var is set 2022-02-18 00:01:31 -08:00
Andrew Hutchings b602083429 Fix build recursion issue
Windows had an issue where it was trying to build the CFFI module after
it had already imported the CFFI module. Which caused permissions
errors during builds.

This fix does several things to make the Windows build work properly and
improve the Linux build too:

* The CFFI module is only build when needed, not as part of an sdist
  package
* Version numbering spilt out into separate file so __init__.py import
  is not required
* Merged _build_ffi.py and _build_wolfssl.py into one file
* Made CFFI only build when called as an executable (which happens
  during binary build time)
* Make tox use bdist-wheel instead of sdist
2022-02-18 00:01:31 -08:00
Andrew Hutchings 013c1e6987 Gate RSA variables in ciphers.py 2022-02-09 17:51:43 +00:00
Andrew Hutchings e58d81533c Ungate constants and gate tests 2022-02-09 14:18:23 +00:00
Andrew Hutchings 3327d9ae39 Cleanup PSS constants and build
* Use constants from wolfSSL instead of copying them
* Add build gate for PSS
* Fix indentation
2022-02-08 17:56:48 +00:00
Andrew Hutchings 501c269979 Fix AES_CTR breaking Windows builds
5.1.1 doesn't have a CMake option for this, so we do it the hard way for
  now.
2022-02-03 16:13:39 +00:00
Andrew Hutchings 863e6836a9 Add RSA OAEP and PSS padding
Functions added:
* `encrypt_oaep(self, plaintext, hash_type, mgf, label)`
* `decrypt_oaep(self, ciphertext, hash_type, mgf, label)`
* `sign_pss(self, plaintext, hash_type, mgf)`
* `verify_pss(self, plaintext, signature, hash_type, mgf)`

Constants added:
* MGF1SHA224
* MGF1SHA256
* MGF1SHA384
* MGF1SHA512
* HASH_TYPE_NONE
* HASH_TYPE_MD2
* HASH_TYPE_MD4
* HASH_TYPE_MD5
* HASH_TYPE_SHA
* HASH_TYPE_SHA224
* HASH_TYPE_SHA256
* HASH_TYPE_SHA384
* HASH_TYPE_SHA512
* HASH_TYPE_MD5_SHA
* HASH_TYPE_SHA3_224
* HASH_TYPE_SHA3_256
* HASH_TYPE_SHA3_384
* HASH_TYPE_SHA3_512
* HASH_TYPE_BLAKE2B
* HASH_TYPE_BLAKE2S
2022-02-03 15:43:04 +00:00
Hayden Roche 726c37e9e7
Merge pull request #33 from danielinux/aes-ctr 2022-02-01 15:43:12 -08:00
Andrew Hutchings 16334bf5e6 Add support for AES GCM streaming 2022-02-01 07:45:21 -08:00
Andrew Hutchings c7125b04b1 Fix sdist and packaging
wolfcrypt was not being packaged in the sdist and the build system did
not work if the source wasn't a git checkout. Both fixed.
2022-01-31 04:34:03 -08:00
Daniele Lacamera 8a514e0f8e Added support for AES-CTR 2022-01-31 13:32:14 +01:00
Andrew Hutchings bd4432b7be Refactor build for better platform support
* Fix some path and compiler things for Windows
* Move source code to align better with Python standards
* Have setup.py build wolfSSL and FFI
* Update Python versions in tox
* Add CMake building for Windows build
* Add missing __init__.py for tox
* Make wolfSSL a git submodule
2022-01-31 00:51:45 -08:00
Moisés Guimarães bf298548ab move files to wolfssl/wrappers/python 2016-05-15 15:23:21 -03:00
Moisés Guimarães 3c6aaff373 updates readme 2016-05-09 18:51:30 -03:00
Moisés Guimarães 6574ee4a5f fixes requirements install 2016-05-05 12:42:30 -03:00
Moisés Guimarães b12d287e16 fixes about 2016-05-05 11:41:17 -03:00
Moisés Guimarães f84d395d69 finished docs for v0.1.0 rc1 2016-05-03 00:01:18 -03:00
Moisés Guimarães 6f202cdfe3 updates docs with hashes and random 2016-05-02 22:37:10 -03:00
Moisés Guimarães 4cf4d195f7 removes -py sufix 2016-05-02 19:34:55 -03:00
Moisés Guimarães 8014a9e211 minor fixes on __about__.py 2016-05-02 16:21:08 -03:00
Moisés Guimarães b50afa900c adds ciphers docstrings 2016-05-01 12:11:58 -03:00
Moisés Guimarães 0f3b36d55c updates docs. 2016-05-01 11:37:04 -03:00
Moisés Guimarães 9af1f0d034 adds random and hashes docstrings. 2016-05-01 11:17:37 -03:00
Moisés Guimarães 2287ebad58 renames utils functions 2016-05-01 10:14:56 -03:00
Moisés Guimarães 7297310498 fixes random tests 2016-05-01 09:15:44 -03:00
Moisés Guimarães 7cab8863d6 adds error handling with Exceptions. 2016-05-01 09:13:57 -03:00
Moisés Guimarães 647f65c0cc fixes python3 issues 2016-04-30 23:14:51 -03:00
Moisés Guimarães 765a8f8aff removes constructor restrictions in hashes and ciphers 2016-04-29 17:50:36 -03:00
Moisés Guimarães 525b29bb01 adds RSA cipher 2016-04-24 22:02:14 -03:00
Moisés Guimarães 919cc67a9d fixes multiple ffi instances error 2016-04-24 20:49:07 -03:00
Moisés Guimarães 7e5efb125f adds tests; simplifies hashes and fixes ciphers to retain state. 2016-04-18 20:20:50 -03:00
Moisés Guimarães 6a78b4f41d fixes import * making some variables 'private' 2016-04-16 19:32:39 -03:00
Moisés Guimarães 691c59bd64 adds RNG wrappers 2016-04-14 21:32:39 -03:00
Moisés Guimarães efa336be2b adds Hmac wrappers 2016-04-14 21:00:44 -03:00
Moisés Guimarães 8c8f471486 adds Aes wrappers 2016-04-14 20:23:17 -03:00
Moisés Guimarães 1aeb5e90ec adds Des3 wrappers 2016-04-14 18:13:11 -03:00
Moisés Guimarães 02f980c2fb remove temporary file 2016-04-14 18:08:24 -03:00
Moisés Guimarães 949995c0cb implements Sha[1:256:384:512] wrappers; adds buiding scripts 2016-04-11 23:45:22 -03:00
Moisés Guimarães cd72991147 eliminates src folder 2016-04-11 21:34:20 -03:00