diff options
| author | Donald Stufft <donald@stufft.io> | 2014-01-07 14:56:46 -0800 |
|---|---|---|
| committer | Donald Stufft <donald@stufft.io> | 2014-01-07 14:56:46 -0800 |
| commit | 7ec30af9a58647d1e38bb78b5381e64af67128a6 (patch) | |
| tree | 0bfcb081074648c95356508df5b5323b484a4d00 /cryptography | |
| parent | 168c29d6d74060b0d9f592b740f8913cc5d07c5e (diff) | |
| parent | 5e5316de9ca968f646aa04301fcf3109aef0473f (diff) | |
| download | cryptography-7ec30af9a58647d1e38bb78b5381e64af67128a6.tar.gz cryptography-7ec30af9a58647d1e38bb78b5381e64af67128a6.tar.bz2 cryptography-7ec30af9a58647d1e38bb78b5381e64af67128a6.zip | |
Merge pull request #392 from alex/setup-install-extension
All the necessary things for setup.py to build cffi stuff
Diffstat (limited to 'cryptography')
| -rw-r--r-- | cryptography/hazmat/bindings/utils.py | 3 | ||||
| -rw-r--r-- | cryptography/hazmat/primitives/constant_time.py | 7 | ||||
| -rw-r--r-- | cryptography/hazmat/primitives/padding.py | 7 |
3 files changed, 12 insertions, 5 deletions
diff --git a/cryptography/hazmat/bindings/utils.py b/cryptography/hazmat/bindings/utils.py index 9141c155..40fd07f8 100644 --- a/cryptography/hazmat/bindings/utils.py +++ b/cryptography/hazmat/bindings/utils.py @@ -74,7 +74,8 @@ def build_ffi(module_prefix, modules, pre_include, post_include, libraries): functions + customizations ), - libraries=libraries + libraries=libraries, + ext_package="cryptography", ) for name in modules: diff --git a/cryptography/hazmat/primitives/constant_time.py b/cryptography/hazmat/primitives/constant_time.py index 6502803e..e88a0d95 100644 --- a/cryptography/hazmat/primitives/constant_time.py +++ b/cryptography/hazmat/primitives/constant_time.py @@ -23,7 +23,8 @@ _ffi.cdef(""" uint8_t Cryptography_constant_time_bytes_eq(uint8_t *, size_t, uint8_t *, size_t); """) -_lib = _ffi.verify(""" +_lib = _ffi.verify( + """ uint8_t Cryptography_constant_time_bytes_eq(uint8_t *a, size_t len_a, uint8_t *b, size_t len_b) { size_t i = 0; @@ -42,7 +43,9 @@ uint8_t Cryptography_constant_time_bytes_eq(uint8_t *a, size_t len_a, /* Now check the low bit to see if it's set */ return (mismatch & 1) == 0; } -""") +""", + ext_package="cryptography", +) def bytes_eq(a, b): diff --git a/cryptography/hazmat/primitives/padding.py b/cryptography/hazmat/primitives/padding.py index e517dee0..ddb2c63c 100644 --- a/cryptography/hazmat/primitives/padding.py +++ b/cryptography/hazmat/primitives/padding.py @@ -23,7 +23,8 @@ _ffi = cffi.FFI() _ffi.cdef(""" uint8_t Cryptography_check_pkcs7_padding(const uint8_t *, uint8_t); """) -_lib = _ffi.verify(""" +_lib = _ffi.verify( + """ /* Returns the value of the input with the most-significant-bit copied to all of the bits. */ static uint8_t Cryptography_DUPLICATE_MSB_TO_ALL(uint8_t a) { @@ -59,7 +60,9 @@ uint8_t Cryptography_check_pkcs7_padding(const uint8_t *data, /* Now check the low bit to see if it's set */ return (mismatch & 1) == 0; } -""") +""", + ext_package="cryptography", +) class PKCS7(object): |
