Clean up gatekeeper app in preparation for 64-bit apps

Bug: 120497636
Change-Id: Ica85723262d2bfa94a35b2dc90a589eeb71f19f4
diff --git a/trusty_gatekeeper.cpp b/trusty_gatekeeper.cpp
index 3e6e9a8..9b5ef55 100644
--- a/trusty_gatekeeper.cpp
+++ b/trusty_gatekeeper.cpp
@@ -114,7 +114,7 @@
 }
 
 bool TrustyGateKeeper::GetAuthTokenKey(const uint8_t** auth_token_key,
-                                       size_t* length) const {
+                                       uint32_t* length) const {
     *length = 0;
     *auth_token_key = NULL;
 
@@ -141,17 +141,17 @@
 }
 
 void TrustyGateKeeper::GetPasswordKey(const uint8_t** password_key,
-                                      size_t* length) {
+                                      uint32_t* length) {
     *password_key = const_cast<const uint8_t*>(master_key_.get());
     *length = HMAC_SHA_256_KEY_SIZE;
 }
 
 void TrustyGateKeeper::ComputePasswordSignature(uint8_t* signature,
-                                                size_t signature_length,
+                                                uint32_t signature_length,
                                                 const uint8_t* key,
-                                                size_t key_length,
+                                                uint32_t key_length,
                                                 const uint8_t* password,
-                                                size_t password_length,
+                                                uint32_t password_length,
                                                 salt_t salt) const {
     // todo: heap allocate
     uint8_t salted_password[password_length + sizeof(salt)];
@@ -161,20 +161,20 @@
                      salted_password, password_length + sizeof(salt));
 }
 
-void TrustyGateKeeper::GetRandom(void* random, size_t requested_size) const {
+void TrustyGateKeeper::GetRandom(void* random, uint32_t requested_size) const {
     if (random == NULL)
         return;
     trusty_rng_secure_rand(reinterpret_cast<uint8_t*>(random), requested_size);
 }
 
 void TrustyGateKeeper::ComputeSignature(uint8_t* signature,
-                                        size_t signature_length,
+                                        uint32_t signature_length,
                                         const uint8_t* key,
-                                        size_t key_length,
+                                        uint32_t key_length,
                                         const uint8_t* message,
-                                        const size_t length) const {
+                                        const uint32_t length) const {
     uint8_t buf[HMAC_SHA_256_KEY_SIZE];
-    size_t buf_len;
+    unsigned int buf_len;
 
     HMAC(EVP_sha256(), key, key_length, message, length, buf, &buf_len);
     size_t to_write = buf_len;
diff --git a/trusty_gatekeeper.h b/trusty_gatekeeper.h
index 3a52e37..5d45f50 100644
--- a/trusty_gatekeeper.h
+++ b/trusty_gatekeeper.h
@@ -37,25 +37,25 @@
     // See gatekeeper/gatekeeper.h for documentation
 
     virtual bool GetAuthTokenKey(const uint8_t** auth_token_key,
-                                 size_t* length) const;
+                                 uint32_t* length) const;
 
-    virtual void GetPasswordKey(const uint8_t** password_key, size_t* length);
+    virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length);
 
     virtual void ComputePasswordSignature(uint8_t* signature,
-                                          size_t signature_length,
+                                          uint32_t signature_length,
                                           const uint8_t* key,
-                                          size_t key_length,
+                                          uint32_t key_length,
                                           const uint8_t* password,
-                                          size_t password_length,
+                                          uint32_t password_length,
                                           salt_t salt) const;
 
-    virtual void GetRandom(void* random, size_t requested_size) const;
+    virtual void GetRandom(void* random, uint32_t requested_size) const;
     virtual void ComputeSignature(uint8_t* signature,
-                                  size_t signature_length,
+                                  uint32_t signature_length,
                                   const uint8_t* key,
-                                  size_t key_length,
+                                  uint32_t key_length,
                                   const uint8_t* message,
-                                  const size_t length) const;
+                                  const uint32_t length) const;
     virtual uint64_t GetMillisecondsSinceBoot() const;
 
     virtual bool GetFailureRecord(uint32_t uid,