diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-15 10:12:18 -0400 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-03-15 10:12:18 -0400 |
commit | d3a95bd399092e17e40001947a3f1b432dac22a6 (patch) | |
tree | f945e92df33e02c65410c1552012dbf765e3b535 /src | |
parent | 31b3acbf09a181fcca9a90b96a308f538c6bb7ff (diff) | |
parent | 4f6ea624e7b8ee66a02a72e55d4d8399b411fd1a (diff) | |
download | cryptography-d3a95bd399092e17e40001947a3f1b432dac22a6.tar.gz cryptography-d3a95bd399092e17e40001947a3f1b432dac22a6.tar.bz2 cryptography-d3a95bd399092e17e40001947a3f1b432dac22a6.zip |
Merge pull request #1758 from reaperhulk/commoncrypto-keywrap-bindings
add AES key wrap bindings to commoncrypto
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/bindings/commoncrypto/binding.py | 1 | ||||
-rw-r--r-- | src/cryptography/hazmat/bindings/commoncrypto/common_symmetric_key_wrap.py | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/bindings/commoncrypto/binding.py b/src/cryptography/hazmat/bindings/commoncrypto/binding.py index 79a16368..f48b59cb 100644 --- a/src/cryptography/hazmat/bindings/commoncrypto/binding.py +++ b/src/cryptography/hazmat/bindings/commoncrypto/binding.py @@ -20,6 +20,7 @@ class Binding(object): "common_hmac", "common_key_derivation", "common_cryptor", + "common_symmetric_key_wrap", "secimport", "secitem", "seckey", diff --git a/src/cryptography/hazmat/bindings/commoncrypto/common_symmetric_key_wrap.py b/src/cryptography/hazmat/bindings/commoncrypto/common_symmetric_key_wrap.py new file mode 100644 index 00000000..ea9e459d --- /dev/null +++ b/src/cryptography/hazmat/bindings/commoncrypto/common_symmetric_key_wrap.py @@ -0,0 +1,37 @@ +# This file is dual licensed under the terms of the Apache License, Version +# 2.0, and the BSD License. See the LICENSE file in the root of this repository +# for complete details. + +from __future__ import absolute_import, division, print_function + +INCLUDES = """ +#include <CommonCrypto/CommonSymmetricKeywrap.h> +""" + +TYPES = """ +enum { + kCCWRAPAES = 1, +}; + +typedef uint32_t CCWrappingAlgorithm; +""" + +FUNCTIONS = """ +int CCSymmetricKeyWrap(CCWrappingAlgorithm, const uint8_t *, const size_t, + const uint8_t *, size_t, const uint8_t *, size_t, + uint8_t *, size_t *); +int CCSymmetricKeyUnwrap(CCWrappingAlgorithm algorithm, const uint8_t *, + const size_t, const uint8_t *, size_t, + const uint8_t *, size_t, uint8_t *, size_t *); +size_t CCSymmetricWrappedSize(CCWrappingAlgorithm, size_t); +size_t CCSymmetricUnwrappedSize(CCWrappingAlgorithm, size_t); + +""" + +MACROS = """ +""" + +CUSTOMIZATIONS = """ +""" + +CONDITIONAL_NAMES = {} |