|
@@ -1,5 +1,5 @@
|
|
|
-#include "Initiator_Transforms.h"
|
|
|
-int Initiator_Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8)
|
|
|
+#include "Transforms.h"
|
|
|
+int Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, uint8_t* temp8)
|
|
|
{
|
|
|
if(temp32 > UINT8_MAX)
|
|
|
return -1;
|
|
@@ -11,7 +11,7 @@ int Initiator_Transforms::fit_32_into_uint8_t(google::protobuf::uint32 temp32, u
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16)
|
|
|
+int Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32, uint16_t* temp16)
|
|
|
{
|
|
|
if(temp32 > UINT16_MAX)
|
|
|
return -1;
|
|
@@ -23,7 +23,7 @@ int Initiator_Transforms::fit_32_into_uint16_t(google::protobuf::uint32 temp32,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void Initiator_Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a)
|
|
|
+void Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec256_public_t* protobuf_g_a , sgx_ec256_public_t* g_a)
|
|
|
{
|
|
|
printf("\n ec256 public key gx and gy \n");
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
@@ -39,13 +39,13 @@ void Initiator_Transforms::encode_ec256_public_key_to_protobuf(protobuf_sgx_ec25
|
|
|
printf("\n");
|
|
|
}
|
|
|
|
|
|
-void Initiator_Transforms::encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
|
|
|
+void Transforms::encode_attributes_to_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
|
|
|
{
|
|
|
protobuf_attributes->set_flags(attributes->flags);
|
|
|
protobuf_attributes->set_xfrm(attributes->xfrm);
|
|
|
}
|
|
|
|
|
|
-void Initiator_Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
|
|
|
+void Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
|
|
|
{
|
|
|
printf("\n report \n key id \n");
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
@@ -124,7 +124,7 @@ void Initiator_Transforms::encode_report_to_protobuf(protobuf_sgx_report_t* prot
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
|
|
|
+int Transforms::decode_attributes_from_protobuf(protobuf_sgx_attributes_t* protobuf_attributes, sgx_attributes_t* attributes)
|
|
|
{
|
|
|
attributes->flags = protobuf_attributes->flags();
|
|
|
printf("\n flags %" PRIu64 " \n", attributes->flags);
|
|
@@ -133,7 +133,7 @@ int Initiator_Transforms::decode_attributes_from_protobuf(protobuf_sgx_attribute
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
|
|
|
+int Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* protobuf_report, sgx_report_t* report)
|
|
|
{
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
|
printf("\n----------------------Decoding received msg3 ------------------------\n");
|
|
@@ -245,7 +245,7 @@ int Initiator_Transforms::decode_report_from_protobuf(protobuf_sgx_report_t* pro
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1)
|
|
|
+int Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1)
|
|
|
{
|
|
|
int counter;
|
|
|
printf("gx\n");
|
|
@@ -285,7 +285,7 @@ int Initiator_Transforms::print_initialized_msg1( protobuf_sgx_dh_msg1_t& protob
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1)
|
|
|
+int Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& protobuf_dhmsg1, sgx_dh_msg1_t* native_dhmsg1)
|
|
|
{
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
|
|
|
@@ -326,7 +326,7 @@ int Initiator_Transforms::decode_msg1_from_protobuf( protobuf_sgx_dh_msg1_t& pro
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-int Initiator_Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3)
|
|
|
+int Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& protobuf_dhmsg3, sgx_dh_msg3_t* native_dhmsg3)
|
|
|
{
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
|
for(counter=0;counter<SGX_DH_MAC_SIZE;counter++)
|
|
@@ -347,7 +347,7 @@ int Initiator_Transforms::decode_msg3_from_protobuf(protobuf_sgx_dh_msg3_t& prot
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-void Initiator_Transforms::encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2)
|
|
|
+void Transforms::encode_msg2_to_protobuf( protobuf_sgx_dh_msg2_t& protobuf_dhmsg2, sgx_dh_msg2_t* native_dhmsg2)
|
|
|
{
|
|
|
int counter; google::protobuf::uint32 temp32;
|
|
|
printf("\n msg2 cmac \n");
|