diff options
author | Shawn Willden <swillden@google.com> | 2015-05-23 03:36:30 +0000 |
---|---|---|
committer | Shawn Willden <swillden@google.com> | 2015-05-23 03:36:30 +0000 |
commit | 13fbe3e93247943c26e7ca2ed27b6d650282b8bf (patch) | |
tree | cd71086d18f6eb1ffc47d7f8cc3d92346ba639c6 /ocb_utils.h | |
parent | 8ba2a043f0d44ad3f58d4af518f9391c03eca9c3 (diff) | |
download | android_system_keymaster-13fbe3e93247943c26e7ca2ed27b6d650282b8bf.tar.gz android_system_keymaster-13fbe3e93247943c26e7ca2ed27b6d650282b8bf.tar.bz2 android_system_keymaster-13fbe3e93247943c26e7ca2ed27b6d650282b8bf.zip |
Revert "Large refactor to move context out of AndroidKeymaster."
This reverts commit 8ba2a043f0d44ad3f58d4af518f9391c03eca9c3.
I need to update the Volantis non-secure code in sync. Reverting while I get that done.
Change-Id: I0fb9f928e7e624ad678050a04bb873b43b1c9a48
Diffstat (limited to 'ocb_utils.h')
-rw-r--r-- | ocb_utils.h | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/ocb_utils.h b/ocb_utils.h index bae1e08..2104742 100644 --- a/ocb_utils.h +++ b/ocb_utils.h @@ -19,29 +19,21 @@ #include "ae.h" -#include <hardware/keymaster_defs.h> - -#include <keymaster/serializable.h> - namespace keymaster { -class AuthorizationSet; -struct KeymasterKeyBlob; - -static const int OCB_NONCE_LENGTH = 12; -static const int OCB_TAG_LENGTH = 16; +class AeCtx { + public: + AeCtx() : ctx_(ae_allocate(NULL)) {} + ~AeCtx() { + ae_clear(ctx_); + ae_free(ctx_); + } -keymaster_error_t OcbEncryptKey(const AuthorizationSet& hw_enforced, - const AuthorizationSet& sw_enforced, const AuthorizationSet& hidden, - const KeymasterKeyBlob& master_key, - const KeymasterKeyBlob& plaintext, const Buffer& nonce, - KeymasterKeyBlob* ciphertext, Buffer* tag); + ae_ctx* get() { return ctx_; } -keymaster_error_t OcbDecryptKey(const AuthorizationSet& hw_enforced, - const AuthorizationSet& sw_enforced, const AuthorizationSet& hidden, - const KeymasterKeyBlob& master_key, - const KeymasterKeyBlob& ciphertext, const Buffer& nonce, - const Buffer& tag, KeymasterKeyBlob* plaintext); + private: + ae_ctx* ctx_; +}; } // namespace keymaster |