aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-14 23:05:34 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-03-14 23:05:34 -0500
commit4f6ea624e7b8ee66a02a72e55d4d8399b411fd1a (patch)
treef945e92df33e02c65410c1552012dbf765e3b535 /src
parent31b3acbf09a181fcca9a90b96a308f538c6bb7ff (diff)
downloadcryptography-4f6ea624e7b8ee66a02a72e55d4d8399b411fd1a.tar.gz
cryptography-4f6ea624e7b8ee66a02a72e55d4d8399b411fd1a.tar.bz2
cryptography-4f6ea624e7b8ee66a02a72e55d4d8399b411fd1a.zip
add AES key wrap bindings to commoncrypto
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/bindings/commoncrypto/binding.py1
-rw-r--r--src/cryptography/hazmat/bindings/commoncrypto/common_symmetric_key_wrap.py37
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 = {}