• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching +full:- +full:- +full:target

2 // Use of this source code is governed by a BSD-style license that can be
5 // THIS CODE IS GENERATED - DO NOT MODIFY!
29 *size -= sizeof(uint8_t); in uint8_t_Marshal()
33 TPM_RC uint8_t_Unmarshal(uint8_t* target, BYTE** buffer, INT32* size) { in uint8_t_Unmarshal() argument
41 *target = be16toh(value_net); in uint8_t_Unmarshal()
44 *target = be32toh(value_net); in uint8_t_Unmarshal()
47 *target = be64toh(value_net); in uint8_t_Unmarshal()
50 *target = value_net; in uint8_t_Unmarshal()
53 *size -= sizeof(uint8_t); in uint8_t_Unmarshal()
77 *size -= sizeof(int8_t); in int8_t_Marshal()
81 TPM_RC int8_t_Unmarshal(int8_t* target, BYTE** buffer, INT32* size) { in int8_t_Unmarshal() argument
89 *target = be16toh(value_net); in int8_t_Unmarshal()
92 *target = be32toh(value_net); in int8_t_Unmarshal()
95 *target = be64toh(value_net); in int8_t_Unmarshal()
98 *target = value_net; in int8_t_Unmarshal()
101 *size -= sizeof(int8_t); in int8_t_Unmarshal()
125 *size -= sizeof(uint16_t); in uint16_t_Marshal()
129 TPM_RC uint16_t_Unmarshal(uint16_t* target, BYTE** buffer, INT32* size) { in uint16_t_Unmarshal() argument
137 *target = be16toh(value_net); in uint16_t_Unmarshal()
140 *target = be32toh(value_net); in uint16_t_Unmarshal()
143 *target = be64toh(value_net); in uint16_t_Unmarshal()
146 *target = value_net; in uint16_t_Unmarshal()
149 *size -= sizeof(uint16_t); in uint16_t_Unmarshal()
173 *size -= sizeof(int16_t); in int16_t_Marshal()
177 TPM_RC int16_t_Unmarshal(int16_t* target, BYTE** buffer, INT32* size) { in int16_t_Unmarshal() argument
185 *target = be16toh(value_net); in int16_t_Unmarshal()
188 *target = be32toh(value_net); in int16_t_Unmarshal()
191 *target = be64toh(value_net); in int16_t_Unmarshal()
194 *target = value_net; in int16_t_Unmarshal()
197 *size -= sizeof(int16_t); in int16_t_Unmarshal()
221 *size -= sizeof(uint32_t); in uint32_t_Marshal()
225 TPM_RC uint32_t_Unmarshal(uint32_t* target, BYTE** buffer, INT32* size) { in uint32_t_Unmarshal() argument
233 *target = be16toh(value_net); in uint32_t_Unmarshal()
236 *target = be32toh(value_net); in uint32_t_Unmarshal()
239 *target = be64toh(value_net); in uint32_t_Unmarshal()
242 *target = value_net; in uint32_t_Unmarshal()
245 *size -= sizeof(uint32_t); in uint32_t_Unmarshal()
269 *size -= sizeof(int32_t); in int32_t_Marshal()
273 TPM_RC int32_t_Unmarshal(int32_t* target, BYTE** buffer, INT32* size) { in int32_t_Unmarshal() argument
281 *target = be16toh(value_net); in int32_t_Unmarshal()
284 *target = be32toh(value_net); in int32_t_Unmarshal()
287 *target = be64toh(value_net); in int32_t_Unmarshal()
290 *target = value_net; in int32_t_Unmarshal()
293 *size -= sizeof(int32_t); in int32_t_Unmarshal()
317 *size -= sizeof(uint64_t); in uint64_t_Marshal()
321 TPM_RC uint64_t_Unmarshal(uint64_t* target, BYTE** buffer, INT32* size) { in uint64_t_Unmarshal() argument
329 *target = be16toh(value_net); in uint64_t_Unmarshal()
332 *target = be32toh(value_net); in uint64_t_Unmarshal()
335 *target = be64toh(value_net); in uint64_t_Unmarshal()
338 *target = value_net; in uint64_t_Unmarshal()
341 *size -= sizeof(uint64_t); in uint64_t_Unmarshal()
365 *size -= sizeof(int64_t); in int64_t_Marshal()
369 TPM_RC int64_t_Unmarshal(int64_t* target, BYTE** buffer, INT32* size) { in int64_t_Unmarshal() argument
377 *target = be16toh(value_net); in int64_t_Unmarshal()
380 *target = be32toh(value_net); in int64_t_Unmarshal()
383 *target = be64toh(value_net); in int64_t_Unmarshal()
386 *target = value_net; in int64_t_Unmarshal()
389 *size -= sizeof(int64_t); in int64_t_Unmarshal()
397 TPM_RC BYTE_Unmarshal(BYTE* target, BYTE** buffer, INT32* size) { in BYTE_Unmarshal() argument
398 return uint8_t_Unmarshal(target, buffer, size); in BYTE_Unmarshal()
405 TPM_RC INT16_Unmarshal(INT16* target, BYTE** buffer, INT32* size) { in INT16_Unmarshal() argument
406 return int16_t_Unmarshal(target, buffer, size); in INT16_Unmarshal()
413 TPM_RC INT32_Unmarshal(INT32* target, BYTE** buffer, INT32* size) { in INT32_Unmarshal() argument
414 return int32_t_Unmarshal(target, buffer, size); in INT32_Unmarshal()
421 TPM_RC INT64_Unmarshal(INT64* target, BYTE** buffer, INT32* size) { in INT64_Unmarshal() argument
422 return int64_t_Unmarshal(target, buffer, size); in INT64_Unmarshal()
429 TPM_RC INT8_Unmarshal(INT8* target, BYTE** buffer, INT32* size) { in INT8_Unmarshal() argument
430 return int8_t_Unmarshal(target, buffer, size); in INT8_Unmarshal()
437 TPM_RC UINT16_Unmarshal(UINT16* target, BYTE** buffer, INT32* size) { in UINT16_Unmarshal() argument
438 return uint16_t_Unmarshal(target, buffer, size); in UINT16_Unmarshal()
444 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_ATTEST_Marshal()
445 for (i = 0; i < source->t.size; ++i) { in TPM2B_ATTEST_Marshal()
446 total_size += BYTE_Marshal(&source->t.attestationData[i], buffer, size); in TPM2B_ATTEST_Marshal()
451 TPM_RC TPM2B_ATTEST_Unmarshal(TPM2B_ATTEST* target, in TPM2B_ATTEST_Unmarshal() argument
456 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_ATTEST_Unmarshal()
460 if (target->t.size == 0) { in TPM2B_ATTEST_Unmarshal()
463 if (target->t.size > sizeof(TPMS_ATTEST)) { in TPM2B_ATTEST_Unmarshal()
466 for (i = 0; i < target->t.size; ++i) { in TPM2B_ATTEST_Unmarshal()
467 result = BYTE_Unmarshal(&target->t.attestationData[i], buffer, size); in TPM2B_ATTEST_Unmarshal()
478 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_DIGEST_Marshal()
479 for (i = 0; i < source->t.size; ++i) { in TPM2B_DIGEST_Marshal()
480 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_DIGEST_Marshal()
485 TPM_RC TPM2B_DIGEST_Unmarshal(TPM2B_DIGEST* target, in TPM2B_DIGEST_Unmarshal() argument
490 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_DIGEST_Unmarshal()
494 if (target->t.size == 0) { in TPM2B_DIGEST_Unmarshal()
497 if (target->t.size > sizeof(TPMU_HA)) { in TPM2B_DIGEST_Unmarshal()
500 for (i = 0; i < target->t.size; ++i) { in TPM2B_DIGEST_Unmarshal()
501 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_DIGEST_Unmarshal()
513 TPM_RC TPM2B_AUTH_Unmarshal(TPM2B_AUTH* target, BYTE** buffer, INT32* size) { in TPM2B_AUTH_Unmarshal() argument
514 return TPM2B_DIGEST_Unmarshal(target, buffer, size); in TPM2B_AUTH_Unmarshal()
522 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_CONTEXT_DATA_Marshal()
523 for (i = 0; i < source->t.size; ++i) { in TPM2B_CONTEXT_DATA_Marshal()
524 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_CONTEXT_DATA_Marshal()
529 TPM_RC TPM2B_CONTEXT_DATA_Unmarshal(TPM2B_CONTEXT_DATA* target, in TPM2B_CONTEXT_DATA_Unmarshal() argument
534 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_CONTEXT_DATA_Unmarshal()
538 if (target->t.size == 0) { in TPM2B_CONTEXT_DATA_Unmarshal()
541 if (target->t.size > sizeof(TPMS_CONTEXT_DATA)) { in TPM2B_CONTEXT_DATA_Unmarshal()
544 for (i = 0; i < target->t.size; ++i) { in TPM2B_CONTEXT_DATA_Unmarshal()
545 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_CONTEXT_DATA_Unmarshal()
558 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_CONTEXT_SENSITIVE_Marshal()
559 for (i = 0; i < source->t.size; ++i) { in TPM2B_CONTEXT_SENSITIVE_Marshal()
560 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_CONTEXT_SENSITIVE_Marshal()
565 TPM_RC TPM2B_CONTEXT_SENSITIVE_Unmarshal(TPM2B_CONTEXT_SENSITIVE* target, in TPM2B_CONTEXT_SENSITIVE_Unmarshal() argument
570 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_CONTEXT_SENSITIVE_Unmarshal()
574 if (target->t.size == 0) { in TPM2B_CONTEXT_SENSITIVE_Unmarshal()
577 if (target->t.size > MAX_CONTEXT_SIZE) { in TPM2B_CONTEXT_SENSITIVE_Unmarshal()
580 for (i = 0; i < target->t.size; ++i) { in TPM2B_CONTEXT_SENSITIVE_Unmarshal()
581 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_CONTEXT_SENSITIVE_Unmarshal()
593 TPM_RC TPM_ALG_ID_Unmarshal(TPM_ALG_ID* target, BYTE** buffer, INT32* size) { in TPM_ALG_ID_Unmarshal() argument
595 result = uint16_t_Unmarshal(target, buffer, size); in TPM_ALG_ID_Unmarshal()
600 if (*target == TPM_ALG_ERROR) { in TPM_ALG_ID_Unmarshal()
605 if (*target == TPM_ALG_RSA) { in TPM_ALG_ID_Unmarshal()
610 if (*target == TPM_ALG_SHA) { in TPM_ALG_ID_Unmarshal()
615 if (*target == TPM_ALG_SHA1) { in TPM_ALG_ID_Unmarshal()
620 if (*target == TPM_ALG_HMAC) { in TPM_ALG_ID_Unmarshal()
625 if (*target == TPM_ALG_AES) { in TPM_ALG_ID_Unmarshal()
630 if (*target == TPM_ALG_MGF1) { in TPM_ALG_ID_Unmarshal()
635 if (*target == TPM_ALG_KEYEDHASH) { in TPM_ALG_ID_Unmarshal()
640 if (*target == TPM_ALG_XOR) { in TPM_ALG_ID_Unmarshal()
645 if (*target == TPM_ALG_SHA256) { in TPM_ALG_ID_Unmarshal()
650 if (*target == TPM_ALG_SHA384) { in TPM_ALG_ID_Unmarshal()
655 if (*target == TPM_ALG_SHA512) { in TPM_ALG_ID_Unmarshal()
660 if (*target == TPM_ALG_NULL) { in TPM_ALG_ID_Unmarshal()
665 if (*target == TPM_ALG_SM3_256) { in TPM_ALG_ID_Unmarshal()
670 if (*target == TPM_ALG_SM4) { in TPM_ALG_ID_Unmarshal()
675 if (*target == TPM_ALG_RSASSA) { in TPM_ALG_ID_Unmarshal()
680 if (*target == TPM_ALG_RSAES) { in TPM_ALG_ID_Unmarshal()
685 if (*target == TPM_ALG_RSAPSS) { in TPM_ALG_ID_Unmarshal()
690 if (*target == TPM_ALG_OAEP) { in TPM_ALG_ID_Unmarshal()
695 if (*target == TPM_ALG_ECDSA) { in TPM_ALG_ID_Unmarshal()
700 if (*target == TPM_ALG_ECDH) { in TPM_ALG_ID_Unmarshal()
705 if (*target == TPM_ALG_ECDAA) { in TPM_ALG_ID_Unmarshal()
710 if (*target == TPM_ALG_SM2) { in TPM_ALG_ID_Unmarshal()
715 if (*target == TPM_ALG_ECSCHNORR) { in TPM_ALG_ID_Unmarshal()
720 if (*target == TPM_ALG_ECMQV) { in TPM_ALG_ID_Unmarshal()
725 if (*target == TPM_ALG_KDF1_SP800_56A) { in TPM_ALG_ID_Unmarshal()
730 if (*target == TPM_ALG_KDF2) { in TPM_ALG_ID_Unmarshal()
735 if (*target == TPM_ALG_KDF1_SP800_108) { in TPM_ALG_ID_Unmarshal()
740 if (*target == TPM_ALG_ECC) { in TPM_ALG_ID_Unmarshal()
745 if (*target == TPM_ALG_SYMCIPHER) { in TPM_ALG_ID_Unmarshal()
750 if (*target == TPM_ALG_CAMELLIA) { in TPM_ALG_ID_Unmarshal()
755 if (*target == TPM_ALG_CTR) { in TPM_ALG_ID_Unmarshal()
760 if (*target == TPM_ALG_OFB) { in TPM_ALG_ID_Unmarshal()
765 if (*target == TPM_ALG_CBC) { in TPM_ALG_ID_Unmarshal()
770 if (*target == TPM_ALG_CFB) { in TPM_ALG_ID_Unmarshal()
775 if (*target == TPM_ALG_ECB) { in TPM_ALG_ID_Unmarshal()
785 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_DATA_Marshal()
786 for (i = 0; i < source->t.size; ++i) { in TPM2B_DATA_Marshal()
787 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_DATA_Marshal()
792 TPM_RC TPM2B_DATA_Unmarshal(TPM2B_DATA* target, BYTE** buffer, INT32* size) { in TPM2B_DATA_Unmarshal() argument
795 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_DATA_Unmarshal()
799 if (target->t.size == 0) { in TPM2B_DATA_Unmarshal()
802 if (target->t.size > sizeof(TPMT_HA)) { in TPM2B_DATA_Unmarshal()
805 for (i = 0; i < target->t.size; ++i) { in TPM2B_DATA_Unmarshal()
806 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_DATA_Unmarshal()
820 TPM_RC TPMA_LOCALITY_Unmarshal(TPMA_LOCALITY* target, in TPMA_LOCALITY_Unmarshal() argument
824 result = uint8_t_Unmarshal((uint8_t*)target, buffer, size); in TPMA_LOCALITY_Unmarshal()
834 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_NAME_Marshal()
835 for (i = 0; i < source->t.size; ++i) { in TPM2B_NAME_Marshal()
836 total_size += BYTE_Marshal(&source->t.name[i], buffer, size); in TPM2B_NAME_Marshal()
841 TPM_RC TPM2B_NAME_Unmarshal(TPM2B_NAME* target, BYTE** buffer, INT32* size) { in TPM2B_NAME_Unmarshal() argument
844 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_NAME_Unmarshal()
848 if (target->t.size == 0) { in TPM2B_NAME_Unmarshal()
851 if (target->t.size > sizeof(TPMU_NAME)) { in TPM2B_NAME_Unmarshal()
854 for (i = 0; i < target->t.size; ++i) { in TPM2B_NAME_Unmarshal()
855 result = BYTE_Unmarshal(&target->t.name[i], buffer, size); in TPM2B_NAME_Unmarshal()
869 TPM_RC TPMI_ALG_HASH_Unmarshal(TPMI_ALG_HASH* target, in TPMI_ALG_HASH_Unmarshal() argument
875 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_HASH_Unmarshal()
879 if (*target == TPM_ALG_NULL) { in TPMI_ALG_HASH_Unmarshal()
882 switch (*target) { in TPMI_ALG_HASH_Unmarshal()
914 TPM_RC UINT8_Unmarshal(UINT8* target, BYTE** buffer, INT32* size) { in UINT8_Unmarshal() argument
915 return uint8_t_Unmarshal(target, buffer, size); in UINT8_Unmarshal()
923 total_size += TPMI_ALG_HASH_Marshal(&source->hash, buffer, size); in TPMS_PCR_SELECTION_Marshal()
924 total_size += UINT8_Marshal(&source->sizeofSelect, buffer, size); in TPMS_PCR_SELECTION_Marshal()
925 for (i = 0; i < source->sizeofSelect; ++i) { in TPMS_PCR_SELECTION_Marshal()
926 total_size += BYTE_Marshal(&source->pcrSelect[i], buffer, size); in TPMS_PCR_SELECTION_Marshal()
931 TPM_RC TPMS_PCR_SELECTION_Unmarshal(TPMS_PCR_SELECTION* target, in TPMS_PCR_SELECTION_Unmarshal() argument
936 result = TPMI_ALG_HASH_Unmarshal(&target->hash, buffer, size, FALSE); in TPMS_PCR_SELECTION_Unmarshal()
940 result = UINT8_Unmarshal(&target->sizeofSelect, buffer, size); in TPMS_PCR_SELECTION_Unmarshal()
944 if (target->sizeofSelect > PCR_SELECT_MAX) { in TPMS_PCR_SELECTION_Unmarshal()
947 if (target->sizeofSelect < PCR_SELECT_MIN) { in TPMS_PCR_SELECTION_Unmarshal()
950 for (i = 0; i < target->sizeofSelect; ++i) { in TPMS_PCR_SELECTION_Unmarshal()
951 result = BYTE_Unmarshal(&target->pcrSelect[i], buffer, size); in TPMS_PCR_SELECTION_Unmarshal()
963 TPM_RC UINT32_Unmarshal(UINT32* target, BYTE** buffer, INT32* size) { in UINT32_Unmarshal() argument
964 return uint32_t_Unmarshal(target, buffer, size); in UINT32_Unmarshal()
972 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_PCR_SELECTION_Marshal()
973 for (i = 0; i < source->count; ++i) { in TPML_PCR_SELECTION_Marshal()
975 TPMS_PCR_SELECTION_Marshal(&source->pcrSelections[i], buffer, size); in TPML_PCR_SELECTION_Marshal()
980 TPM_RC TPML_PCR_SELECTION_Unmarshal(TPML_PCR_SELECTION* target, in TPML_PCR_SELECTION_Unmarshal() argument
985 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_PCR_SELECTION_Unmarshal()
989 if (target->count > HASH_COUNT) { in TPML_PCR_SELECTION_Unmarshal()
992 for (i = 0; i < target->count; ++i) { in TPML_PCR_SELECTION_Unmarshal()
994 TPMS_PCR_SELECTION_Unmarshal(&target->pcrSelections[i], buffer, size); in TPML_PCR_SELECTION_Unmarshal()
1006 total_size += TPML_PCR_SELECTION_Marshal(&source->pcrSelect, buffer, size); in TPMS_CREATION_DATA_Marshal()
1007 total_size += TPM2B_DIGEST_Marshal(&source->pcrDigest, buffer, size); in TPMS_CREATION_DATA_Marshal()
1008 total_size += TPMA_LOCALITY_Marshal(&source->locality, buffer, size); in TPMS_CREATION_DATA_Marshal()
1009 total_size += TPM_ALG_ID_Marshal(&source->parentNameAlg, buffer, size); in TPMS_CREATION_DATA_Marshal()
1010 total_size += TPM2B_NAME_Marshal(&source->parentName, buffer, size); in TPMS_CREATION_DATA_Marshal()
1011 total_size += TPM2B_NAME_Marshal(&source->parentQualifiedName, buffer, size); in TPMS_CREATION_DATA_Marshal()
1012 total_size += TPM2B_DATA_Marshal(&source->outsideInfo, buffer, size); in TPMS_CREATION_DATA_Marshal()
1016 TPM_RC TPMS_CREATION_DATA_Unmarshal(TPMS_CREATION_DATA* target, in TPMS_CREATION_DATA_Unmarshal() argument
1020 result = TPML_PCR_SELECTION_Unmarshal(&target->pcrSelect, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1024 result = TPM2B_DIGEST_Unmarshal(&target->pcrDigest, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1028 result = TPMA_LOCALITY_Unmarshal(&target->locality, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1032 result = TPM_ALG_ID_Unmarshal(&target->parentNameAlg, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1036 result = TPM2B_NAME_Unmarshal(&target->parentName, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1040 result = TPM2B_NAME_Unmarshal(&target->parentQualifiedName, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1044 result = TPM2B_DATA_Unmarshal(&target->outsideInfo, buffer, size); in TPMS_CREATION_DATA_Unmarshal()
1055 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_CREATION_DATA_Marshal()
1057 TPMS_CREATION_DATA_Marshal(&source->t.creationData, buffer, size); in TPM2B_CREATION_DATA_Marshal()
1059 BYTE* size_location = *buffer - total_size; in TPM2B_CREATION_DATA_Marshal()
1061 UINT16 payload_size = total_size - (UINT16)size_field_size; in TPM2B_CREATION_DATA_Marshal()
1067 TPM_RC TPM2B_CREATION_DATA_Unmarshal(TPM2B_CREATION_DATA* target, in TPM2B_CREATION_DATA_Unmarshal() argument
1073 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_CREATION_DATA_Unmarshal()
1077 if (target->t.size == 0) { in TPM2B_CREATION_DATA_Unmarshal()
1080 result = TPMS_CREATION_DATA_Unmarshal(&target->t.creationData, buffer, size); in TPM2B_CREATION_DATA_Unmarshal()
1084 struct_size = start_size - *size - sizeof(target->t.size); in TPM2B_CREATION_DATA_Unmarshal()
1085 if (struct_size != target->t.size) { in TPM2B_CREATION_DATA_Unmarshal()
1096 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_DIGEST_VALUES_Marshal()
1097 for (i = 0; i < source->t.size; ++i) { in TPM2B_DIGEST_VALUES_Marshal()
1098 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_DIGEST_VALUES_Marshal()
1103 TPM_RC TPM2B_DIGEST_VALUES_Unmarshal(TPM2B_DIGEST_VALUES* target, in TPM2B_DIGEST_VALUES_Unmarshal() argument
1108 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_DIGEST_VALUES_Unmarshal()
1112 if (target->t.size == 0) { in TPM2B_DIGEST_VALUES_Unmarshal()
1115 if (target->t.size > sizeof(TPML_DIGEST_VALUES)) { in TPM2B_DIGEST_VALUES_Unmarshal()
1118 for (i = 0; i < target->t.size; ++i) { in TPM2B_DIGEST_VALUES_Unmarshal()
1119 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_DIGEST_VALUES_Unmarshal()
1132 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_ECC_PARAMETER_Marshal()
1133 for (i = 0; i < source->t.size; ++i) { in TPM2B_ECC_PARAMETER_Marshal()
1134 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_ECC_PARAMETER_Marshal()
1139 TPM_RC TPM2B_ECC_PARAMETER_Unmarshal(TPM2B_ECC_PARAMETER* target, in TPM2B_ECC_PARAMETER_Unmarshal() argument
1144 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_ECC_PARAMETER_Unmarshal()
1148 if (target->t.size == 0) { in TPM2B_ECC_PARAMETER_Unmarshal()
1151 if (target->t.size > MAX_ECC_KEY_BYTES) { in TPM2B_ECC_PARAMETER_Unmarshal()
1154 for (i = 0; i < target->t.size; ++i) { in TPM2B_ECC_PARAMETER_Unmarshal()
1155 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_ECC_PARAMETER_Unmarshal()
1167 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->x, buffer, size); in TPMS_ECC_POINT_Marshal()
1168 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->y, buffer, size); in TPMS_ECC_POINT_Marshal()
1172 TPM_RC TPMS_ECC_POINT_Unmarshal(TPMS_ECC_POINT* target, in TPMS_ECC_POINT_Unmarshal() argument
1176 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->x, buffer, size); in TPMS_ECC_POINT_Unmarshal()
1180 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->y, buffer, size); in TPMS_ECC_POINT_Unmarshal()
1191 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_ECC_POINT_Marshal()
1192 total_size += TPMS_ECC_POINT_Marshal(&source->t.point, buffer, size); in TPM2B_ECC_POINT_Marshal()
1194 BYTE* size_location = *buffer - total_size; in TPM2B_ECC_POINT_Marshal()
1196 UINT16 payload_size = total_size - (UINT16)size_field_size; in TPM2B_ECC_POINT_Marshal()
1202 TPM_RC TPM2B_ECC_POINT_Unmarshal(TPM2B_ECC_POINT* target, in TPM2B_ECC_POINT_Unmarshal() argument
1208 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_ECC_POINT_Unmarshal()
1212 if (target->t.size == 0) { in TPM2B_ECC_POINT_Unmarshal()
1215 result = TPMS_ECC_POINT_Unmarshal(&target->t.point, buffer, size); in TPM2B_ECC_POINT_Unmarshal()
1219 struct_size = start_size - *size - sizeof(target->t.size); in TPM2B_ECC_POINT_Unmarshal()
1220 if (struct_size != target->t.size) { in TPM2B_ECC_POINT_Unmarshal()
1231 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_ENCRYPTED_SECRET_Marshal()
1232 for (i = 0; i < source->t.size; ++i) { in TPM2B_ENCRYPTED_SECRET_Marshal()
1233 total_size += BYTE_Marshal(&source->t.secret[i], buffer, size); in TPM2B_ENCRYPTED_SECRET_Marshal()
1238 TPM_RC TPM2B_ENCRYPTED_SECRET_Unmarshal(TPM2B_ENCRYPTED_SECRET* target, in TPM2B_ENCRYPTED_SECRET_Unmarshal() argument
1243 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_ENCRYPTED_SECRET_Unmarshal()
1247 if (target->t.size == 0) { in TPM2B_ENCRYPTED_SECRET_Unmarshal()
1250 if (target->t.size > sizeof(TPMU_ENCRYPTED_SECRET)) { in TPM2B_ENCRYPTED_SECRET_Unmarshal()
1253 for (i = 0; i < target->t.size; ++i) { in TPM2B_ENCRYPTED_SECRET_Unmarshal()
1254 result = BYTE_Unmarshal(&target->t.secret[i], buffer, size); in TPM2B_ENCRYPTED_SECRET_Unmarshal()
1265 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_EVENT_Marshal()
1266 for (i = 0; i < source->t.size; ++i) { in TPM2B_EVENT_Marshal()
1267 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_EVENT_Marshal()
1272 TPM_RC TPM2B_EVENT_Unmarshal(TPM2B_EVENT* target, BYTE** buffer, INT32* size) { in TPM2B_EVENT_Unmarshal() argument
1275 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_EVENT_Unmarshal()
1279 if (target->t.size == 0) { in TPM2B_EVENT_Unmarshal()
1282 if (target->t.size > 1024) { in TPM2B_EVENT_Unmarshal()
1285 for (i = 0; i < target->t.size; ++i) { in TPM2B_EVENT_Unmarshal()
1286 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_EVENT_Unmarshal()
1299 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_ID_OBJECT_Marshal()
1300 for (i = 0; i < source->t.size; ++i) { in TPM2B_ID_OBJECT_Marshal()
1301 total_size += BYTE_Marshal(&source->t.credential[i], buffer, size); in TPM2B_ID_OBJECT_Marshal()
1306 TPM_RC TPM2B_ID_OBJECT_Unmarshal(TPM2B_ID_OBJECT* target, in TPM2B_ID_OBJECT_Unmarshal() argument
1311 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_ID_OBJECT_Unmarshal()
1315 if (target->t.size == 0) { in TPM2B_ID_OBJECT_Unmarshal()
1318 if (target->t.size > sizeof(_ID_OBJECT)) { in TPM2B_ID_OBJECT_Unmarshal()
1321 for (i = 0; i < target->t.size; ++i) { in TPM2B_ID_OBJECT_Unmarshal()
1322 result = BYTE_Unmarshal(&target->t.credential[i], buffer, size); in TPM2B_ID_OBJECT_Unmarshal()
1333 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_IV_Marshal()
1334 for (i = 0; i < source->t.size; ++i) { in TPM2B_IV_Marshal()
1335 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_IV_Marshal()
1340 TPM_RC TPM2B_IV_Unmarshal(TPM2B_IV* target, BYTE** buffer, INT32* size) { in TPM2B_IV_Unmarshal() argument
1343 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_IV_Unmarshal()
1347 if (target->t.size == 0) { in TPM2B_IV_Unmarshal()
1350 if (target->t.size > MAX_SYM_BLOCK_SIZE) { in TPM2B_IV_Unmarshal()
1353 for (i = 0; i < target->t.size; ++i) { in TPM2B_IV_Unmarshal()
1354 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_IV_Unmarshal()
1367 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_MAX_BUFFER_Marshal()
1368 for (i = 0; i < source->t.size; ++i) { in TPM2B_MAX_BUFFER_Marshal()
1369 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_MAX_BUFFER_Marshal()
1374 TPM_RC TPM2B_MAX_BUFFER_Unmarshal(TPM2B_MAX_BUFFER* target, in TPM2B_MAX_BUFFER_Unmarshal() argument
1379 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_MAX_BUFFER_Unmarshal()
1383 if (target->t.size == 0) { in TPM2B_MAX_BUFFER_Unmarshal()
1386 if (target->t.size > MAX_DIGEST_BUFFER) { in TPM2B_MAX_BUFFER_Unmarshal()
1389 for (i = 0; i < target->t.size; ++i) { in TPM2B_MAX_BUFFER_Unmarshal()
1390 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_MAX_BUFFER_Unmarshal()
1403 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_MAX_NV_BUFFER_Marshal()
1404 for (i = 0; i < source->t.size; ++i) { in TPM2B_MAX_NV_BUFFER_Marshal()
1405 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_MAX_NV_BUFFER_Marshal()
1410 TPM_RC TPM2B_MAX_NV_BUFFER_Unmarshal(TPM2B_MAX_NV_BUFFER* target, in TPM2B_MAX_NV_BUFFER_Unmarshal() argument
1415 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_MAX_NV_BUFFER_Unmarshal()
1419 if (target->t.size == 0) { in TPM2B_MAX_NV_BUFFER_Unmarshal()
1422 if (target->t.size > MAX_NV_BUFFER_SIZE) { in TPM2B_MAX_NV_BUFFER_Unmarshal()
1425 for (i = 0; i < target->t.size; ++i) { in TPM2B_MAX_NV_BUFFER_Unmarshal()
1426 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_MAX_NV_BUFFER_Unmarshal()
1438 TPM_RC TPM2B_NONCE_Unmarshal(TPM2B_NONCE* target, BYTE** buffer, INT32* size) { in TPM2B_NONCE_Unmarshal() argument
1439 return TPM2B_DIGEST_Unmarshal(target, buffer, size); in TPM2B_NONCE_Unmarshal()
1448 TPM_RC TPMI_RH_NV_INDEX_Unmarshal(TPMI_RH_NV_INDEX* target, in TPMI_RH_NV_INDEX_Unmarshal() argument
1453 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_NV_INDEX_Unmarshal()
1457 if ((*target >= NV_INDEX_FIRST) && (*target <= NV_INDEX_LAST)) { in TPMI_RH_NV_INDEX_Unmarshal()
1470 TPM_RC TPMA_NV_Unmarshal(TPMA_NV* target, BYTE** buffer, INT32* size) { in TPMA_NV_Unmarshal() argument
1472 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_NV_Unmarshal()
1476 if (target->reserved7_9 != 0) { in TPMA_NV_Unmarshal()
1479 if (target->reserved20_24 != 0) { in TPMA_NV_Unmarshal()
1489 total_size += TPMI_RH_NV_INDEX_Marshal(&source->nvIndex, buffer, size); in TPMS_NV_PUBLIC_Marshal()
1490 total_size += TPMI_ALG_HASH_Marshal(&source->nameAlg, buffer, size); in TPMS_NV_PUBLIC_Marshal()
1491 total_size += TPMA_NV_Marshal(&source->attributes, buffer, size); in TPMS_NV_PUBLIC_Marshal()
1492 total_size += TPM2B_DIGEST_Marshal(&source->authPolicy, buffer, size); in TPMS_NV_PUBLIC_Marshal()
1493 total_size += UINT16_Marshal(&source->dataSize, buffer, size); in TPMS_NV_PUBLIC_Marshal()
1497 TPM_RC TPMS_NV_PUBLIC_Unmarshal(TPMS_NV_PUBLIC* target, in TPMS_NV_PUBLIC_Unmarshal() argument
1501 result = TPMI_RH_NV_INDEX_Unmarshal(&target->nvIndex, buffer, size); in TPMS_NV_PUBLIC_Unmarshal()
1505 result = TPMI_ALG_HASH_Unmarshal(&target->nameAlg, buffer, size, FALSE); in TPMS_NV_PUBLIC_Unmarshal()
1509 result = TPMA_NV_Unmarshal(&target->attributes, buffer, size); in TPMS_NV_PUBLIC_Unmarshal()
1513 result = TPM2B_DIGEST_Unmarshal(&target->authPolicy, buffer, size); in TPMS_NV_PUBLIC_Unmarshal()
1517 result = UINT16_Unmarshal(&target->dataSize, buffer, size); in TPMS_NV_PUBLIC_Unmarshal()
1521 if (target->dataSize > MAX_NV_INDEX_SIZE) { in TPMS_NV_PUBLIC_Unmarshal()
1531 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_NV_PUBLIC_Marshal()
1532 total_size += TPMS_NV_PUBLIC_Marshal(&source->t.nvPublic, buffer, size); in TPM2B_NV_PUBLIC_Marshal()
1534 BYTE* size_location = *buffer - total_size; in TPM2B_NV_PUBLIC_Marshal()
1536 UINT16 payload_size = total_size - (UINT16)size_field_size; in TPM2B_NV_PUBLIC_Marshal()
1542 TPM_RC TPM2B_NV_PUBLIC_Unmarshal(TPM2B_NV_PUBLIC* target, in TPM2B_NV_PUBLIC_Unmarshal() argument
1548 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_NV_PUBLIC_Unmarshal()
1552 if (target->t.size == 0) { in TPM2B_NV_PUBLIC_Unmarshal()
1555 result = TPMS_NV_PUBLIC_Unmarshal(&target->t.nvPublic, buffer, size); in TPM2B_NV_PUBLIC_Unmarshal()
1559 struct_size = start_size - *size - sizeof(target->t.size); in TPM2B_NV_PUBLIC_Unmarshal()
1560 if (struct_size != target->t.size) { in TPM2B_NV_PUBLIC_Unmarshal()
1572 TPM_RC TPM2B_OPERAND_Unmarshal(TPM2B_OPERAND* target, in TPM2B_OPERAND_Unmarshal() argument
1575 return TPM2B_DIGEST_Unmarshal(target, buffer, size); in TPM2B_OPERAND_Unmarshal()
1583 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_PRIVATE_Marshal()
1584 for (i = 0; i < source->t.size; ++i) { in TPM2B_PRIVATE_Marshal()
1585 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_PRIVATE_Marshal()
1590 TPM_RC TPM2B_PRIVATE_Unmarshal(TPM2B_PRIVATE* target, in TPM2B_PRIVATE_Unmarshal() argument
1595 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_PRIVATE_Unmarshal()
1599 if (target->t.size == 0) { in TPM2B_PRIVATE_Unmarshal()
1602 if (target->t.size > sizeof(_PRIVATE)) { in TPM2B_PRIVATE_Unmarshal()
1605 for (i = 0; i < target->t.size; ++i) { in TPM2B_PRIVATE_Unmarshal()
1606 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_PRIVATE_Unmarshal()
1619 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_PRIVATE_KEY_RSA_Marshal()
1620 for (i = 0; i < source->t.size; ++i) { in TPM2B_PRIVATE_KEY_RSA_Marshal()
1621 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_PRIVATE_KEY_RSA_Marshal()
1626 TPM_RC TPM2B_PRIVATE_KEY_RSA_Unmarshal(TPM2B_PRIVATE_KEY_RSA* target, in TPM2B_PRIVATE_KEY_RSA_Unmarshal() argument
1631 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_PRIVATE_KEY_RSA_Unmarshal()
1635 if (target->t.size == 0) { in TPM2B_PRIVATE_KEY_RSA_Unmarshal()
1638 if (target->t.size > MAX_RSA_KEY_BYTES / 2) { in TPM2B_PRIVATE_KEY_RSA_Unmarshal()
1641 for (i = 0; i < target->t.size; ++i) { in TPM2B_PRIVATE_KEY_RSA_Unmarshal()
1642 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_PRIVATE_KEY_RSA_Unmarshal()
1656 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_PRIVATE_VENDOR_SPECIFIC_Marshal()
1657 for (i = 0; i < source->t.size; ++i) { in TPM2B_PRIVATE_VENDOR_SPECIFIC_Marshal()
1658 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_PRIVATE_VENDOR_SPECIFIC_Marshal()
1664 TPM2B_PRIVATE_VENDOR_SPECIFIC* target, in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal() argument
1669 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal()
1673 if (target->t.size == 0) { in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal()
1676 if (target->t.size > PRIVATE_VENDOR_SPECIFIC_BYTES) { in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal()
1679 for (i = 0; i < target->t.size; ++i) { in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal()
1680 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_PRIVATE_VENDOR_SPECIFIC_Unmarshal()
1692 TPM_RC TPMA_OBJECT_Unmarshal(TPMA_OBJECT* target, BYTE** buffer, INT32* size) { in TPMA_OBJECT_Unmarshal() argument
1694 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_OBJECT_Unmarshal()
1698 if (target->reserved0 != 0) { in TPMA_OBJECT_Unmarshal()
1701 if (target->reserved3 != 0) { in TPMA_OBJECT_Unmarshal()
1704 if (target->reserved8_9 != 0) { in TPMA_OBJECT_Unmarshal()
1707 if (target->reserved12_15 != 0) { in TPMA_OBJECT_Unmarshal()
1710 if (target->reserved19_31 != 0) { in TPMA_OBJECT_Unmarshal()
1722 TPM_RC TPMI_ALG_PUBLIC_Unmarshal(TPMI_ALG_PUBLIC* target, in TPMI_ALG_PUBLIC_Unmarshal() argument
1727 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_PUBLIC_Unmarshal()
1731 switch (*target) { in TPMI_ALG_PUBLIC_Unmarshal()
1758 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_PUBLIC_KEY_RSA_Marshal()
1759 for (i = 0; i < source->t.size; ++i) { in TPM2B_PUBLIC_KEY_RSA_Marshal()
1760 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_PUBLIC_KEY_RSA_Marshal()
1765 TPM_RC TPM2B_PUBLIC_KEY_RSA_Unmarshal(TPM2B_PUBLIC_KEY_RSA* target, in TPM2B_PUBLIC_KEY_RSA_Unmarshal() argument
1770 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_PUBLIC_KEY_RSA_Unmarshal()
1774 if (target->t.size == 0) { in TPM2B_PUBLIC_KEY_RSA_Unmarshal()
1777 if (target->t.size > MAX_RSA_KEY_BYTES) { in TPM2B_PUBLIC_KEY_RSA_Unmarshal()
1780 for (i = 0; i < target->t.size; ++i) { in TPM2B_PUBLIC_KEY_RSA_Unmarshal()
1781 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_PUBLIC_KEY_RSA_Unmarshal()
1796 return TPM2B_DIGEST_Marshal((TPM2B_DIGEST*)&source->keyedHash, buffer, in TPMU_PUBLIC_ID_Marshal()
1801 return TPM2B_DIGEST_Marshal((TPM2B_DIGEST*)&source->sym, buffer, size); in TPMU_PUBLIC_ID_Marshal()
1805 return TPM2B_PUBLIC_KEY_RSA_Marshal((TPM2B_PUBLIC_KEY_RSA*)&source->rsa, in TPMU_PUBLIC_ID_Marshal()
1810 return TPMS_ECC_POINT_Marshal((TPMS_ECC_POINT*)&source->ecc, buffer, in TPMU_PUBLIC_ID_Marshal()
1817 TPM_RC TPMU_PUBLIC_ID_Unmarshal(TPMU_PUBLIC_ID* target, in TPMU_PUBLIC_ID_Unmarshal() argument
1824 return TPM2B_DIGEST_Unmarshal((TPM2B_DIGEST*)&target->keyedHash, buffer, in TPMU_PUBLIC_ID_Unmarshal()
1829 return TPM2B_DIGEST_Unmarshal((TPM2B_DIGEST*)&target->sym, buffer, size); in TPMU_PUBLIC_ID_Unmarshal()
1833 return TPM2B_PUBLIC_KEY_RSA_Unmarshal((TPM2B_PUBLIC_KEY_RSA*)&target->rsa, in TPMU_PUBLIC_ID_Unmarshal()
1838 return TPMS_ECC_POINT_Unmarshal((TPMS_ECC_POINT*)&target->ecc, buffer, in TPMU_PUBLIC_ID_Unmarshal()
1849 TPM_RC TPM_KEY_BITS_Unmarshal(TPM_KEY_BITS* target, in TPM_KEY_BITS_Unmarshal() argument
1852 return uint16_t_Unmarshal(target, buffer, size); in TPM_KEY_BITS_Unmarshal()
1861 TPM_RC TPMI_AES_KEY_BITS_Unmarshal(TPMI_AES_KEY_BITS* target, in TPMI_AES_KEY_BITS_Unmarshal() argument
1869 result = TPM_KEY_BITS_Unmarshal(target, buffer, size); in TPMI_AES_KEY_BITS_Unmarshal()
1874 if (*target == supported_values[i]) { in TPMI_AES_KEY_BITS_Unmarshal()
1891 TPM_RC TPMI_SM4_KEY_BITS_Unmarshal(TPMI_SM4_KEY_BITS* target, in TPMI_SM4_KEY_BITS_Unmarshal() argument
1899 result = TPM_KEY_BITS_Unmarshal(target, buffer, size); in TPMI_SM4_KEY_BITS_Unmarshal()
1904 if (*target == supported_values[i]) { in TPMI_SM4_KEY_BITS_Unmarshal()
1921 TPM_RC TPMI_CAMELLIA_KEY_BITS_Unmarshal(TPMI_CAMELLIA_KEY_BITS* target, in TPMI_CAMELLIA_KEY_BITS_Unmarshal() argument
1929 result = TPM_KEY_BITS_Unmarshal(target, buffer, size); in TPMI_CAMELLIA_KEY_BITS_Unmarshal()
1934 if (*target == supported_values[i]) { in TPMI_CAMELLIA_KEY_BITS_Unmarshal()
1952 return TPMI_AES_KEY_BITS_Marshal((TPMI_AES_KEY_BITS*)&source->aes, buffer, in TPMU_SYM_KEY_BITS_Marshal()
1957 return TPMI_SM4_KEY_BITS_Marshal((TPMI_SM4_KEY_BITS*)&source->sm4, buffer, in TPMU_SYM_KEY_BITS_Marshal()
1963 (TPMI_CAMELLIA_KEY_BITS*)&source->camellia, buffer, size); in TPMU_SYM_KEY_BITS_Marshal()
1967 return TPMI_ALG_HASH_Marshal((TPMI_ALG_HASH*)&source->xor_, buffer, size); in TPMU_SYM_KEY_BITS_Marshal()
1977 TPM_RC TPMU_SYM_KEY_BITS_Unmarshal(TPMU_SYM_KEY_BITS* target, in TPMU_SYM_KEY_BITS_Unmarshal() argument
1984 return TPMI_AES_KEY_BITS_Unmarshal((TPMI_AES_KEY_BITS*)&target->aes, in TPMU_SYM_KEY_BITS_Unmarshal()
1989 return TPMI_SM4_KEY_BITS_Unmarshal((TPMI_SM4_KEY_BITS*)&target->sm4, in TPMU_SYM_KEY_BITS_Unmarshal()
1995 (TPMI_CAMELLIA_KEY_BITS*)&target->camellia, buffer, size); in TPMU_SYM_KEY_BITS_Unmarshal()
1999 return TPMI_ALG_HASH_Unmarshal(&target->xor_, buffer, size, FALSE); in TPMU_SYM_KEY_BITS_Unmarshal()
2015 TPM_RC TPMI_ALG_SYM_MODE_Unmarshal(TPMI_ALG_SYM_MODE* target, in TPMI_ALG_SYM_MODE_Unmarshal() argument
2021 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_SYM_MODE_Unmarshal()
2025 if (*target == TPM_ALG_NULL) { in TPMI_ALG_SYM_MODE_Unmarshal()
2028 switch (*target) { in TPMI_ALG_SYM_MODE_Unmarshal()
2060 return TPMI_ALG_SYM_MODE_Marshal((TPMI_ALG_SYM_MODE*)&source->aes, buffer, in TPMU_SYM_MODE_Marshal()
2065 return TPMI_ALG_SYM_MODE_Marshal((TPMI_ALG_SYM_MODE*)&source->sm4, buffer, in TPMU_SYM_MODE_Marshal()
2070 return TPMI_ALG_SYM_MODE_Marshal((TPMI_ALG_SYM_MODE*)&source->camellia, in TPMU_SYM_MODE_Marshal()
2085 TPM_RC TPMU_SYM_MODE_Unmarshal(TPMU_SYM_MODE* target, in TPMU_SYM_MODE_Unmarshal() argument
2092 return TPMI_ALG_SYM_MODE_Unmarshal(&target->aes, buffer, size, FALSE); in TPMU_SYM_MODE_Unmarshal()
2096 return TPMI_ALG_SYM_MODE_Unmarshal(&target->sm4, buffer, size, FALSE); in TPMU_SYM_MODE_Unmarshal()
2100 return TPMI_ALG_SYM_MODE_Unmarshal(&target->camellia, buffer, size, in TPMU_SYM_MODE_Unmarshal()
2121 TPM_RC TPMI_ALG_SYM_OBJECT_Unmarshal(TPMI_ALG_SYM_OBJECT* target, in TPMI_ALG_SYM_OBJECT_Unmarshal() argument
2127 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_SYM_OBJECT_Unmarshal()
2131 if (*target == TPM_ALG_NULL) { in TPMI_ALG_SYM_OBJECT_Unmarshal()
2134 switch (*target) { in TPMI_ALG_SYM_OBJECT_Unmarshal()
2157 total_size += TPMI_ALG_SYM_OBJECT_Marshal(&source->algorithm, buffer, size); in TPMT_SYM_DEF_OBJECT_Marshal()
2158 total_size += TPMU_SYM_KEY_BITS_Marshal(&source->keyBits, buffer, size, in TPMT_SYM_DEF_OBJECT_Marshal()
2159 source->algorithm); in TPMT_SYM_DEF_OBJECT_Marshal()
2161 TPMU_SYM_MODE_Marshal(&source->mode, buffer, size, source->algorithm); in TPMT_SYM_DEF_OBJECT_Marshal()
2165 TPM_RC TPMT_SYM_DEF_OBJECT_Unmarshal(TPMT_SYM_DEF_OBJECT* target, in TPMT_SYM_DEF_OBJECT_Unmarshal() argument
2170 TPMI_ALG_SYM_OBJECT_Unmarshal(&target->algorithm, buffer, size, TRUE); in TPMT_SYM_DEF_OBJECT_Unmarshal()
2174 result = TPMU_SYM_KEY_BITS_Unmarshal(&target->keyBits, buffer, size, in TPMT_SYM_DEF_OBJECT_Unmarshal()
2175 target->algorithm); in TPMT_SYM_DEF_OBJECT_Unmarshal()
2180 TPMU_SYM_MODE_Unmarshal(&target->mode, buffer, size, target->algorithm); in TPMT_SYM_DEF_OBJECT_Unmarshal()
2193 TPM_RC TPMI_ALG_RSA_SCHEME_Unmarshal(TPMI_ALG_RSA_SCHEME* target, in TPMI_ALG_RSA_SCHEME_Unmarshal() argument
2199 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_RSA_SCHEME_Unmarshal()
2203 if (*target == TPM_ALG_NULL) { in TPMI_ALG_RSA_SCHEME_Unmarshal()
2206 switch (*target) { in TPMI_ALG_RSA_SCHEME_Unmarshal()
2232 total_size += TPMI_ALG_HASH_Marshal(&source->hashAlg, buffer, size); in TPMS_SCHEME_HASH_Marshal()
2236 TPM_RC TPMS_SCHEME_HASH_Unmarshal(TPMS_SCHEME_HASH* target, in TPMS_SCHEME_HASH_Unmarshal() argument
2240 result = TPMI_ALG_HASH_Unmarshal(&target->hashAlg, buffer, size, FALSE); in TPMS_SCHEME_HASH_Unmarshal()
2253 TPM_RC TPMS_SIG_SCHEME_RSAPSS_Unmarshal(TPMS_SIG_SCHEME_RSAPSS* target, in TPMS_SIG_SCHEME_RSAPSS_Unmarshal() argument
2256 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_RSAPSS_Unmarshal()
2265 TPM_RC TPMS_SIG_SCHEME_SM2_Unmarshal(TPMS_SIG_SCHEME_SM2* target, in TPMS_SIG_SCHEME_SM2_Unmarshal() argument
2268 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_SM2_Unmarshal()
2277 TPM_RC TPMS_SIG_SCHEME_ECSCHNORR_Unmarshal(TPMS_SIG_SCHEME_ECSCHNORR* target, in TPMS_SIG_SCHEME_ECSCHNORR_Unmarshal() argument
2280 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_ECSCHNORR_Unmarshal()
2287 total_size += TPMI_ALG_HASH_Marshal(&source->hashAlg, buffer, size); in TPMS_SCHEME_ECDAA_Marshal()
2288 total_size += UINT16_Marshal(&source->count, buffer, size); in TPMS_SCHEME_ECDAA_Marshal()
2292 TPM_RC TPMS_SCHEME_ECDAA_Unmarshal(TPMS_SCHEME_ECDAA* target, in TPMS_SCHEME_ECDAA_Unmarshal() argument
2296 result = TPMI_ALG_HASH_Unmarshal(&target->hashAlg, buffer, size, FALSE); in TPMS_SCHEME_ECDAA_Unmarshal()
2300 result = UINT16_Unmarshal(&target->count, buffer, size); in TPMS_SCHEME_ECDAA_Unmarshal()
2313 TPM_RC TPMS_SIG_SCHEME_ECDAA_Unmarshal(TPMS_SIG_SCHEME_ECDAA* target, in TPMS_SIG_SCHEME_ECDAA_Unmarshal() argument
2316 return TPMS_SCHEME_ECDAA_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_ECDAA_Unmarshal()
2325 TPM_RC TPMS_KEY_SCHEME_ECDH_Unmarshal(TPMS_KEY_SCHEME_ECDH* target, in TPMS_KEY_SCHEME_ECDH_Unmarshal() argument
2328 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_KEY_SCHEME_ECDH_Unmarshal()
2337 TPM_RC TPMS_KEY_SCHEME_ECMQV_Unmarshal(TPMS_KEY_SCHEME_ECMQV* target, in TPMS_KEY_SCHEME_ECMQV_Unmarshal() argument
2340 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_KEY_SCHEME_ECMQV_Unmarshal()
2349 TPM_RC TPMS_SIG_SCHEME_RSASSA_Unmarshal(TPMS_SIG_SCHEME_RSASSA* target, in TPMS_SIG_SCHEME_RSASSA_Unmarshal() argument
2353 return TPMI_ALG_HASH_Unmarshal(&target->hashAlg, buffer, size, TRUE); in TPMS_SIG_SCHEME_RSASSA_Unmarshal()
2355 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_RSASSA_Unmarshal()
2365 TPM_RC TPMS_ENC_SCHEME_OAEP_Unmarshal(TPMS_ENC_SCHEME_OAEP* target, in TPMS_ENC_SCHEME_OAEP_Unmarshal() argument
2368 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_ENC_SCHEME_OAEP_Unmarshal()
2376 TPM_RC TPMS_EMPTY_Unmarshal(TPMS_EMPTY* target, BYTE** buffer, INT32* size) { in TPMS_EMPTY_Unmarshal() argument
2389 TPM_RC TPMS_ENC_SCHEME_RSAES_Unmarshal(TPMS_ENC_SCHEME_RSAES* target, in TPMS_ENC_SCHEME_RSAES_Unmarshal() argument
2392 return TPMS_EMPTY_Unmarshal(target, buffer, size); in TPMS_ENC_SCHEME_RSAES_Unmarshal()
2401 TPM_RC TPMS_SIG_SCHEME_ECDSA_Unmarshal(TPMS_SIG_SCHEME_ECDSA* target, in TPMS_SIG_SCHEME_ECDSA_Unmarshal() argument
2404 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SIG_SCHEME_ECDSA_Unmarshal()
2414 return TPMS_KEY_SCHEME_ECDH_Marshal((TPMS_KEY_SCHEME_ECDH*)&source->ecdh, in TPMU_ASYM_SCHEME_Marshal()
2420 (TPMS_KEY_SCHEME_ECMQV*)&source->ecmqv, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2425 (TPMS_SIG_SCHEME_RSASSA*)&source->rsassa, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2430 (TPMS_SIG_SCHEME_RSAPSS*)&source->rsapss, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2435 (TPMS_SIG_SCHEME_ECDSA*)&source->ecdsa, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2440 (TPMS_SIG_SCHEME_ECDAA*)&source->ecdaa, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2444 return TPMS_SIG_SCHEME_SM2_Marshal((TPMS_SIG_SCHEME_SM2*)&source->sm2, in TPMU_ASYM_SCHEME_Marshal()
2450 (TPMS_SIG_SCHEME_ECSCHNORR*)&source->ecschnorr, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2455 (TPMS_ENC_SCHEME_RSAES*)&source->rsaes, buffer, size); in TPMU_ASYM_SCHEME_Marshal()
2459 return TPMS_ENC_SCHEME_OAEP_Marshal((TPMS_ENC_SCHEME_OAEP*)&source->oaep, in TPMU_ASYM_SCHEME_Marshal()
2470 TPM_RC TPMU_ASYM_SCHEME_Unmarshal(TPMU_ASYM_SCHEME* target, in TPMU_ASYM_SCHEME_Unmarshal() argument
2478 (TPMS_KEY_SCHEME_ECDH*)&target->ecdh, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2483 (TPMS_KEY_SCHEME_ECMQV*)&target->ecmqv, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2488 (TPMS_SIG_SCHEME_RSASSA*)&target->rsassa, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2493 (TPMS_SIG_SCHEME_RSAPSS*)&target->rsapss, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2498 (TPMS_SIG_SCHEME_ECDSA*)&target->ecdsa, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2503 (TPMS_SIG_SCHEME_ECDAA*)&target->ecdaa, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2507 return TPMS_SIG_SCHEME_SM2_Unmarshal((TPMS_SIG_SCHEME_SM2*)&target->sm2, in TPMU_ASYM_SCHEME_Unmarshal()
2513 (TPMS_SIG_SCHEME_ECSCHNORR*)&target->ecschnorr, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2518 (TPMS_ENC_SCHEME_RSAES*)&target->rsaes, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2523 (TPMS_ENC_SCHEME_OAEP*)&target->oaep, buffer, size); in TPMU_ASYM_SCHEME_Unmarshal()
2537 total_size += TPMI_ALG_RSA_SCHEME_Marshal(&source->scheme, buffer, size); in TPMT_RSA_SCHEME_Marshal()
2539 TPMU_ASYM_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_RSA_SCHEME_Marshal()
2543 TPM_RC TPMT_RSA_SCHEME_Unmarshal(TPMT_RSA_SCHEME* target, in TPMT_RSA_SCHEME_Unmarshal() argument
2547 result = TPMI_ALG_RSA_SCHEME_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_RSA_SCHEME_Unmarshal()
2551 result = TPMU_ASYM_SCHEME_Unmarshal(&target->details, buffer, size, in TPMT_RSA_SCHEME_Unmarshal()
2552 target->scheme); in TPMT_RSA_SCHEME_Unmarshal()
2565 TPM_RC TPMI_RSA_KEY_BITS_Unmarshal(TPMI_RSA_KEY_BITS* target, in TPMI_RSA_KEY_BITS_Unmarshal() argument
2573 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_RSA_KEY_BITS_Unmarshal()
2578 if (*target == supported_values[i]) { in TPMI_RSA_KEY_BITS_Unmarshal()
2593 total_size += TPMT_SYM_DEF_OBJECT_Marshal(&source->symmetric, buffer, size); in TPMS_RSA_PARMS_Marshal()
2594 total_size += TPMT_RSA_SCHEME_Marshal(&source->scheme, buffer, size); in TPMS_RSA_PARMS_Marshal()
2595 total_size += TPMI_RSA_KEY_BITS_Marshal(&source->keyBits, buffer, size); in TPMS_RSA_PARMS_Marshal()
2596 total_size += UINT32_Marshal(&source->exponent, buffer, size); in TPMS_RSA_PARMS_Marshal()
2600 TPM_RC TPMS_RSA_PARMS_Unmarshal(TPMS_RSA_PARMS* target, in TPMS_RSA_PARMS_Unmarshal() argument
2604 result = TPMT_SYM_DEF_OBJECT_Unmarshal(&target->symmetric, buffer, size); in TPMS_RSA_PARMS_Unmarshal()
2608 result = TPMT_RSA_SCHEME_Unmarshal(&target->scheme, buffer, size); in TPMS_RSA_PARMS_Unmarshal()
2612 result = TPMI_RSA_KEY_BITS_Unmarshal(&target->keyBits, buffer, size); in TPMS_RSA_PARMS_Unmarshal()
2616 result = UINT32_Unmarshal(&target->exponent, buffer, size); in TPMS_RSA_PARMS_Unmarshal()
2627 total_size += TPMT_SYM_DEF_OBJECT_Marshal(&source->sym, buffer, size); in TPMS_SYMCIPHER_PARMS_Marshal()
2631 TPM_RC TPMS_SYMCIPHER_PARMS_Unmarshal(TPMS_SYMCIPHER_PARMS* target, in TPMS_SYMCIPHER_PARMS_Unmarshal() argument
2635 result = TPMT_SYM_DEF_OBJECT_Unmarshal(&target->sym, buffer, size); in TPMS_SYMCIPHER_PARMS_Unmarshal()
2648 TPM_RC TPMI_ALG_ASYM_SCHEME_Unmarshal(TPMI_ALG_ASYM_SCHEME* target, in TPMI_ALG_ASYM_SCHEME_Unmarshal() argument
2654 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_ASYM_SCHEME_Unmarshal()
2658 if (*target == TPM_ALG_NULL) { in TPMI_ALG_ASYM_SCHEME_Unmarshal()
2661 switch (*target) { in TPMI_ALG_ASYM_SCHEME_Unmarshal()
2705 total_size += TPMI_ALG_ASYM_SCHEME_Marshal(&source->scheme, buffer, size); in TPMT_ASYM_SCHEME_Marshal()
2707 TPMU_ASYM_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_ASYM_SCHEME_Marshal()
2711 TPM_RC TPMT_ASYM_SCHEME_Unmarshal(TPMT_ASYM_SCHEME* target, in TPMT_ASYM_SCHEME_Unmarshal() argument
2715 result = TPMI_ALG_ASYM_SCHEME_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_ASYM_SCHEME_Unmarshal()
2719 result = TPMU_ASYM_SCHEME_Unmarshal(&target->details, buffer, size, in TPMT_ASYM_SCHEME_Unmarshal()
2720 target->scheme); in TPMT_ASYM_SCHEME_Unmarshal()
2731 total_size += TPMT_SYM_DEF_OBJECT_Marshal(&source->symmetric, buffer, size); in TPMS_ASYM_PARMS_Marshal()
2732 total_size += TPMT_ASYM_SCHEME_Marshal(&source->scheme, buffer, size); in TPMS_ASYM_PARMS_Marshal()
2736 TPM_RC TPMS_ASYM_PARMS_Unmarshal(TPMS_ASYM_PARMS* target, in TPMS_ASYM_PARMS_Unmarshal() argument
2740 result = TPMT_SYM_DEF_OBJECT_Unmarshal(&target->symmetric, buffer, size); in TPMS_ASYM_PARMS_Unmarshal()
2744 result = TPMT_ASYM_SCHEME_Unmarshal(&target->scheme, buffer, size); in TPMS_ASYM_PARMS_Unmarshal()
2755 TPM_RC TPMI_ALG_KDF_Unmarshal(TPMI_ALG_KDF* target, in TPMI_ALG_KDF_Unmarshal() argument
2761 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_KDF_Unmarshal()
2765 if (*target == TPM_ALG_NULL) { in TPMI_ALG_KDF_Unmarshal()
2768 switch (*target) { in TPMI_ALG_KDF_Unmarshal()
2796 TPM_RC TPMS_SCHEME_KDF1_SP800_108_Unmarshal(TPMS_SCHEME_KDF1_SP800_108* target, in TPMS_SCHEME_KDF1_SP800_108_Unmarshal() argument
2799 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SCHEME_KDF1_SP800_108_Unmarshal()
2808 TPM_RC TPMS_SCHEME_KDF2_Unmarshal(TPMS_SCHEME_KDF2* target, in TPMS_SCHEME_KDF2_Unmarshal() argument
2811 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SCHEME_KDF2_Unmarshal()
2820 TPM_RC TPMS_SCHEME_KDF1_SP800_56A_Unmarshal(TPMS_SCHEME_KDF1_SP800_56A* target, in TPMS_SCHEME_KDF1_SP800_56A_Unmarshal() argument
2823 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SCHEME_KDF1_SP800_56A_Unmarshal()
2832 TPM_RC TPMS_SCHEME_MGF1_Unmarshal(TPMS_SCHEME_MGF1* target, in TPMS_SCHEME_MGF1_Unmarshal() argument
2835 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SCHEME_MGF1_Unmarshal()
2845 return TPMS_SCHEME_MGF1_Marshal((TPMS_SCHEME_MGF1*)&source->mgf1, buffer, in TPMU_KDF_SCHEME_Marshal()
2851 (TPMS_SCHEME_KDF1_SP800_56A*)&source->kdf1_sp800_56a, buffer, size); in TPMU_KDF_SCHEME_Marshal()
2855 return TPMS_SCHEME_KDF2_Marshal((TPMS_SCHEME_KDF2*)&source->kdf2, buffer, in TPMU_KDF_SCHEME_Marshal()
2861 (TPMS_SCHEME_KDF1_SP800_108*)&source->kdf1_sp800_108, buffer, size); in TPMU_KDF_SCHEME_Marshal()
2871 TPM_RC TPMU_KDF_SCHEME_Unmarshal(TPMU_KDF_SCHEME* target, in TPMU_KDF_SCHEME_Unmarshal() argument
2878 return TPMS_SCHEME_MGF1_Unmarshal((TPMS_SCHEME_MGF1*)&target->mgf1, in TPMU_KDF_SCHEME_Unmarshal()
2884 (TPMS_SCHEME_KDF1_SP800_56A*)&target->kdf1_sp800_56a, buffer, size); in TPMU_KDF_SCHEME_Unmarshal()
2888 return TPMS_SCHEME_KDF2_Unmarshal((TPMS_SCHEME_KDF2*)&target->kdf2, in TPMU_KDF_SCHEME_Unmarshal()
2894 (TPMS_SCHEME_KDF1_SP800_108*)&target->kdf1_sp800_108, buffer, size); in TPMU_KDF_SCHEME_Unmarshal()
2908 total_size += TPMI_ALG_KDF_Marshal(&source->scheme, buffer, size); in TPMT_KDF_SCHEME_Marshal()
2910 TPMU_KDF_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_KDF_SCHEME_Marshal()
2914 TPM_RC TPMT_KDF_SCHEME_Unmarshal(TPMT_KDF_SCHEME* target, in TPMT_KDF_SCHEME_Unmarshal() argument
2918 result = TPMI_ALG_KDF_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_KDF_SCHEME_Unmarshal()
2923 TPMU_KDF_SCHEME_Unmarshal(&target->details, buffer, size, target->scheme); in TPMT_KDF_SCHEME_Unmarshal()
2936 TPM_RC TPMI_ALG_ECC_SCHEME_Unmarshal(TPMI_ALG_ECC_SCHEME* target, in TPMI_ALG_ECC_SCHEME_Unmarshal() argument
2942 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_ECC_SCHEME_Unmarshal()
2946 if (*target == TPM_ALG_NULL) { in TPMI_ALG_ECC_SCHEME_Unmarshal()
2949 switch (*target) { in TPMI_ALG_ECC_SCHEME_Unmarshal()
2981 total_size += TPMI_ALG_ECC_SCHEME_Marshal(&source->scheme, buffer, size); in TPMT_ECC_SCHEME_Marshal()
2983 TPMU_ASYM_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_ECC_SCHEME_Marshal()
2987 TPM_RC TPMT_ECC_SCHEME_Unmarshal(TPMT_ECC_SCHEME* target, in TPMT_ECC_SCHEME_Unmarshal() argument
2991 result = TPMI_ALG_ECC_SCHEME_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_ECC_SCHEME_Unmarshal()
2995 result = TPMU_ASYM_SCHEME_Unmarshal(&target->details, buffer, size, in TPMT_ECC_SCHEME_Unmarshal()
2996 target->scheme); in TPMT_ECC_SCHEME_Unmarshal()
3009 TPM_RC TPMI_ECC_CURVE_Unmarshal(TPMI_ECC_CURVE* target, in TPMI_ECC_CURVE_Unmarshal() argument
3017 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ECC_CURVE_Unmarshal()
3022 if (*target == supported_values[i]) { in TPMI_ECC_CURVE_Unmarshal()
3037 total_size += TPMT_SYM_DEF_OBJECT_Marshal(&source->symmetric, buffer, size); in TPMS_ECC_PARMS_Marshal()
3038 total_size += TPMT_ECC_SCHEME_Marshal(&source->scheme, buffer, size); in TPMS_ECC_PARMS_Marshal()
3039 total_size += TPMI_ECC_CURVE_Marshal(&source->curveID, buffer, size); in TPMS_ECC_PARMS_Marshal()
3040 total_size += TPMT_KDF_SCHEME_Marshal(&source->kdf, buffer, size); in TPMS_ECC_PARMS_Marshal()
3044 TPM_RC TPMS_ECC_PARMS_Unmarshal(TPMS_ECC_PARMS* target, in TPMS_ECC_PARMS_Unmarshal() argument
3048 result = TPMT_SYM_DEF_OBJECT_Unmarshal(&target->symmetric, buffer, size); in TPMS_ECC_PARMS_Unmarshal()
3052 result = TPMT_ECC_SCHEME_Unmarshal(&target->scheme, buffer, size); in TPMS_ECC_PARMS_Unmarshal()
3056 result = TPMI_ECC_CURVE_Unmarshal(&target->curveID, buffer, size); in TPMS_ECC_PARMS_Unmarshal()
3060 result = TPMT_KDF_SCHEME_Unmarshal(&target->kdf, buffer, size); in TPMS_ECC_PARMS_Unmarshal()
3073 TPM_RC TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal(TPMI_ALG_KEYEDHASH_SCHEME* target, in TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal() argument
3079 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal()
3083 if (*target == TPM_ALG_NULL) { in TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal()
3086 switch (*target) { in TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal()
3108 TPM_RC TPMS_SCHEME_HMAC_Unmarshal(TPMS_SCHEME_HMAC* target, in TPMS_SCHEME_HMAC_Unmarshal() argument
3111 return TPMS_SCHEME_HASH_Unmarshal(target, buffer, size); in TPMS_SCHEME_HMAC_Unmarshal()
3118 total_size += TPMI_ALG_HASH_Marshal(&source->hashAlg, buffer, size); in TPMS_SCHEME_XOR_Marshal()
3119 total_size += TPMI_ALG_KDF_Marshal(&source->kdf, buffer, size); in TPMS_SCHEME_XOR_Marshal()
3123 TPM_RC TPMS_SCHEME_XOR_Unmarshal(TPMS_SCHEME_XOR* target, in TPMS_SCHEME_XOR_Unmarshal() argument
3127 result = TPMI_ALG_HASH_Unmarshal(&target->hashAlg, buffer, size, TRUE); in TPMS_SCHEME_XOR_Unmarshal()
3131 result = TPMI_ALG_KDF_Unmarshal(&target->kdf, buffer, size, FALSE); in TPMS_SCHEME_XOR_Unmarshal()
3145 return TPMS_SCHEME_HMAC_Marshal((TPMS_SCHEME_HMAC*)&source->hmac, buffer, in TPMU_SCHEME_KEYEDHASH_Marshal()
3150 return TPMS_SCHEME_XOR_Marshal((TPMS_SCHEME_XOR*)&source->xor_, buffer, in TPMU_SCHEME_KEYEDHASH_Marshal()
3161 TPM_RC TPMU_SCHEME_KEYEDHASH_Unmarshal(TPMU_SCHEME_KEYEDHASH* target, in TPMU_SCHEME_KEYEDHASH_Unmarshal() argument
3168 return TPMS_SCHEME_HMAC_Unmarshal((TPMS_SCHEME_HMAC*)&target->hmac, in TPMU_SCHEME_KEYEDHASH_Unmarshal()
3173 return TPMS_SCHEME_XOR_Unmarshal((TPMS_SCHEME_XOR*)&target->xor_, buffer, in TPMU_SCHEME_KEYEDHASH_Unmarshal()
3189 TPMI_ALG_KEYEDHASH_SCHEME_Marshal(&source->scheme, buffer, size); in TPMT_KEYEDHASH_SCHEME_Marshal()
3190 total_size += TPMU_SCHEME_KEYEDHASH_Marshal(&source->details, buffer, size, in TPMT_KEYEDHASH_SCHEME_Marshal()
3191 source->scheme); in TPMT_KEYEDHASH_SCHEME_Marshal()
3195 TPM_RC TPMT_KEYEDHASH_SCHEME_Unmarshal(TPMT_KEYEDHASH_SCHEME* target, in TPMT_KEYEDHASH_SCHEME_Unmarshal() argument
3200 TPMI_ALG_KEYEDHASH_SCHEME_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_KEYEDHASH_SCHEME_Unmarshal()
3204 result = TPMU_SCHEME_KEYEDHASH_Unmarshal(&target->details, buffer, size, in TPMT_KEYEDHASH_SCHEME_Unmarshal()
3205 target->scheme); in TPMT_KEYEDHASH_SCHEME_Unmarshal()
3216 total_size += TPMT_KEYEDHASH_SCHEME_Marshal(&source->scheme, buffer, size); in TPMS_KEYEDHASH_PARMS_Marshal()
3220 TPM_RC TPMS_KEYEDHASH_PARMS_Unmarshal(TPMS_KEYEDHASH_PARMS* target, in TPMS_KEYEDHASH_PARMS_Unmarshal() argument
3224 result = TPMT_KEYEDHASH_SCHEME_Unmarshal(&target->scheme, buffer, size); in TPMS_KEYEDHASH_PARMS_Unmarshal()
3239 (TPMS_KEYEDHASH_PARMS*)&source->keyedHashDetail, buffer, size); in TPMU_PUBLIC_PARMS_Marshal()
3244 (TPMS_SYMCIPHER_PARMS*)&source->symDetail, buffer, size); in TPMU_PUBLIC_PARMS_Marshal()
3248 return TPMS_RSA_PARMS_Marshal((TPMS_RSA_PARMS*)&source->rsaDetail, buffer, in TPMU_PUBLIC_PARMS_Marshal()
3253 return TPMS_ECC_PARMS_Marshal((TPMS_ECC_PARMS*)&source->eccDetail, buffer, in TPMU_PUBLIC_PARMS_Marshal()
3260 TPM_RC TPMU_PUBLIC_PARMS_Unmarshal(TPMU_PUBLIC_PARMS* target, in TPMU_PUBLIC_PARMS_Unmarshal() argument
3268 (TPMS_KEYEDHASH_PARMS*)&target->keyedHashDetail, buffer, size); in TPMU_PUBLIC_PARMS_Unmarshal()
3273 (TPMS_SYMCIPHER_PARMS*)&target->symDetail, buffer, size); in TPMU_PUBLIC_PARMS_Unmarshal()
3277 return TPMS_RSA_PARMS_Unmarshal((TPMS_RSA_PARMS*)&target->rsaDetail, in TPMU_PUBLIC_PARMS_Unmarshal()
3282 return TPMS_ECC_PARMS_Unmarshal((TPMS_ECC_PARMS*)&target->eccDetail, in TPMU_PUBLIC_PARMS_Unmarshal()
3291 total_size += TPMI_ALG_PUBLIC_Marshal(&source->type, buffer, size); in TPMT_PUBLIC_Marshal()
3292 total_size += TPMI_ALG_HASH_Marshal(&source->nameAlg, buffer, size); in TPMT_PUBLIC_Marshal()
3293 total_size += TPMA_OBJECT_Marshal(&source->objectAttributes, buffer, size); in TPMT_PUBLIC_Marshal()
3294 total_size += TPM2B_DIGEST_Marshal(&source->authPolicy, buffer, size); in TPMT_PUBLIC_Marshal()
3295 total_size += TPMU_PUBLIC_PARMS_Marshal(&source->parameters, buffer, size, in TPMT_PUBLIC_Marshal()
3296 source->type); in TPMT_PUBLIC_Marshal()
3298 TPMU_PUBLIC_ID_Marshal(&source->unique, buffer, size, source->type); in TPMT_PUBLIC_Marshal()
3302 TPM_RC TPMT_PUBLIC_Unmarshal(TPMT_PUBLIC* target, BYTE** buffer, INT32* size) { in TPMT_PUBLIC_Unmarshal() argument
3304 result = TPMI_ALG_PUBLIC_Unmarshal(&target->type, buffer, size); in TPMT_PUBLIC_Unmarshal()
3308 result = TPMI_ALG_HASH_Unmarshal(&target->nameAlg, buffer, size, TRUE); in TPMT_PUBLIC_Unmarshal()
3312 result = TPMA_OBJECT_Unmarshal(&target->objectAttributes, buffer, size); in TPMT_PUBLIC_Unmarshal()
3316 result = TPM2B_DIGEST_Unmarshal(&target->authPolicy, buffer, size); in TPMT_PUBLIC_Unmarshal()
3320 result = TPMU_PUBLIC_PARMS_Unmarshal(&target->parameters, buffer, size, in TPMT_PUBLIC_Unmarshal()
3321 target->type); in TPMT_PUBLIC_Unmarshal()
3326 TPMU_PUBLIC_ID_Unmarshal(&target->unique, buffer, size, target->type); in TPMT_PUBLIC_Unmarshal()
3335 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_PUBLIC_Marshal()
3336 total_size += TPMT_PUBLIC_Marshal(&source->t.publicArea, buffer, size); in TPM2B_PUBLIC_Marshal()
3338 BYTE* size_location = *buffer - total_size; in TPM2B_PUBLIC_Marshal()
3340 UINT16 payload_size = total_size - (UINT16)size_field_size; in TPM2B_PUBLIC_Marshal()
3346 TPM_RC TPM2B_PUBLIC_Unmarshal(TPM2B_PUBLIC* target, in TPM2B_PUBLIC_Unmarshal() argument
3352 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_PUBLIC_Unmarshal()
3356 if (target->t.size == 0) { in TPM2B_PUBLIC_Unmarshal()
3359 result = TPMT_PUBLIC_Unmarshal(&target->t.publicArea, buffer, size); in TPM2B_PUBLIC_Unmarshal()
3363 struct_size = start_size - *size - sizeof(target->t.size); in TPM2B_PUBLIC_Unmarshal()
3364 if (struct_size != target->t.size) { in TPM2B_PUBLIC_Unmarshal()
3375 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_SENSITIVE_DATA_Marshal()
3376 for (i = 0; i < source->t.size; ++i) { in TPM2B_SENSITIVE_DATA_Marshal()
3377 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_SENSITIVE_DATA_Marshal()
3382 TPM_RC TPM2B_SENSITIVE_DATA_Unmarshal(TPM2B_SENSITIVE_DATA* target, in TPM2B_SENSITIVE_DATA_Unmarshal() argument
3387 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_SENSITIVE_DATA_Unmarshal()
3391 if (target->t.size == 0) { in TPM2B_SENSITIVE_DATA_Unmarshal()
3394 if (target->t.size > MAX_SYM_DATA) { in TPM2B_SENSITIVE_DATA_Unmarshal()
3397 for (i = 0; i < target->t.size; ++i) { in TPM2B_SENSITIVE_DATA_Unmarshal()
3398 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_SENSITIVE_DATA_Unmarshal()
3411 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_SYM_KEY_Marshal()
3412 for (i = 0; i < source->t.size; ++i) { in TPM2B_SYM_KEY_Marshal()
3413 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_SYM_KEY_Marshal()
3418 TPM_RC TPM2B_SYM_KEY_Unmarshal(TPM2B_SYM_KEY* target, in TPM2B_SYM_KEY_Unmarshal() argument
3423 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_SYM_KEY_Unmarshal()
3427 if (target->t.size == 0) { in TPM2B_SYM_KEY_Unmarshal()
3430 if (target->t.size > MAX_SYM_KEY_BYTES) { in TPM2B_SYM_KEY_Unmarshal()
3433 for (i = 0; i < target->t.size; ++i) { in TPM2B_SYM_KEY_Unmarshal()
3434 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_SYM_KEY_Unmarshal()
3449 return TPM2B_PRIVATE_KEY_RSA_Marshal((TPM2B_PRIVATE_KEY_RSA*)&source->rsa, in TPMU_SENSITIVE_COMPOSITE_Marshal()
3454 return TPM2B_ECC_PARAMETER_Marshal((TPM2B_ECC_PARAMETER*)&source->ecc, in TPMU_SENSITIVE_COMPOSITE_Marshal()
3459 return TPM2B_SENSITIVE_DATA_Marshal((TPM2B_SENSITIVE_DATA*)&source->bits, in TPMU_SENSITIVE_COMPOSITE_Marshal()
3464 return TPM2B_SYM_KEY_Marshal((TPM2B_SYM_KEY*)&source->sym, buffer, size); in TPMU_SENSITIVE_COMPOSITE_Marshal()
3470 TPM_RC TPMU_SENSITIVE_COMPOSITE_Unmarshal(TPMU_SENSITIVE_COMPOSITE* target, in TPMU_SENSITIVE_COMPOSITE_Unmarshal() argument
3478 (TPM2B_PRIVATE_KEY_RSA*)&target->rsa, buffer, size); in TPMU_SENSITIVE_COMPOSITE_Unmarshal()
3482 return TPM2B_ECC_PARAMETER_Unmarshal((TPM2B_ECC_PARAMETER*)&target->ecc, in TPMU_SENSITIVE_COMPOSITE_Unmarshal()
3488 (TPM2B_SENSITIVE_DATA*)&target->bits, buffer, size); in TPMU_SENSITIVE_COMPOSITE_Unmarshal()
3492 return TPM2B_SYM_KEY_Unmarshal((TPM2B_SYM_KEY*)&target->sym, buffer, in TPMU_SENSITIVE_COMPOSITE_Unmarshal()
3503 total_size += TPMI_ALG_PUBLIC_Marshal(&source->sensitiveType, buffer, size); in TPMT_SENSITIVE_Marshal()
3504 total_size += TPM2B_AUTH_Marshal(&source->authValue, buffer, size); in TPMT_SENSITIVE_Marshal()
3505 total_size += TPM2B_DIGEST_Marshal(&source->seedValue, buffer, size); in TPMT_SENSITIVE_Marshal()
3506 total_size += TPMU_SENSITIVE_COMPOSITE_Marshal(&source->sensitive, buffer, in TPMT_SENSITIVE_Marshal()
3507 size, source->sensitiveType); in TPMT_SENSITIVE_Marshal()
3511 TPM_RC TPMT_SENSITIVE_Unmarshal(TPMT_SENSITIVE* target, in TPMT_SENSITIVE_Unmarshal() argument
3515 result = TPMI_ALG_PUBLIC_Unmarshal(&target->sensitiveType, buffer, size); in TPMT_SENSITIVE_Unmarshal()
3519 result = TPM2B_AUTH_Unmarshal(&target->authValue, buffer, size); in TPMT_SENSITIVE_Unmarshal()
3523 result = TPM2B_DIGEST_Unmarshal(&target->seedValue, buffer, size); in TPMT_SENSITIVE_Unmarshal()
3527 result = TPMU_SENSITIVE_COMPOSITE_Unmarshal(&target->sensitive, buffer, size, in TPMT_SENSITIVE_Unmarshal()
3528 target->sensitiveType); in TPMT_SENSITIVE_Unmarshal()
3539 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_SENSITIVE_Marshal()
3540 total_size += TPMT_SENSITIVE_Marshal(&source->t.sensitiveArea, buffer, size); in TPM2B_SENSITIVE_Marshal()
3544 TPM_RC TPM2B_SENSITIVE_Unmarshal(TPM2B_SENSITIVE* target, in TPM2B_SENSITIVE_Unmarshal() argument
3548 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_SENSITIVE_Unmarshal()
3552 if (target->t.size == 0) { in TPM2B_SENSITIVE_Unmarshal()
3555 result = TPMT_SENSITIVE_Unmarshal(&target->t.sensitiveArea, buffer, size); in TPM2B_SENSITIVE_Unmarshal()
3566 total_size += TPM2B_AUTH_Marshal(&source->userAuth, buffer, size); in TPMS_SENSITIVE_CREATE_Marshal()
3567 total_size += TPM2B_SENSITIVE_DATA_Marshal(&source->data, buffer, size); in TPMS_SENSITIVE_CREATE_Marshal()
3571 TPM_RC TPMS_SENSITIVE_CREATE_Unmarshal(TPMS_SENSITIVE_CREATE* target, in TPMS_SENSITIVE_CREATE_Unmarshal() argument
3575 result = TPM2B_AUTH_Unmarshal(&target->userAuth, buffer, size); in TPMS_SENSITIVE_CREATE_Unmarshal()
3579 result = TPM2B_SENSITIVE_DATA_Unmarshal(&target->data, buffer, size); in TPMS_SENSITIVE_CREATE_Unmarshal()
3590 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_SENSITIVE_CREATE_Marshal()
3592 TPMS_SENSITIVE_CREATE_Marshal(&source->t.sensitive, buffer, size); in TPM2B_SENSITIVE_CREATE_Marshal()
3594 BYTE* size_location = *buffer - total_size; in TPM2B_SENSITIVE_CREATE_Marshal()
3596 UINT16 payload_size = total_size - (UINT16)size_field_size; in TPM2B_SENSITIVE_CREATE_Marshal()
3602 TPM_RC TPM2B_SENSITIVE_CREATE_Unmarshal(TPM2B_SENSITIVE_CREATE* target, in TPM2B_SENSITIVE_CREATE_Unmarshal() argument
3608 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_SENSITIVE_CREATE_Unmarshal()
3612 if (target->t.size == 0) { in TPM2B_SENSITIVE_CREATE_Unmarshal()
3615 result = TPMS_SENSITIVE_CREATE_Unmarshal(&target->t.sensitive, buffer, size); in TPM2B_SENSITIVE_CREATE_Unmarshal()
3619 struct_size = start_size - *size - sizeof(target->t.size); in TPM2B_SENSITIVE_CREATE_Unmarshal()
3620 if (struct_size != target->t.size) { in TPM2B_SENSITIVE_CREATE_Unmarshal()
3631 total_size += UINT16_Marshal(&source->t.size, buffer, size); in TPM2B_TIMEOUT_Marshal()
3632 for (i = 0; i < source->t.size; ++i) { in TPM2B_TIMEOUT_Marshal()
3633 total_size += BYTE_Marshal(&source->t.buffer[i], buffer, size); in TPM2B_TIMEOUT_Marshal()
3638 TPM_RC TPM2B_TIMEOUT_Unmarshal(TPM2B_TIMEOUT* target, in TPM2B_TIMEOUT_Unmarshal() argument
3643 result = UINT16_Unmarshal(&target->t.size, buffer, size); in TPM2B_TIMEOUT_Unmarshal()
3647 if (target->t.size == 0) { in TPM2B_TIMEOUT_Unmarshal()
3650 if (target->t.size > sizeof(UINT64)) { in TPM2B_TIMEOUT_Unmarshal()
3653 for (i = 0; i < target->t.size; ++i) { in TPM2B_TIMEOUT_Unmarshal()
3654 result = BYTE_Unmarshal(&target->t.buffer[i], buffer, size); in TPM2B_TIMEOUT_Unmarshal()
3668 TPM_RC TPMA_ALGORITHM_Unmarshal(TPMA_ALGORITHM* target, in TPMA_ALGORITHM_Unmarshal() argument
3672 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_ALGORITHM_Unmarshal()
3676 if (target->reserved4_7 != 0) { in TPMA_ALGORITHM_Unmarshal()
3679 if (target->reserved11_31 != 0) { in TPMA_ALGORITHM_Unmarshal()
3689 TPM_RC TPMA_CC_Unmarshal(TPMA_CC* target, BYTE** buffer, INT32* size) { in TPMA_CC_Unmarshal() argument
3691 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_CC_Unmarshal()
3695 if (target->reserved16_21 != 0) { in TPMA_CC_Unmarshal()
3705 TPM_RC TPMA_MEMORY_Unmarshal(TPMA_MEMORY* target, BYTE** buffer, INT32* size) { in TPMA_MEMORY_Unmarshal() argument
3707 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_MEMORY_Unmarshal()
3711 if (target->reserved3_31 != 0) { in TPMA_MEMORY_Unmarshal()
3723 TPM_RC TPMA_PERMANENT_Unmarshal(TPMA_PERMANENT* target, in TPMA_PERMANENT_Unmarshal() argument
3727 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_PERMANENT_Unmarshal()
3731 if (target->reserved3_7 != 0) { in TPMA_PERMANENT_Unmarshal()
3734 if (target->reserved11_31 != 0) { in TPMA_PERMANENT_Unmarshal()
3744 TPM_RC TPMA_SESSION_Unmarshal(TPMA_SESSION* target, in TPMA_SESSION_Unmarshal() argument
3748 result = uint8_t_Unmarshal((uint8_t*)target, buffer, size); in TPMA_SESSION_Unmarshal()
3752 if (target->reserved3_4 != 0) { in TPMA_SESSION_Unmarshal()
3764 TPM_RC TPMA_STARTUP_CLEAR_Unmarshal(TPMA_STARTUP_CLEAR* target, in TPMA_STARTUP_CLEAR_Unmarshal() argument
3768 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPMA_STARTUP_CLEAR_Unmarshal()
3772 if (target->reserved4_30 != 0) { in TPMA_STARTUP_CLEAR_Unmarshal()
3784 TPM_RC TPMI_ALG_ASYM_Unmarshal(TPMI_ALG_ASYM* target, in TPMI_ALG_ASYM_Unmarshal() argument
3790 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_ASYM_Unmarshal()
3794 if (*target == TPM_ALG_NULL) { in TPMI_ALG_ASYM_Unmarshal()
3797 switch (*target) { in TPMI_ALG_ASYM_Unmarshal()
3819 TPM_RC TPMI_ALG_RSA_DECRYPT_Unmarshal(TPMI_ALG_RSA_DECRYPT* target, in TPMI_ALG_RSA_DECRYPT_Unmarshal() argument
3825 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_RSA_DECRYPT_Unmarshal()
3829 if (*target == TPM_ALG_NULL) { in TPMI_ALG_RSA_DECRYPT_Unmarshal()
3832 switch (*target) { in TPMI_ALG_RSA_DECRYPT_Unmarshal()
3854 TPM_RC TPMI_ALG_SIG_SCHEME_Unmarshal(TPMI_ALG_SIG_SCHEME* target, in TPMI_ALG_SIG_SCHEME_Unmarshal() argument
3860 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_SIG_SCHEME_Unmarshal()
3864 if (*target == TPM_ALG_NULL) { in TPMI_ALG_SIG_SCHEME_Unmarshal()
3867 switch (*target) { in TPMI_ALG_SIG_SCHEME_Unmarshal()
3902 TPM_RC TPMI_ALG_SYM_Unmarshal(TPMI_ALG_SYM* target, in TPMI_ALG_SYM_Unmarshal() argument
3908 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ALG_SYM_Unmarshal()
3912 if (*target == TPM_ALG_NULL) { in TPMI_ALG_SYM_Unmarshal()
3915 switch (*target) { in TPMI_ALG_SYM_Unmarshal()
3943 TPM_RC TPMI_DH_CONTEXT_Unmarshal(TPMI_DH_CONTEXT* target, in TPMI_DH_CONTEXT_Unmarshal() argument
3948 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_DH_CONTEXT_Unmarshal()
3952 if ((*target >= HMAC_SESSION_FIRST) && (*target <= HMAC_SESSION_LAST)) { in TPMI_DH_CONTEXT_Unmarshal()
3955 if ((*target >= POLICY_SESSION_FIRST) && (*target <= POLICY_SESSION_LAST)) { in TPMI_DH_CONTEXT_Unmarshal()
3958 if ((*target >= TRANSIENT_FIRST) && (*target <= TRANSIENT_LAST)) { in TPMI_DH_CONTEXT_Unmarshal()
3973 TPM_RC TPMI_DH_ENTITY_Unmarshal(TPMI_DH_ENTITY* target, in TPMI_DH_ENTITY_Unmarshal() argument
3979 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_DH_ENTITY_Unmarshal()
3983 if (*target == TPM_RH_NULL) { in TPMI_DH_ENTITY_Unmarshal()
3986 switch (*target) { in TPMI_DH_ENTITY_Unmarshal()
3994 if ((*target >= TRANSIENT_FIRST) && (*target <= TRANSIENT_LAST)) { in TPMI_DH_ENTITY_Unmarshal()
3997 if ((*target >= PERSISTENT_FIRST) && (*target <= PERSISTENT_LAST)) { in TPMI_DH_ENTITY_Unmarshal()
4000 if ((*target >= NV_INDEX_FIRST) && (*target <= NV_INDEX_LAST)) { in TPMI_DH_ENTITY_Unmarshal()
4003 if ((*target >= PCR_FIRST) && (*target <= PCR_LAST)) { in TPMI_DH_ENTITY_Unmarshal()
4006 if ((*target >= TPM_RH_AUTH_00) && (*target <= TPM_RH_AUTH_FF)) { in TPMI_DH_ENTITY_Unmarshal()
4021 TPM_RC TPMI_DH_OBJECT_Unmarshal(TPMI_DH_OBJECT* target, in TPMI_DH_OBJECT_Unmarshal() argument
4027 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_DH_OBJECT_Unmarshal()
4031 if (*target == TPM_RH_NULL) { in TPMI_DH_OBJECT_Unmarshal()
4034 if ((*target >= TRANSIENT_FIRST) && (*target <= TRANSIENT_LAST)) { in TPMI_DH_OBJECT_Unmarshal()
4037 if ((*target >= PERSISTENT_FIRST) && (*target <= PERSISTENT_LAST)) { in TPMI_DH_OBJECT_Unmarshal()
4050 TPM_RC TPMI_DH_PCR_Unmarshal(TPMI_DH_PCR* target, in TPMI_DH_PCR_Unmarshal() argument
4056 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_DH_PCR_Unmarshal()
4060 if (*target == TPM_RH_NULL) { in TPMI_DH_PCR_Unmarshal()
4063 if ((*target >= PCR_FIRST) && (*target <= PCR_LAST)) { in TPMI_DH_PCR_Unmarshal()
4078 TPM_RC TPMI_DH_PERSISTENT_Unmarshal(TPMI_DH_PERSISTENT* target, in TPMI_DH_PERSISTENT_Unmarshal() argument
4083 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_DH_PERSISTENT_Unmarshal()
4087 if ((*target >= PERSISTENT_FIRST) && (*target <= PERSISTENT_LAST)) { in TPMI_DH_PERSISTENT_Unmarshal()
4102 TPM_RC TPMI_ECC_KEY_EXCHANGE_Unmarshal(TPMI_ECC_KEY_EXCHANGE* target, in TPMI_ECC_KEY_EXCHANGE_Unmarshal() argument
4108 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ECC_KEY_EXCHANGE_Unmarshal()
4112 if (*target == TPM_ALG_NULL) { in TPMI_ECC_KEY_EXCHANGE_Unmarshal()
4115 switch (*target) { in TPMI_ECC_KEY_EXCHANGE_Unmarshal()
4140 TPM_RC TPMI_RH_CLEAR_Unmarshal(TPMI_RH_CLEAR* target, in TPMI_RH_CLEAR_Unmarshal() argument
4145 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_CLEAR_Unmarshal()
4149 switch (*target) { in TPMI_RH_CLEAR_Unmarshal()
4167 TPM_RC TPMI_RH_ENABLES_Unmarshal(TPMI_RH_ENABLES* target, in TPMI_RH_ENABLES_Unmarshal() argument
4173 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_ENABLES_Unmarshal()
4177 if (*target == TPM_RH_NULL) { in TPMI_RH_ENABLES_Unmarshal()
4180 switch (*target) { in TPMI_RH_ENABLES_Unmarshal()
4200 TPM_RC TPMI_RH_ENDORSEMENT_Unmarshal(TPMI_RH_ENDORSEMENT* target, in TPMI_RH_ENDORSEMENT_Unmarshal() argument
4206 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_ENDORSEMENT_Unmarshal()
4210 if (*target == TPM_RH_NULL) { in TPMI_RH_ENDORSEMENT_Unmarshal()
4213 switch (*target) { in TPMI_RH_ENDORSEMENT_Unmarshal()
4230 TPM_RC TPMI_RH_HIERARCHY_Unmarshal(TPMI_RH_HIERARCHY* target, in TPMI_RH_HIERARCHY_Unmarshal() argument
4236 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_HIERARCHY_Unmarshal()
4240 if (*target == TPM_RH_NULL) { in TPMI_RH_HIERARCHY_Unmarshal()
4243 switch (*target) { in TPMI_RH_HIERARCHY_Unmarshal()
4262 TPM_RC TPMI_RH_HIERARCHY_AUTH_Unmarshal(TPMI_RH_HIERARCHY_AUTH* target, in TPMI_RH_HIERARCHY_AUTH_Unmarshal() argument
4267 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_HIERARCHY_AUTH_Unmarshal()
4271 switch (*target) { in TPMI_RH_HIERARCHY_AUTH_Unmarshal()
4291 TPM_RC TPMI_RH_LOCKOUT_Unmarshal(TPMI_RH_LOCKOUT* target, in TPMI_RH_LOCKOUT_Unmarshal() argument
4296 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_LOCKOUT_Unmarshal()
4300 switch (*target) { in TPMI_RH_LOCKOUT_Unmarshal()
4317 TPM_RC TPMI_RH_NV_AUTH_Unmarshal(TPMI_RH_NV_AUTH* target, in TPMI_RH_NV_AUTH_Unmarshal() argument
4322 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_NV_AUTH_Unmarshal()
4326 switch (*target) { in TPMI_RH_NV_AUTH_Unmarshal()
4332 if ((*target >= NV_INDEX_FIRST) && (*target <= NV_INDEX_LAST)) { in TPMI_RH_NV_AUTH_Unmarshal()
4347 TPM_RC TPMI_RH_OWNER_Unmarshal(TPMI_RH_OWNER* target, in TPMI_RH_OWNER_Unmarshal() argument
4353 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_OWNER_Unmarshal()
4357 if (*target == TPM_RH_NULL) { in TPMI_RH_OWNER_Unmarshal()
4360 switch (*target) { in TPMI_RH_OWNER_Unmarshal()
4377 TPM_RC TPMI_RH_PLATFORM_Unmarshal(TPMI_RH_PLATFORM* target, in TPMI_RH_PLATFORM_Unmarshal() argument
4382 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_PLATFORM_Unmarshal()
4386 switch (*target) { in TPMI_RH_PLATFORM_Unmarshal()
4403 TPM_RC TPMI_RH_PROVISION_Unmarshal(TPMI_RH_PROVISION* target, in TPMI_RH_PROVISION_Unmarshal() argument
4408 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_RH_PROVISION_Unmarshal()
4412 switch (*target) { in TPMI_RH_PROVISION_Unmarshal()
4430 TPM_RC TPMI_SH_AUTH_SESSION_Unmarshal(TPMI_SH_AUTH_SESSION* target, in TPMI_SH_AUTH_SESSION_Unmarshal() argument
4436 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_SH_AUTH_SESSION_Unmarshal()
4440 if (*target == TPM_RS_PW) { in TPMI_SH_AUTH_SESSION_Unmarshal()
4443 if ((*target >= HMAC_SESSION_FIRST) && (*target <= HMAC_SESSION_LAST)) { in TPMI_SH_AUTH_SESSION_Unmarshal()
4446 if ((*target >= POLICY_SESSION_FIRST) && (*target <= POLICY_SESSION_LAST)) { in TPMI_SH_AUTH_SESSION_Unmarshal()
4459 TPM_RC TPMI_SH_HMAC_Unmarshal(TPMI_SH_HMAC* target, in TPMI_SH_HMAC_Unmarshal() argument
4464 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_SH_HMAC_Unmarshal()
4468 if ((*target >= HMAC_SESSION_FIRST) && (*target <= HMAC_SESSION_LAST)) { in TPMI_SH_HMAC_Unmarshal()
4483 TPM_RC TPMI_SH_POLICY_Unmarshal(TPMI_SH_POLICY* target, in TPMI_SH_POLICY_Unmarshal() argument
4488 result = uint32_t_Unmarshal(target, buffer, size); in TPMI_SH_POLICY_Unmarshal()
4492 if ((*target >= POLICY_SESSION_FIRST) && (*target <= POLICY_SESSION_LAST)) { in TPMI_SH_POLICY_Unmarshal()
4507 TPM_RC TPMI_ST_ATTEST_Unmarshal(TPMI_ST_ATTEST* target, in TPMI_ST_ATTEST_Unmarshal() argument
4512 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ST_ATTEST_Unmarshal()
4516 switch (*target) { in TPMI_ST_ATTEST_Unmarshal()
4539 TPM_RC TPMI_ST_COMMAND_TAG_Unmarshal(TPMI_ST_COMMAND_TAG* target, in TPMI_ST_COMMAND_TAG_Unmarshal() argument
4544 result = uint16_t_Unmarshal(target, buffer, size); in TPMI_ST_COMMAND_TAG_Unmarshal()
4548 switch (*target) { in TPMI_ST_COMMAND_TAG_Unmarshal()
4564 TPM_RC TPMI_YES_NO_Unmarshal(TPMI_YES_NO* target, BYTE** buffer, INT32* size) { in TPMI_YES_NO_Unmarshal() argument
4567 result = uint8_t_Unmarshal(target, buffer, size); in TPMI_YES_NO_Unmarshal()
4571 switch (*target) { in TPMI_YES_NO_Unmarshal()
4586 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_ALG_Marshal()
4587 for (i = 0; i < source->count; ++i) { in TPML_ALG_Marshal()
4588 total_size += TPM_ALG_ID_Marshal(&source->algorithms[i], buffer, size); in TPML_ALG_Marshal()
4593 TPM_RC TPML_ALG_Unmarshal(TPML_ALG* target, BYTE** buffer, INT32* size) { in TPML_ALG_Unmarshal() argument
4596 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_ALG_Unmarshal()
4600 if (target->count > MAX_ALG_LIST_SIZE) { in TPML_ALG_Unmarshal()
4603 for (i = 0; i < target->count; ++i) { in TPML_ALG_Unmarshal()
4604 result = TPM_ALG_ID_Unmarshal(&target->algorithms[i], buffer, size); in TPML_ALG_Unmarshal()
4616 total_size += TPM_ALG_ID_Marshal(&source->alg, buffer, size); in TPMS_ALG_PROPERTY_Marshal()
4617 total_size += TPMA_ALGORITHM_Marshal(&source->algProperties, buffer, size); in TPMS_ALG_PROPERTY_Marshal()
4621 TPM_RC TPMS_ALG_PROPERTY_Unmarshal(TPMS_ALG_PROPERTY* target, in TPMS_ALG_PROPERTY_Unmarshal() argument
4625 result = TPM_ALG_ID_Unmarshal(&target->alg, buffer, size); in TPMS_ALG_PROPERTY_Unmarshal()
4629 result = TPMA_ALGORITHM_Unmarshal(&target->algProperties, buffer, size); in TPMS_ALG_PROPERTY_Unmarshal()
4641 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_ALG_PROPERTY_Marshal()
4642 for (i = 0; i < source->count; ++i) { in TPML_ALG_PROPERTY_Marshal()
4644 TPMS_ALG_PROPERTY_Marshal(&source->algProperties[i], buffer, size); in TPML_ALG_PROPERTY_Marshal()
4649 TPM_RC TPML_ALG_PROPERTY_Unmarshal(TPML_ALG_PROPERTY* target, in TPML_ALG_PROPERTY_Unmarshal() argument
4654 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_ALG_PROPERTY_Unmarshal()
4658 if (target->count > MAX_CAP_ALGS) { in TPML_ALG_PROPERTY_Unmarshal()
4661 for (i = 0; i < target->count; ++i) { in TPML_ALG_PROPERTY_Unmarshal()
4663 TPMS_ALG_PROPERTY_Unmarshal(&target->algProperties[i], buffer, size); in TPML_ALG_PROPERTY_Unmarshal()
4675 TPM_RC TPM_CC_Unmarshal(TPM_CC* target, BYTE** buffer, INT32* size) { in TPM_CC_Unmarshal() argument
4677 result = uint32_t_Unmarshal(target, buffer, size); in TPM_CC_Unmarshal()
4682 if (*target == TPM_CC_FIRST) { in TPM_CC_Unmarshal()
4687 if (*target == TPM_CC_PP_FIRST) { in TPM_CC_Unmarshal()
4692 if (*target == TPM_CC_NV_UndefineSpaceSpecial) { in TPM_CC_Unmarshal()
4697 if (*target == TPM_CC_EvictControl) { in TPM_CC_Unmarshal()
4702 if (*target == TPM_CC_HierarchyControl) { in TPM_CC_Unmarshal()
4707 if (*target == TPM_CC_NV_UndefineSpace) { in TPM_CC_Unmarshal()
4712 if (*target == TPM_CC_ChangeEPS) { in TPM_CC_Unmarshal()
4717 if (*target == TPM_CC_ChangePPS) { in TPM_CC_Unmarshal()
4722 if (*target == TPM_CC_Clear) { in TPM_CC_Unmarshal()
4727 if (*target == TPM_CC_ClearControl) { in TPM_CC_Unmarshal()
4732 if (*target == TPM_CC_ClockSet) { in TPM_CC_Unmarshal()
4737 if (*target == TPM_CC_HierarchyChangeAuth) { in TPM_CC_Unmarshal()
4742 if (*target == TPM_CC_NV_DefineSpace) { in TPM_CC_Unmarshal()
4747 if (*target == TPM_CC_PCR_Allocate) { in TPM_CC_Unmarshal()
4752 if (*target == TPM_CC_PCR_SetAuthPolicy) { in TPM_CC_Unmarshal()
4757 if (*target == TPM_CC_PP_Commands) { in TPM_CC_Unmarshal()
4762 if (*target == TPM_CC_SetPrimaryPolicy) { in TPM_CC_Unmarshal()
4767 if (*target == TPM_CC_FieldUpgradeStart) { in TPM_CC_Unmarshal()
4772 if (*target == TPM_CC_ClockRateAdjust) { in TPM_CC_Unmarshal()
4777 if (*target == TPM_CC_CreatePrimary) { in TPM_CC_Unmarshal()
4782 if (*target == TPM_CC_NV_GlobalWriteLock) { in TPM_CC_Unmarshal()
4787 if (*target == TPM_CC_PP_LAST) { in TPM_CC_Unmarshal()
4792 if (*target == TPM_CC_GetCommandAuditDigest) { in TPM_CC_Unmarshal()
4797 if (*target == TPM_CC_NV_Increment) { in TPM_CC_Unmarshal()
4802 if (*target == TPM_CC_NV_SetBits) { in TPM_CC_Unmarshal()
4807 if (*target == TPM_CC_NV_Extend) { in TPM_CC_Unmarshal()
4812 if (*target == TPM_CC_NV_Write) { in TPM_CC_Unmarshal()
4817 if (*target == TPM_CC_NV_WriteLock) { in TPM_CC_Unmarshal()
4822 if (*target == TPM_CC_DictionaryAttackLockReset) { in TPM_CC_Unmarshal()
4827 if (*target == TPM_CC_DictionaryAttackParameters) { in TPM_CC_Unmarshal()
4832 if (*target == TPM_CC_NV_ChangeAuth) { in TPM_CC_Unmarshal()
4837 if (*target == TPM_CC_PCR_Event) { in TPM_CC_Unmarshal()
4842 if (*target == TPM_CC_PCR_Reset) { in TPM_CC_Unmarshal()
4847 if (*target == TPM_CC_SequenceComplete) { in TPM_CC_Unmarshal()
4852 if (*target == TPM_CC_SetAlgorithmSet) { in TPM_CC_Unmarshal()
4857 if (*target == TPM_CC_SetCommandCodeAuditStatus) { in TPM_CC_Unmarshal()
4862 if (*target == TPM_CC_FieldUpgradeData) { in TPM_CC_Unmarshal()
4867 if (*target == TPM_CC_IncrementalSelfTest) { in TPM_CC_Unmarshal()
4872 if (*target == TPM_CC_SelfTest) { in TPM_CC_Unmarshal()
4877 if (*target == TPM_CC_Startup) { in TPM_CC_Unmarshal()
4882 if (*target == TPM_CC_Shutdown) { in TPM_CC_Unmarshal()
4887 if (*target == TPM_CC_StirRandom) { in TPM_CC_Unmarshal()
4892 if (*target == TPM_CC_ActivateCredential) { in TPM_CC_Unmarshal()
4897 if (*target == TPM_CC_Certify) { in TPM_CC_Unmarshal()
4902 if (*target == TPM_CC_PolicyNV) { in TPM_CC_Unmarshal()
4907 if (*target == TPM_CC_CertifyCreation) { in TPM_CC_Unmarshal()
4912 if (*target == TPM_CC_Duplicate) { in TPM_CC_Unmarshal()
4917 if (*target == TPM_CC_GetTime) { in TPM_CC_Unmarshal()
4922 if (*target == TPM_CC_GetSessionAuditDigest) { in TPM_CC_Unmarshal()
4927 if (*target == TPM_CC_NV_Read) { in TPM_CC_Unmarshal()
4932 if (*target == TPM_CC_NV_ReadLock) { in TPM_CC_Unmarshal()
4937 if (*target == TPM_CC_ObjectChangeAuth) { in TPM_CC_Unmarshal()
4942 if (*target == TPM_CC_PolicySecret) { in TPM_CC_Unmarshal()
4947 if (*target == TPM_CC_Rewrap) { in TPM_CC_Unmarshal()
4952 if (*target == TPM_CC_Create) { in TPM_CC_Unmarshal()
4957 if (*target == TPM_CC_ECDH_ZGen) { in TPM_CC_Unmarshal()
4962 if (*target == TPM_CC_HMAC) { in TPM_CC_Unmarshal()
4967 if (*target == TPM_CC_Import) { in TPM_CC_Unmarshal()
4972 if (*target == TPM_CC_Load) { in TPM_CC_Unmarshal()
4977 if (*target == TPM_CC_Quote) { in TPM_CC_Unmarshal()
4982 if (*target == TPM_CC_RSA_Decrypt) { in TPM_CC_Unmarshal()
4987 if (*target == TPM_CC_HMAC_Start) { in TPM_CC_Unmarshal()
4992 if (*target == TPM_CC_SequenceUpdate) { in TPM_CC_Unmarshal()
4997 if (*target == TPM_CC_Sign) { in TPM_CC_Unmarshal()
5002 if (*target == TPM_CC_Unseal) { in TPM_CC_Unmarshal()
5007 if (*target == TPM_CC_PolicySigned) { in TPM_CC_Unmarshal()
5012 if (*target == TPM_CC_ContextLoad) { in TPM_CC_Unmarshal()
5017 if (*target == TPM_CC_ContextSave) { in TPM_CC_Unmarshal()
5022 if (*target == TPM_CC_ECDH_KeyGen) { in TPM_CC_Unmarshal()
5027 if (*target == TPM_CC_EncryptDecrypt) { in TPM_CC_Unmarshal()
5032 if (*target == TPM_CC_FlushContext) { in TPM_CC_Unmarshal()
5037 if (*target == TPM_CC_LoadExternal) { in TPM_CC_Unmarshal()
5042 if (*target == TPM_CC_MakeCredential) { in TPM_CC_Unmarshal()
5047 if (*target == TPM_CC_NV_ReadPublic) { in TPM_CC_Unmarshal()
5052 if (*target == TPM_CC_PolicyAuthorize) { in TPM_CC_Unmarshal()
5057 if (*target == TPM_CC_PolicyAuthValue) { in TPM_CC_Unmarshal()
5062 if (*target == TPM_CC_PolicyCommandCode) { in TPM_CC_Unmarshal()
5067 if (*target == TPM_CC_PolicyCounterTimer) { in TPM_CC_Unmarshal()
5072 if (*target == TPM_CC_PolicyCpHash) { in TPM_CC_Unmarshal()
5077 if (*target == TPM_CC_PolicyLocality) { in TPM_CC_Unmarshal()
5082 if (*target == TPM_CC_PolicyNameHash) { in TPM_CC_Unmarshal()
5087 if (*target == TPM_CC_PolicyOR) { in TPM_CC_Unmarshal()
5092 if (*target == TPM_CC_PolicyTicket) { in TPM_CC_Unmarshal()
5097 if (*target == TPM_CC_ReadPublic) { in TPM_CC_Unmarshal()
5102 if (*target == TPM_CC_RSA_Encrypt) { in TPM_CC_Unmarshal()
5107 if (*target == TPM_CC_StartAuthSession) { in TPM_CC_Unmarshal()
5112 if (*target == TPM_CC_VerifySignature) { in TPM_CC_Unmarshal()
5117 if (*target == TPM_CC_ECC_Parameters) { in TPM_CC_Unmarshal()
5122 if (*target == TPM_CC_FirmwareRead) { in TPM_CC_Unmarshal()
5127 if (*target == TPM_CC_GetCapability) { in TPM_CC_Unmarshal()
5132 if (*target == TPM_CC_GetRandom) { in TPM_CC_Unmarshal()
5137 if (*target == TPM_CC_GetTestResult) { in TPM_CC_Unmarshal()
5142 if (*target == TPM_CC_Hash) { in TPM_CC_Unmarshal()
5147 if (*target == TPM_CC_PCR_Read) { in TPM_CC_Unmarshal()
5152 if (*target == TPM_CC_PolicyPCR) { in TPM_CC_Unmarshal()
5157 if (*target == TPM_CC_PolicyRestart) { in TPM_CC_Unmarshal()
5162 if (*target == TPM_CC_ReadClock) { in TPM_CC_Unmarshal()
5167 if (*target == TPM_CC_PCR_Extend) { in TPM_CC_Unmarshal()
5172 if (*target == TPM_CC_PCR_SetAuthValue) { in TPM_CC_Unmarshal()
5177 if (*target == TPM_CC_NV_Certify) { in TPM_CC_Unmarshal()
5182 if (*target == TPM_CC_EventSequenceComplete) { in TPM_CC_Unmarshal()
5187 if (*target == TPM_CC_HashSequenceStart) { in TPM_CC_Unmarshal()
5192 if (*target == TPM_CC_PolicyPhysicalPresence) { in TPM_CC_Unmarshal()
5197 if (*target == TPM_CC_PolicyDuplicationSelect) { in TPM_CC_Unmarshal()
5202 if (*target == TPM_CC_PolicyGetDigest) { in TPM_CC_Unmarshal()
5207 if (*target == TPM_CC_TestParms) { in TPM_CC_Unmarshal()
5212 if (*target == TPM_CC_Commit) { in TPM_CC_Unmarshal()
5217 if (*target == TPM_CC_PolicyPassword) { in TPM_CC_Unmarshal()
5222 if (*target == TPM_CC_ZGen_2Phase) { in TPM_CC_Unmarshal()
5227 if (*target == TPM_CC_EC_Ephemeral) { in TPM_CC_Unmarshal()
5232 if (*target == TPM_CC_PolicyNvWritten) { in TPM_CC_Unmarshal()
5237 if (*target == TPM_CC_LAST) { in TPM_CC_Unmarshal()
5247 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_CC_Marshal()
5248 for (i = 0; i < source->count; ++i) { in TPML_CC_Marshal()
5249 total_size += TPM_CC_Marshal(&source->commandCodes[i], buffer, size); in TPML_CC_Marshal()
5254 TPM_RC TPML_CC_Unmarshal(TPML_CC* target, BYTE** buffer, INT32* size) { in TPML_CC_Unmarshal() argument
5257 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_CC_Unmarshal()
5261 if (target->count > MAX_CAP_CC) { in TPML_CC_Unmarshal()
5264 for (i = 0; i < target->count; ++i) { in TPML_CC_Unmarshal()
5265 result = TPM_CC_Unmarshal(&target->commandCodes[i], buffer, size); in TPML_CC_Unmarshal()
5276 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_CCA_Marshal()
5277 for (i = 0; i < source->count; ++i) { in TPML_CCA_Marshal()
5278 total_size += TPMA_CC_Marshal(&source->commandAttributes[i], buffer, size); in TPML_CCA_Marshal()
5283 TPM_RC TPML_CCA_Unmarshal(TPML_CCA* target, BYTE** buffer, INT32* size) { in TPML_CCA_Unmarshal() argument
5286 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_CCA_Unmarshal()
5290 if (target->count > MAX_CAP_CC) { in TPML_CCA_Unmarshal()
5293 for (i = 0; i < target->count; ++i) { in TPML_CCA_Unmarshal()
5294 result = TPMA_CC_Unmarshal(&target->commandAttributes[i], buffer, size); in TPML_CCA_Unmarshal()
5305 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_DIGEST_Marshal()
5306 for (i = 0; i < source->count; ++i) { in TPML_DIGEST_Marshal()
5307 total_size += TPM2B_DIGEST_Marshal(&source->digests[i], buffer, size); in TPML_DIGEST_Marshal()
5312 TPM_RC TPML_DIGEST_Unmarshal(TPML_DIGEST* target, BYTE** buffer, INT32* size) { in TPML_DIGEST_Unmarshal() argument
5315 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_DIGEST_Unmarshal()
5319 if (target->count > 8) { in TPML_DIGEST_Unmarshal()
5322 if (target->count < 2) { in TPML_DIGEST_Unmarshal()
5325 for (i = 0; i < target->count; ++i) { in TPML_DIGEST_Unmarshal()
5326 result = TPM2B_DIGEST_Unmarshal(&target->digests[i], buffer, size); in TPML_DIGEST_Unmarshal()
5344 total_size += BYTE_Marshal(&source->sha[i], buffer, size); in TPMU_HA_Marshal()
5351 total_size += BYTE_Marshal(&source->sha1[i], buffer, size); in TPMU_HA_Marshal()
5358 total_size += BYTE_Marshal(&source->sha256[i], buffer, size); in TPMU_HA_Marshal()
5365 total_size += BYTE_Marshal(&source->sha384[i], buffer, size); in TPMU_HA_Marshal()
5372 total_size += BYTE_Marshal(&source->sha512[i], buffer, size); in TPMU_HA_Marshal()
5379 total_size += BYTE_Marshal(&source->sm3_256[i], buffer, size); in TPMU_HA_Marshal()
5391 TPM_RC TPMU_HA_Unmarshal(TPMU_HA* target, in TPMU_HA_Unmarshal() argument
5401 result = BYTE_Unmarshal(&target->sha[i], buffer, size); in TPMU_HA_Unmarshal()
5411 result = BYTE_Unmarshal(&target->sha1[i], buffer, size); in TPMU_HA_Unmarshal()
5421 result = BYTE_Unmarshal(&target->sha256[i], buffer, size); in TPMU_HA_Unmarshal()
5431 result = BYTE_Unmarshal(&target->sha384[i], buffer, size); in TPMU_HA_Unmarshal()
5441 result = BYTE_Unmarshal(&target->sha512[i], buffer, size); in TPMU_HA_Unmarshal()
5451 result = BYTE_Unmarshal(&target->sm3_256[i], buffer, size); in TPMU_HA_Unmarshal()
5468 total_size += TPMI_ALG_HASH_Marshal(&source->hashAlg, buffer, size); in TPMT_HA_Marshal()
5469 total_size += TPMU_HA_Marshal(&source->digest, buffer, size, source->hashAlg); in TPMT_HA_Marshal()
5473 TPM_RC TPMT_HA_Unmarshal(TPMT_HA* target, BYTE** buffer, INT32* size) { in TPMT_HA_Unmarshal() argument
5475 result = TPMI_ALG_HASH_Unmarshal(&target->hashAlg, buffer, size, TRUE); in TPMT_HA_Unmarshal()
5479 result = TPMU_HA_Unmarshal(&target->digest, buffer, size, target->hashAlg); in TPMT_HA_Unmarshal()
5491 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_DIGEST_VALUES_Marshal()
5492 for (i = 0; i < source->count; ++i) { in TPML_DIGEST_VALUES_Marshal()
5493 total_size += TPMT_HA_Marshal(&source->digests[i], buffer, size); in TPML_DIGEST_VALUES_Marshal()
5498 TPM_RC TPML_DIGEST_VALUES_Unmarshal(TPML_DIGEST_VALUES* target, in TPML_DIGEST_VALUES_Unmarshal() argument
5503 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_DIGEST_VALUES_Unmarshal()
5507 if (target->count > HASH_COUNT) { in TPML_DIGEST_VALUES_Unmarshal()
5510 for (i = 0; i < target->count; ++i) { in TPML_DIGEST_VALUES_Unmarshal()
5511 result = TPMT_HA_Unmarshal(&target->digests[i], buffer, size); in TPML_DIGEST_VALUES_Unmarshal()
5525 TPM_RC TPM_ECC_CURVE_Unmarshal(TPM_ECC_CURVE* target, in TPM_ECC_CURVE_Unmarshal() argument
5529 result = uint16_t_Unmarshal(target, buffer, size); in TPM_ECC_CURVE_Unmarshal()
5533 if (*target == TPM_ECC_NONE) { in TPM_ECC_CURVE_Unmarshal()
5536 if (*target == TPM_ECC_NIST_P192) { in TPM_ECC_CURVE_Unmarshal()
5539 if (*target == TPM_ECC_NIST_P224) { in TPM_ECC_CURVE_Unmarshal()
5542 if (*target == TPM_ECC_NIST_P256) { in TPM_ECC_CURVE_Unmarshal()
5545 if (*target == TPM_ECC_NIST_P384) { in TPM_ECC_CURVE_Unmarshal()
5548 if (*target == TPM_ECC_NIST_P521) { in TPM_ECC_CURVE_Unmarshal()
5551 if (*target == TPM_ECC_BN_P256) { in TPM_ECC_CURVE_Unmarshal()
5554 if (*target == TPM_ECC_BN_P638) { in TPM_ECC_CURVE_Unmarshal()
5557 if (*target == TPM_ECC_SM2_P256) { in TPM_ECC_CURVE_Unmarshal()
5568 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_ECC_CURVE_Marshal()
5569 for (i = 0; i < source->count; ++i) { in TPML_ECC_CURVE_Marshal()
5570 total_size += TPM_ECC_CURVE_Marshal(&source->eccCurves[i], buffer, size); in TPML_ECC_CURVE_Marshal()
5575 TPM_RC TPML_ECC_CURVE_Unmarshal(TPML_ECC_CURVE* target, in TPML_ECC_CURVE_Unmarshal() argument
5580 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_ECC_CURVE_Unmarshal()
5584 if (target->count > MAX_ECC_CURVES) { in TPML_ECC_CURVE_Unmarshal()
5587 for (i = 0; i < target->count; ++i) { in TPML_ECC_CURVE_Unmarshal()
5588 result = TPM_ECC_CURVE_Unmarshal(&target->eccCurves[i], buffer, size); in TPML_ECC_CURVE_Unmarshal()
5600 TPM_RC TPM_HANDLE_Unmarshal(TPM_HANDLE* target, BYTE** buffer, INT32* size) { in TPM_HANDLE_Unmarshal() argument
5601 return uint32_t_Unmarshal(target, buffer, size); in TPM_HANDLE_Unmarshal()
5607 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_HANDLE_Marshal()
5608 for (i = 0; i < source->count; ++i) { in TPML_HANDLE_Marshal()
5609 total_size += TPM_HANDLE_Marshal(&source->handle[i], buffer, size); in TPML_HANDLE_Marshal()
5614 TPM_RC TPML_HANDLE_Unmarshal(TPML_HANDLE* target, BYTE** buffer, INT32* size) { in TPML_HANDLE_Unmarshal() argument
5617 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_HANDLE_Unmarshal()
5621 if (target->count > MAX_CAP_HANDLES) { in TPML_HANDLE_Unmarshal()
5624 for (i = 0; i < target->count; ++i) { in TPML_HANDLE_Unmarshal()
5625 result = TPM_HANDLE_Unmarshal(&target->handle[i], buffer, size); in TPML_HANDLE_Unmarshal()
5637 TPM_RC TPM_PT_Unmarshal(TPM_PT* target, BYTE** buffer, INT32* size) { in TPM_PT_Unmarshal() argument
5639 result = uint32_t_Unmarshal(target, buffer, size); in TPM_PT_Unmarshal()
5643 if (*target == TPM_PT_NONE) { in TPM_PT_Unmarshal()
5646 if (*target == PT_GROUP) { in TPM_PT_Unmarshal()
5649 if (*target == PT_FIXED) { in TPM_PT_Unmarshal()
5652 if (*target == TPM_PT_FAMILY_INDICATOR) { in TPM_PT_Unmarshal()
5655 if (*target == TPM_PT_LEVEL) { in TPM_PT_Unmarshal()
5658 if (*target == TPM_PT_REVISION) { in TPM_PT_Unmarshal()
5661 if (*target == TPM_PT_DAY_OF_YEAR) { in TPM_PT_Unmarshal()
5664 if (*target == TPM_PT_YEAR) { in TPM_PT_Unmarshal()
5667 if (*target == TPM_PT_MANUFACTURER) { in TPM_PT_Unmarshal()
5670 if (*target == TPM_PT_VENDOR_STRING_1) { in TPM_PT_Unmarshal()
5673 if (*target == TPM_PT_VENDOR_STRING_2) { in TPM_PT_Unmarshal()
5676 if (*target == TPM_PT_VENDOR_STRING_3) { in TPM_PT_Unmarshal()
5679 if (*target == TPM_PT_VENDOR_STRING_4) { in TPM_PT_Unmarshal()
5682 if (*target == TPM_PT_VENDOR_TPM_TYPE) { in TPM_PT_Unmarshal()
5685 if (*target == TPM_PT_FIRMWARE_VERSION_1) { in TPM_PT_Unmarshal()
5688 if (*target == TPM_PT_FIRMWARE_VERSION_2) { in TPM_PT_Unmarshal()
5691 if (*target == TPM_PT_INPUT_BUFFER) { in TPM_PT_Unmarshal()
5694 if (*target == TPM_PT_HR_TRANSIENT_MIN) { in TPM_PT_Unmarshal()
5697 if (*target == TPM_PT_HR_PERSISTENT_MIN) { in TPM_PT_Unmarshal()
5700 if (*target == TPM_PT_HR_LOADED_MIN) { in TPM_PT_Unmarshal()
5703 if (*target == TPM_PT_ACTIVE_SESSIONS_MAX) { in TPM_PT_Unmarshal()
5706 if (*target == TPM_PT_PCR_COUNT) { in TPM_PT_Unmarshal()
5709 if (*target == TPM_PT_PCR_SELECT_MIN) { in TPM_PT_Unmarshal()
5712 if (*target == TPM_PT_CONTEXT_GAP_MAX) { in TPM_PT_Unmarshal()
5715 if (*target == TPM_PT_NV_COUNTERS_MAX) { in TPM_PT_Unmarshal()
5718 if (*target == TPM_PT_NV_INDEX_MAX) { in TPM_PT_Unmarshal()
5721 if (*target == TPM_PT_MEMORY) { in TPM_PT_Unmarshal()
5724 if (*target == TPM_PT_CLOCK_UPDATE) { in TPM_PT_Unmarshal()
5727 if (*target == TPM_PT_CONTEXT_HASH) { in TPM_PT_Unmarshal()
5730 if (*target == TPM_PT_CONTEXT_SYM) { in TPM_PT_Unmarshal()
5733 if (*target == TPM_PT_CONTEXT_SYM_SIZE) { in TPM_PT_Unmarshal()
5736 if (*target == TPM_PT_ORDERLY_COUNT) { in TPM_PT_Unmarshal()
5739 if (*target == TPM_PT_MAX_COMMAND_SIZE) { in TPM_PT_Unmarshal()
5742 if (*target == TPM_PT_MAX_RESPONSE_SIZE) { in TPM_PT_Unmarshal()
5745 if (*target == TPM_PT_MAX_DIGEST) { in TPM_PT_Unmarshal()
5748 if (*target == TPM_PT_MAX_OBJECT_CONTEXT) { in TPM_PT_Unmarshal()
5751 if (*target == TPM_PT_MAX_SESSION_CONTEXT) { in TPM_PT_Unmarshal()
5754 if (*target == TPM_PT_PS_FAMILY_INDICATOR) { in TPM_PT_Unmarshal()
5757 if (*target == TPM_PT_PS_LEVEL) { in TPM_PT_Unmarshal()
5760 if (*target == TPM_PT_PS_REVISION) { in TPM_PT_Unmarshal()
5763 if (*target == TPM_PT_PS_DAY_OF_YEAR) { in TPM_PT_Unmarshal()
5766 if (*target == TPM_PT_PS_YEAR) { in TPM_PT_Unmarshal()
5769 if (*target == TPM_PT_SPLIT_MAX) { in TPM_PT_Unmarshal()
5772 if (*target == TPM_PT_TOTAL_COMMANDS) { in TPM_PT_Unmarshal()
5775 if (*target == TPM_PT_LIBRARY_COMMANDS) { in TPM_PT_Unmarshal()
5778 if (*target == TPM_PT_VENDOR_COMMANDS) { in TPM_PT_Unmarshal()
5781 if (*target == TPM_PT_NV_BUFFER_MAX) { in TPM_PT_Unmarshal()
5784 if (*target == PT_VAR) { in TPM_PT_Unmarshal()
5787 if (*target == TPM_PT_PERMANENT) { in TPM_PT_Unmarshal()
5790 if (*target == TPM_PT_STARTUP_CLEAR) { in TPM_PT_Unmarshal()
5793 if (*target == TPM_PT_HR_NV_INDEX) { in TPM_PT_Unmarshal()
5796 if (*target == TPM_PT_HR_LOADED) { in TPM_PT_Unmarshal()
5799 if (*target == TPM_PT_HR_LOADED_AVAIL) { in TPM_PT_Unmarshal()
5802 if (*target == TPM_PT_HR_ACTIVE) { in TPM_PT_Unmarshal()
5805 if (*target == TPM_PT_HR_ACTIVE_AVAIL) { in TPM_PT_Unmarshal()
5808 if (*target == TPM_PT_HR_TRANSIENT_AVAIL) { in TPM_PT_Unmarshal()
5811 if (*target == TPM_PT_HR_PERSISTENT) { in TPM_PT_Unmarshal()
5814 if (*target == TPM_PT_HR_PERSISTENT_AVAIL) { in TPM_PT_Unmarshal()
5817 if (*target == TPM_PT_NV_COUNTERS) { in TPM_PT_Unmarshal()
5820 if (*target == TPM_PT_NV_COUNTERS_AVAIL) { in TPM_PT_Unmarshal()
5823 if (*target == TPM_PT_ALGORITHM_SET) { in TPM_PT_Unmarshal()
5826 if (*target == TPM_PT_LOADED_CURVES) { in TPM_PT_Unmarshal()
5829 if (*target == TPM_PT_LOCKOUT_COUNTER) { in TPM_PT_Unmarshal()
5832 if (*target == TPM_PT_MAX_AUTH_FAIL) { in TPM_PT_Unmarshal()
5835 if (*target == TPM_PT_LOCKOUT_INTERVAL) { in TPM_PT_Unmarshal()
5838 if (*target == TPM_PT_LOCKOUT_RECOVERY) { in TPM_PT_Unmarshal()
5841 if (*target == TPM_PT_NV_WRITE_RECOVERY) { in TPM_PT_Unmarshal()
5844 if (*target == TPM_PT_AUDIT_COUNTER_0) { in TPM_PT_Unmarshal()
5847 if (*target == TPM_PT_AUDIT_COUNTER_1) { in TPM_PT_Unmarshal()
5858 total_size += TPM_PT_Marshal(&source->tag, buffer, size); in TPMS_TAGGED_PCR_SELECT_Marshal()
5859 total_size += UINT8_Marshal(&source->sizeofSelect, buffer, size); in TPMS_TAGGED_PCR_SELECT_Marshal()
5860 for (i = 0; i < source->sizeofSelect; ++i) { in TPMS_TAGGED_PCR_SELECT_Marshal()
5861 total_size += BYTE_Marshal(&source->pcrSelect[i], buffer, size); in TPMS_TAGGED_PCR_SELECT_Marshal()
5866 TPM_RC TPMS_TAGGED_PCR_SELECT_Unmarshal(TPMS_TAGGED_PCR_SELECT* target, in TPMS_TAGGED_PCR_SELECT_Unmarshal() argument
5871 result = TPM_PT_Unmarshal(&target->tag, buffer, size); in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5875 result = UINT8_Unmarshal(&target->sizeofSelect, buffer, size); in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5879 if (target->sizeofSelect > PCR_SELECT_MAX) { in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5882 if (target->sizeofSelect < PCR_SELECT_MIN) { in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5885 for (i = 0; i < target->sizeofSelect; ++i) { in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5886 result = BYTE_Unmarshal(&target->pcrSelect[i], buffer, size); in TPMS_TAGGED_PCR_SELECT_Unmarshal()
5899 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_TAGGED_PCR_PROPERTY_Marshal()
5900 for (i = 0; i < source->count; ++i) { in TPML_TAGGED_PCR_PROPERTY_Marshal()
5902 TPMS_TAGGED_PCR_SELECT_Marshal(&source->pcrProperty[i], buffer, size); in TPML_TAGGED_PCR_PROPERTY_Marshal()
5907 TPM_RC TPML_TAGGED_PCR_PROPERTY_Unmarshal(TPML_TAGGED_PCR_PROPERTY* target, in TPML_TAGGED_PCR_PROPERTY_Unmarshal() argument
5912 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_TAGGED_PCR_PROPERTY_Unmarshal()
5916 if (target->count > MAX_PCR_PROPERTIES) { in TPML_TAGGED_PCR_PROPERTY_Unmarshal()
5919 for (i = 0; i < target->count; ++i) { in TPML_TAGGED_PCR_PROPERTY_Unmarshal()
5921 TPMS_TAGGED_PCR_SELECT_Unmarshal(&target->pcrProperty[i], buffer, size); in TPML_TAGGED_PCR_PROPERTY_Unmarshal()
5933 total_size += TPM_PT_Marshal(&source->property, buffer, size); in TPMS_TAGGED_PROPERTY_Marshal()
5934 total_size += UINT32_Marshal(&source->value, buffer, size); in TPMS_TAGGED_PROPERTY_Marshal()
5938 TPM_RC TPMS_TAGGED_PROPERTY_Unmarshal(TPMS_TAGGED_PROPERTY* target, in TPMS_TAGGED_PROPERTY_Unmarshal() argument
5942 result = TPM_PT_Unmarshal(&target->property, buffer, size); in TPMS_TAGGED_PROPERTY_Unmarshal()
5946 result = UINT32_Unmarshal(&target->value, buffer, size); in TPMS_TAGGED_PROPERTY_Unmarshal()
5958 total_size += UINT32_Marshal(&source->count, buffer, size); in TPML_TAGGED_TPM_PROPERTY_Marshal()
5959 for (i = 0; i < source->count; ++i) { in TPML_TAGGED_TPM_PROPERTY_Marshal()
5961 TPMS_TAGGED_PROPERTY_Marshal(&source->tpmProperty[i], buffer, size); in TPML_TAGGED_TPM_PROPERTY_Marshal()
5966 TPM_RC TPML_TAGGED_TPM_PROPERTY_Unmarshal(TPML_TAGGED_TPM_PROPERTY* target, in TPML_TAGGED_TPM_PROPERTY_Unmarshal() argument
5971 result = UINT32_Unmarshal(&target->count, buffer, size); in TPML_TAGGED_TPM_PROPERTY_Unmarshal()
5975 if (target->count > MAX_TPM_PROPERTIES) { in TPML_TAGGED_TPM_PROPERTY_Unmarshal()
5978 for (i = 0; i < target->count; ++i) { in TPML_TAGGED_TPM_PROPERTY_Unmarshal()
5980 TPMS_TAGGED_PROPERTY_Unmarshal(&target->tpmProperty[i], buffer, size); in TPML_TAGGED_TPM_PROPERTY_Unmarshal()
5992 total_size += TPM_ALG_ID_Marshal(&source->alg, buffer, size); in TPMS_ALGORITHM_DESCRIPTION_Marshal()
5993 total_size += TPMA_ALGORITHM_Marshal(&source->attributes, buffer, size); in TPMS_ALGORITHM_DESCRIPTION_Marshal()
5997 TPM_RC TPMS_ALGORITHM_DESCRIPTION_Unmarshal(TPMS_ALGORITHM_DESCRIPTION* target, in TPMS_ALGORITHM_DESCRIPTION_Unmarshal() argument
6001 result = TPM_ALG_ID_Unmarshal(&target->alg, buffer, size); in TPMS_ALGORITHM_DESCRIPTION_Unmarshal()
6005 result = TPMA_ALGORITHM_Unmarshal(&target->attributes, buffer, size); in TPMS_ALGORITHM_DESCRIPTION_Unmarshal()
6016 total_size += TPM_ECC_CURVE_Marshal(&source->curveID, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6017 total_size += UINT16_Marshal(&source->keySize, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6018 total_size += TPMT_KDF_SCHEME_Marshal(&source->kdf, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6019 total_size += TPMT_ECC_SCHEME_Marshal(&source->sign, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6020 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->p, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6021 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->a, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6022 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->b, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6023 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->gX, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6024 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->gY, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6025 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->n, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6026 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->h, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Marshal()
6030 TPM_RC TPMS_ALGORITHM_DETAIL_ECC_Unmarshal(TPMS_ALGORITHM_DETAIL_ECC* target, in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal() argument
6034 result = TPM_ECC_CURVE_Unmarshal(&target->curveID, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6038 result = UINT16_Unmarshal(&target->keySize, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6042 result = TPMT_KDF_SCHEME_Unmarshal(&target->kdf, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6046 result = TPMT_ECC_SCHEME_Unmarshal(&target->sign, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6050 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->p, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6054 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->a, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6058 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->b, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6062 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->gX, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6066 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->gY, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6070 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->n, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6074 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->h, buffer, size); in TPMS_ALGORITHM_DETAIL_ECC_Unmarshal()
6085 TPM_RC UINT64_Unmarshal(UINT64* target, BYTE** buffer, INT32* size) { in UINT64_Unmarshal() argument
6086 return uint64_t_Unmarshal(target, buffer, size); in UINT64_Unmarshal()
6095 TPM_RC TPM_GENERATED_Unmarshal(TPM_GENERATED* target, in TPM_GENERATED_Unmarshal() argument
6099 result = uint32_t_Unmarshal(target, buffer, size); in TPM_GENERATED_Unmarshal()
6103 if (*target == TPM_GENERATED_VALUE) { in TPM_GENERATED_Unmarshal()
6113 total_size += TPM2B_NAME_Marshal(&source->objectName, buffer, size); in TPMS_CREATION_INFO_Marshal()
6114 total_size += TPM2B_DIGEST_Marshal(&source->creationHash, buffer, size); in TPMS_CREATION_INFO_Marshal()
6118 TPM_RC TPMS_CREATION_INFO_Unmarshal(TPMS_CREATION_INFO* target, in TPMS_CREATION_INFO_Unmarshal() argument
6122 result = TPM2B_NAME_Unmarshal(&target->objectName, buffer, size); in TPMS_CREATION_INFO_Unmarshal()
6126 result = TPM2B_DIGEST_Unmarshal(&target->creationHash, buffer, size); in TPMS_CREATION_INFO_Unmarshal()
6137 total_size += UINT64_Marshal(&source->auditCounter, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Marshal()
6138 total_size += TPM_ALG_ID_Marshal(&source->digestAlg, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Marshal()
6139 total_size += TPM2B_DIGEST_Marshal(&source->auditDigest, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Marshal()
6140 total_size += TPM2B_DIGEST_Marshal(&source->commandDigest, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Marshal()
6144 TPM_RC TPMS_COMMAND_AUDIT_INFO_Unmarshal(TPMS_COMMAND_AUDIT_INFO* target, in TPMS_COMMAND_AUDIT_INFO_Unmarshal() argument
6148 result = UINT64_Unmarshal(&target->auditCounter, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Unmarshal()
6152 result = TPM_ALG_ID_Unmarshal(&target->digestAlg, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Unmarshal()
6156 result = TPM2B_DIGEST_Unmarshal(&target->auditDigest, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Unmarshal()
6160 result = TPM2B_DIGEST_Unmarshal(&target->commandDigest, buffer, size); in TPMS_COMMAND_AUDIT_INFO_Unmarshal()
6171 total_size += TPML_PCR_SELECTION_Marshal(&source->pcrSelect, buffer, size); in TPMS_QUOTE_INFO_Marshal()
6172 total_size += TPM2B_DIGEST_Marshal(&source->pcrDigest, buffer, size); in TPMS_QUOTE_INFO_Marshal()
6176 TPM_RC TPMS_QUOTE_INFO_Unmarshal(TPMS_QUOTE_INFO* target, in TPMS_QUOTE_INFO_Unmarshal() argument
6180 result = TPML_PCR_SELECTION_Unmarshal(&target->pcrSelect, buffer, size); in TPMS_QUOTE_INFO_Unmarshal()
6184 result = TPM2B_DIGEST_Unmarshal(&target->pcrDigest, buffer, size); in TPMS_QUOTE_INFO_Unmarshal()
6195 total_size += TPM2B_NAME_Marshal(&source->name, buffer, size); in TPMS_CERTIFY_INFO_Marshal()
6196 total_size += TPM2B_NAME_Marshal(&source->qualifiedName, buffer, size); in TPMS_CERTIFY_INFO_Marshal()
6200 TPM_RC TPMS_CERTIFY_INFO_Unmarshal(TPMS_CERTIFY_INFO* target, in TPMS_CERTIFY_INFO_Unmarshal() argument
6204 result = TPM2B_NAME_Unmarshal(&target->name, buffer, size); in TPMS_CERTIFY_INFO_Unmarshal()
6208 result = TPM2B_NAME_Unmarshal(&target->qualifiedName, buffer, size); in TPMS_CERTIFY_INFO_Unmarshal()
6219 total_size += TPMI_YES_NO_Marshal(&source->exclusiveSession, buffer, size); in TPMS_SESSION_AUDIT_INFO_Marshal()
6220 total_size += TPM2B_DIGEST_Marshal(&source->sessionDigest, buffer, size); in TPMS_SESSION_AUDIT_INFO_Marshal()
6224 TPM_RC TPMS_SESSION_AUDIT_INFO_Unmarshal(TPMS_SESSION_AUDIT_INFO* target, in TPMS_SESSION_AUDIT_INFO_Unmarshal() argument
6228 result = TPMI_YES_NO_Unmarshal(&target->exclusiveSession, buffer, size); in TPMS_SESSION_AUDIT_INFO_Unmarshal()
6232 result = TPM2B_DIGEST_Unmarshal(&target->sessionDigest, buffer, size); in TPMS_SESSION_AUDIT_INFO_Unmarshal()
6243 total_size += UINT64_Marshal(&source->clock, buffer, size); in TPMS_CLOCK_INFO_Marshal()
6244 total_size += UINT32_Marshal(&source->resetCount, buffer, size); in TPMS_CLOCK_INFO_Marshal()
6245 total_size += UINT32_Marshal(&source->restartCount, buffer, size); in TPMS_CLOCK_INFO_Marshal()
6246 total_size += TPMI_YES_NO_Marshal(&source->safe, buffer, size); in TPMS_CLOCK_INFO_Marshal()
6250 TPM_RC TPMS_CLOCK_INFO_Unmarshal(TPMS_CLOCK_INFO* target, in TPMS_CLOCK_INFO_Unmarshal() argument
6254 result = UINT64_Unmarshal(&target->clock, buffer, size); in TPMS_CLOCK_INFO_Unmarshal()
6258 result = UINT32_Unmarshal(&target->resetCount, buffer, size); in TPMS_CLOCK_INFO_Unmarshal()
6262 result = UINT32_Unmarshal(&target->restartCount, buffer, size); in TPMS_CLOCK_INFO_Unmarshal()
6266 result = TPMI_YES_NO_Unmarshal(&target->safe, buffer, size); in TPMS_CLOCK_INFO_Unmarshal()
6277 total_size += UINT64_Marshal(&source->time, buffer, size); in TPMS_TIME_INFO_Marshal()
6278 total_size += TPMS_CLOCK_INFO_Marshal(&source->clockInfo, buffer, size); in TPMS_TIME_INFO_Marshal()
6282 TPM_RC TPMS_TIME_INFO_Unmarshal(TPMS_TIME_INFO* target, in TPMS_TIME_INFO_Unmarshal() argument
6286 result = UINT64_Unmarshal(&target->time, buffer, size); in TPMS_TIME_INFO_Unmarshal()
6290 result = TPMS_CLOCK_INFO_Unmarshal(&target->clockInfo, buffer, size); in TPMS_TIME_INFO_Unmarshal()
6301 total_size += TPMS_TIME_INFO_Marshal(&source->time, buffer, size); in TPMS_TIME_ATTEST_INFO_Marshal()
6302 total_size += UINT64_Marshal(&source->firmwareVersion, buffer, size); in TPMS_TIME_ATTEST_INFO_Marshal()
6306 TPM_RC TPMS_TIME_ATTEST_INFO_Unmarshal(TPMS_TIME_ATTEST_INFO* target, in TPMS_TIME_ATTEST_INFO_Unmarshal() argument
6310 result = TPMS_TIME_INFO_Unmarshal(&target->time, buffer, size); in TPMS_TIME_ATTEST_INFO_Unmarshal()
6314 result = UINT64_Unmarshal(&target->firmwareVersion, buffer, size); in TPMS_TIME_ATTEST_INFO_Unmarshal()
6325 total_size += TPM2B_NAME_Marshal(&source->indexName, buffer, size); in TPMS_NV_CERTIFY_INFO_Marshal()
6326 total_size += UINT16_Marshal(&source->offset, buffer, size); in TPMS_NV_CERTIFY_INFO_Marshal()
6327 total_size += TPM2B_MAX_NV_BUFFER_Marshal(&source->nvContents, buffer, size); in TPMS_NV_CERTIFY_INFO_Marshal()
6331 TPM_RC TPMS_NV_CERTIFY_INFO_Unmarshal(TPMS_NV_CERTIFY_INFO* target, in TPMS_NV_CERTIFY_INFO_Unmarshal() argument
6335 result = TPM2B_NAME_Unmarshal(&target->indexName, buffer, size); in TPMS_NV_CERTIFY_INFO_Unmarshal()
6339 result = UINT16_Unmarshal(&target->offset, buffer, size); in TPMS_NV_CERTIFY_INFO_Unmarshal()
6343 result = TPM2B_MAX_NV_BUFFER_Unmarshal(&target->nvContents, buffer, size); in TPMS_NV_CERTIFY_INFO_Unmarshal()
6356 return TPMS_CERTIFY_INFO_Marshal((TPMS_CERTIFY_INFO*)&source->certify, in TPMU_ATTEST_Marshal()
6359 return TPMS_CREATION_INFO_Marshal((TPMS_CREATION_INFO*)&source->creation, in TPMU_ATTEST_Marshal()
6362 return TPMS_QUOTE_INFO_Marshal((TPMS_QUOTE_INFO*)&source->quote, buffer, in TPMU_ATTEST_Marshal()
6366 (TPMS_COMMAND_AUDIT_INFO*)&source->commandAudit, buffer, size); in TPMU_ATTEST_Marshal()
6369 (TPMS_SESSION_AUDIT_INFO*)&source->sessionAudit, buffer, size); in TPMU_ATTEST_Marshal()
6372 (TPMS_TIME_ATTEST_INFO*)&source->time, buffer, size); in TPMU_ATTEST_Marshal()
6374 return TPMS_NV_CERTIFY_INFO_Marshal((TPMS_NV_CERTIFY_INFO*)&source->nv, in TPMU_ATTEST_Marshal()
6380 TPM_RC TPMU_ATTEST_Unmarshal(TPMU_ATTEST* target, in TPMU_ATTEST_Unmarshal() argument
6386 return TPMS_CERTIFY_INFO_Unmarshal((TPMS_CERTIFY_INFO*)&target->certify, in TPMU_ATTEST_Unmarshal()
6390 (TPMS_CREATION_INFO*)&target->creation, buffer, size); in TPMU_ATTEST_Unmarshal()
6392 return TPMS_QUOTE_INFO_Unmarshal((TPMS_QUOTE_INFO*)&target->quote, buffer, in TPMU_ATTEST_Unmarshal()
6396 (TPMS_COMMAND_AUDIT_INFO*)&target->commandAudit, buffer, size); in TPMU_ATTEST_Unmarshal()
6399 (TPMS_SESSION_AUDIT_INFO*)&target->sessionAudit, buffer, size); in TPMU_ATTEST_Unmarshal()
6402 (TPMS_TIME_ATTEST_INFO*)&target->time, buffer, size); in TPMU_ATTEST_Unmarshal()
6404 return TPMS_NV_CERTIFY_INFO_Unmarshal((TPMS_NV_CERTIFY_INFO*)&target->nv, in TPMU_ATTEST_Unmarshal()
6412 total_size += TPM_GENERATED_Marshal(&source->magic, buffer, size); in TPMS_ATTEST_Marshal()
6413 total_size += TPMI_ST_ATTEST_Marshal(&source->type, buffer, size); in TPMS_ATTEST_Marshal()
6414 total_size += TPM2B_NAME_Marshal(&source->qualifiedSigner, buffer, size); in TPMS_ATTEST_Marshal()
6415 total_size += TPM2B_DATA_Marshal(&source->extraData, buffer, size); in TPMS_ATTEST_Marshal()
6416 total_size += TPMS_CLOCK_INFO_Marshal(&source->clockInfo, buffer, size); in TPMS_ATTEST_Marshal()
6417 total_size += UINT64_Marshal(&source->firmwareVersion, buffer, size); in TPMS_ATTEST_Marshal()
6419 TPMU_ATTEST_Marshal(&source->attested, buffer, size, source->type); in TPMS_ATTEST_Marshal()
6423 TPM_RC TPMS_ATTEST_Unmarshal(TPMS_ATTEST* target, BYTE** buffer, INT32* size) { in TPMS_ATTEST_Unmarshal() argument
6425 result = TPM_GENERATED_Unmarshal(&target->magic, buffer, size); in TPMS_ATTEST_Unmarshal()
6429 result = TPMI_ST_ATTEST_Unmarshal(&target->type, buffer, size); in TPMS_ATTEST_Unmarshal()
6433 result = TPM2B_NAME_Unmarshal(&target->qualifiedSigner, buffer, size); in TPMS_ATTEST_Unmarshal()
6437 result = TPM2B_DATA_Unmarshal(&target->extraData, buffer, size); in TPMS_ATTEST_Unmarshal()
6441 result = TPMS_CLOCK_INFO_Unmarshal(&target->clockInfo, buffer, size); in TPMS_ATTEST_Unmarshal()
6445 result = UINT64_Unmarshal(&target->firmwareVersion, buffer, size); in TPMS_ATTEST_Unmarshal()
6449 result = TPMU_ATTEST_Unmarshal(&target->attested, buffer, size, target->type); in TPMS_ATTEST_Unmarshal()
6461 TPMI_SH_AUTH_SESSION_Marshal(&source->sessionHandle, buffer, size); in TPMS_AUTH_COMMAND_Marshal()
6462 total_size += TPM2B_NONCE_Marshal(&source->nonce, buffer, size); in TPMS_AUTH_COMMAND_Marshal()
6463 total_size += TPMA_SESSION_Marshal(&source->sessionAttributes, buffer, size); in TPMS_AUTH_COMMAND_Marshal()
6464 total_size += TPM2B_AUTH_Marshal(&source->hmac, buffer, size); in TPMS_AUTH_COMMAND_Marshal()
6468 TPM_RC TPMS_AUTH_COMMAND_Unmarshal(TPMS_AUTH_COMMAND* target, in TPMS_AUTH_COMMAND_Unmarshal() argument
6472 result = TPMI_SH_AUTH_SESSION_Unmarshal(&target->sessionHandle, buffer, size, in TPMS_AUTH_COMMAND_Unmarshal()
6477 result = TPM2B_NONCE_Unmarshal(&target->nonce, buffer, size); in TPMS_AUTH_COMMAND_Unmarshal()
6481 result = TPMA_SESSION_Unmarshal(&target->sessionAttributes, buffer, size); in TPMS_AUTH_COMMAND_Unmarshal()
6485 result = TPM2B_AUTH_Unmarshal(&target->hmac, buffer, size); in TPMS_AUTH_COMMAND_Unmarshal()
6496 total_size += TPM2B_NONCE_Marshal(&source->nonce, buffer, size); in TPMS_AUTH_RESPONSE_Marshal()
6497 total_size += TPMA_SESSION_Marshal(&source->sessionAttributes, buffer, size); in TPMS_AUTH_RESPONSE_Marshal()
6498 total_size += TPM2B_AUTH_Marshal(&source->hmac, buffer, size); in TPMS_AUTH_RESPONSE_Marshal()
6502 TPM_RC TPMS_AUTH_RESPONSE_Unmarshal(TPMS_AUTH_RESPONSE* target, in TPMS_AUTH_RESPONSE_Unmarshal() argument
6506 result = TPM2B_NONCE_Unmarshal(&target->nonce, buffer, size); in TPMS_AUTH_RESPONSE_Unmarshal()
6510 result = TPMA_SESSION_Unmarshal(&target->sessionAttributes, buffer, size); in TPMS_AUTH_RESPONSE_Unmarshal()
6514 result = TPM2B_AUTH_Unmarshal(&target->hmac, buffer, size); in TPMS_AUTH_RESPONSE_Unmarshal()
6525 TPM_RC TPM_CAP_Unmarshal(TPM_CAP* target, BYTE** buffer, INT32* size) { in TPM_CAP_Unmarshal() argument
6527 result = uint32_t_Unmarshal(target, buffer, size); in TPM_CAP_Unmarshal()
6531 if (*target == TPM_CAP_FIRST) { in TPM_CAP_Unmarshal()
6534 if (*target == TPM_CAP_ALGS) { in TPM_CAP_Unmarshal()
6537 if (*target == TPM_CAP_HANDLES) { in TPM_CAP_Unmarshal()
6540 if (*target == TPM_CAP_COMMANDS) { in TPM_CAP_Unmarshal()
6543 if (*target == TPM_CAP_PP_COMMANDS) { in TPM_CAP_Unmarshal()
6546 if (*target == TPM_CAP_AUDIT_COMMANDS) { in TPM_CAP_Unmarshal()
6549 if (*target == TPM_CAP_PCRS) { in TPM_CAP_Unmarshal()
6552 if (*target == TPM_CAP_TPM_PROPERTIES) { in TPM_CAP_Unmarshal()
6555 if (*target == TPM_CAP_PCR_PROPERTIES) { in TPM_CAP_Unmarshal()
6558 if (*target == TPM_CAP_ECC_CURVES) { in TPM_CAP_Unmarshal()
6561 if (*target == TPM_CAP_LAST) { in TPM_CAP_Unmarshal()
6564 if (*target == TPM_CAP_VENDOR_PROPERTY) { in TPM_CAP_Unmarshal()
6576 return TPML_ALG_PROPERTY_Marshal((TPML_ALG_PROPERTY*)&source->algorithms, in TPMU_CAPABILITIES_Marshal()
6579 return TPML_HANDLE_Marshal((TPML_HANDLE*)&source->handles, buffer, size); in TPMU_CAPABILITIES_Marshal()
6581 return TPML_CCA_Marshal((TPML_CCA*)&source->command, buffer, size); in TPMU_CAPABILITIES_Marshal()
6583 return TPML_CC_Marshal((TPML_CC*)&source->ppCommands, buffer, size); in TPMU_CAPABILITIES_Marshal()
6585 return TPML_CC_Marshal((TPML_CC*)&source->auditCommands, buffer, size); in TPMU_CAPABILITIES_Marshal()
6588 (TPML_PCR_SELECTION*)&source->assignedPCR, buffer, size); in TPMU_CAPABILITIES_Marshal()
6591 (TPML_TAGGED_TPM_PROPERTY*)&source->tpmProperties, buffer, size); in TPMU_CAPABILITIES_Marshal()
6594 (TPML_TAGGED_PCR_PROPERTY*)&source->pcrProperties, buffer, size); in TPMU_CAPABILITIES_Marshal()
6596 return TPML_ECC_CURVE_Marshal((TPML_ECC_CURVE*)&source->eccCurves, buffer, in TPMU_CAPABILITIES_Marshal()
6602 TPM_RC TPMU_CAPABILITIES_Unmarshal(TPMU_CAPABILITIES* target, in TPMU_CAPABILITIES_Unmarshal() argument
6609 (TPML_ALG_PROPERTY*)&target->algorithms, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6611 return TPML_HANDLE_Unmarshal((TPML_HANDLE*)&target->handles, buffer, in TPMU_CAPABILITIES_Unmarshal()
6614 return TPML_CCA_Unmarshal((TPML_CCA*)&target->command, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6616 return TPML_CC_Unmarshal((TPML_CC*)&target->ppCommands, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6618 return TPML_CC_Unmarshal((TPML_CC*)&target->auditCommands, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6621 (TPML_PCR_SELECTION*)&target->assignedPCR, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6624 (TPML_TAGGED_TPM_PROPERTY*)&target->tpmProperties, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6627 (TPML_TAGGED_PCR_PROPERTY*)&target->pcrProperties, buffer, size); in TPMU_CAPABILITIES_Unmarshal()
6629 return TPML_ECC_CURVE_Unmarshal((TPML_ECC_CURVE*)&target->eccCurves, in TPMU_CAPABILITIES_Unmarshal()
6639 total_size += TPM_CAP_Marshal(&source->capability, buffer, size); in TPMS_CAPABILITY_DATA_Marshal()
6640 total_size += TPMU_CAPABILITIES_Marshal(&source->data, buffer, size, in TPMS_CAPABILITY_DATA_Marshal()
6641 source->capability); in TPMS_CAPABILITY_DATA_Marshal()
6645 TPM_RC TPMS_CAPABILITY_DATA_Unmarshal(TPMS_CAPABILITY_DATA* target, in TPMS_CAPABILITY_DATA_Unmarshal() argument
6649 result = TPM_CAP_Unmarshal(&target->capability, buffer, size); in TPMS_CAPABILITY_DATA_Unmarshal()
6653 result = TPMU_CAPABILITIES_Unmarshal(&target->data, buffer, size, in TPMS_CAPABILITY_DATA_Unmarshal()
6654 target->capability); in TPMS_CAPABILITY_DATA_Unmarshal()
6663 total_size += UINT64_Marshal(&source->sequence, buffer, size); in TPMS_CONTEXT_Marshal()
6664 total_size += TPMI_DH_CONTEXT_Marshal(&source->savedHandle, buffer, size); in TPMS_CONTEXT_Marshal()
6665 total_size += TPMI_RH_HIERARCHY_Marshal(&source->hierarchy, buffer, size); in TPMS_CONTEXT_Marshal()
6666 total_size += TPM2B_CONTEXT_DATA_Marshal(&source->contextBlob, buffer, size); in TPMS_CONTEXT_Marshal()
6670 TPM_RC TPMS_CONTEXT_Unmarshal(TPMS_CONTEXT* target, in TPMS_CONTEXT_Unmarshal() argument
6674 result = UINT64_Unmarshal(&target->sequence, buffer, size); in TPMS_CONTEXT_Unmarshal()
6678 result = TPMI_DH_CONTEXT_Unmarshal(&target->savedHandle, buffer, size); in TPMS_CONTEXT_Unmarshal()
6682 result = TPMI_RH_HIERARCHY_Unmarshal(&target->hierarchy, buffer, size, TRUE); in TPMS_CONTEXT_Unmarshal()
6686 result = TPM2B_CONTEXT_DATA_Unmarshal(&target->contextBlob, buffer, size); in TPMS_CONTEXT_Unmarshal()
6697 total_size += TPM2B_DIGEST_Marshal(&source->integrity, buffer, size); in TPMS_CONTEXT_DATA_Marshal()
6699 TPM2B_CONTEXT_SENSITIVE_Marshal(&source->encrypted, buffer, size); in TPMS_CONTEXT_DATA_Marshal()
6703 TPM_RC TPMS_CONTEXT_DATA_Unmarshal(TPMS_CONTEXT_DATA* target, in TPMS_CONTEXT_DATA_Unmarshal() argument
6707 result = TPM2B_DIGEST_Unmarshal(&target->integrity, buffer, size); in TPMS_CONTEXT_DATA_Unmarshal()
6711 result = TPM2B_CONTEXT_SENSITIVE_Unmarshal(&target->encrypted, buffer, size); in TPMS_CONTEXT_DATA_Unmarshal()
6723 total_size += UINT8_Marshal(&source->sizeofSelect, buffer, size); in TPMS_PCR_SELECT_Marshal()
6724 for (i = 0; i < source->sizeofSelect; ++i) { in TPMS_PCR_SELECT_Marshal()
6725 total_size += BYTE_Marshal(&source->pcrSelect[i], buffer, size); in TPMS_PCR_SELECT_Marshal()
6730 TPM_RC TPMS_PCR_SELECT_Unmarshal(TPMS_PCR_SELECT* target, in TPMS_PCR_SELECT_Unmarshal() argument
6735 result = UINT8_Unmarshal(&target->sizeofSelect, buffer, size); in TPMS_PCR_SELECT_Unmarshal()
6739 if (target->sizeofSelect > PCR_SELECT_MAX) { in TPMS_PCR_SELECT_Unmarshal()
6742 if (target->sizeofSelect < PCR_SELECT_MIN) { in TPMS_PCR_SELECT_Unmarshal()
6745 for (i = 0; i < target->sizeofSelect; ++i) { in TPMS_PCR_SELECT_Unmarshal()
6746 result = BYTE_Unmarshal(&target->pcrSelect[i], buffer, size); in TPMS_PCR_SELECT_Unmarshal()
6758 total_size += TPMI_ALG_HASH_Marshal(&source->hash, buffer, size); in TPMS_SIGNATURE_ECC_Marshal()
6759 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->signatureR, buffer, size); in TPMS_SIGNATURE_ECC_Marshal()
6760 total_size += TPM2B_ECC_PARAMETER_Marshal(&source->signatureS, buffer, size); in TPMS_SIGNATURE_ECC_Marshal()
6764 TPM_RC TPMS_SIGNATURE_ECC_Unmarshal(TPMS_SIGNATURE_ECC* target, in TPMS_SIGNATURE_ECC_Unmarshal() argument
6768 result = TPMI_ALG_HASH_Unmarshal(&target->hash, buffer, size, FALSE); in TPMS_SIGNATURE_ECC_Unmarshal()
6772 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->signatureR, buffer, size); in TPMS_SIGNATURE_ECC_Unmarshal()
6776 result = TPM2B_ECC_PARAMETER_Unmarshal(&target->signatureS, buffer, size); in TPMS_SIGNATURE_ECC_Unmarshal()
6789 TPM_RC TPMS_SIGNATURE_ECDAA_Unmarshal(TPMS_SIGNATURE_ECDAA* target, in TPMS_SIGNATURE_ECDAA_Unmarshal() argument
6792 return TPMS_SIGNATURE_ECC_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_ECDAA_Unmarshal()
6801 TPM_RC TPMS_SIGNATURE_ECDSA_Unmarshal(TPMS_SIGNATURE_ECDSA* target, in TPMS_SIGNATURE_ECDSA_Unmarshal() argument
6804 return TPMS_SIGNATURE_ECC_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_ECDSA_Unmarshal()
6813 TPM_RC TPMS_SIGNATURE_ECSCHNORR_Unmarshal(TPMS_SIGNATURE_ECSCHNORR* target, in TPMS_SIGNATURE_ECSCHNORR_Unmarshal() argument
6816 return TPMS_SIGNATURE_ECC_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_ECSCHNORR_Unmarshal()
6823 total_size += TPMI_ALG_HASH_Marshal(&source->hash, buffer, size); in TPMS_SIGNATURE_RSA_Marshal()
6824 total_size += TPM2B_PUBLIC_KEY_RSA_Marshal(&source->sig, buffer, size); in TPMS_SIGNATURE_RSA_Marshal()
6828 TPM_RC TPMS_SIGNATURE_RSA_Unmarshal(TPMS_SIGNATURE_RSA* target, in TPMS_SIGNATURE_RSA_Unmarshal() argument
6832 result = TPMI_ALG_HASH_Unmarshal(&target->hash, buffer, size, FALSE); in TPMS_SIGNATURE_RSA_Unmarshal()
6836 result = TPM2B_PUBLIC_KEY_RSA_Unmarshal(&target->sig, buffer, size); in TPMS_SIGNATURE_RSA_Unmarshal()
6849 TPM_RC TPMS_SIGNATURE_RSAPSS_Unmarshal(TPMS_SIGNATURE_RSAPSS* target, in TPMS_SIGNATURE_RSAPSS_Unmarshal() argument
6852 return TPMS_SIGNATURE_RSA_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_RSAPSS_Unmarshal()
6861 TPM_RC TPMS_SIGNATURE_RSASSA_Unmarshal(TPMS_SIGNATURE_RSASSA* target, in TPMS_SIGNATURE_RSASSA_Unmarshal() argument
6864 return TPMS_SIGNATURE_RSA_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_RSASSA_Unmarshal()
6873 TPM_RC TPMS_SIGNATURE_SM2_Unmarshal(TPMS_SIGNATURE_SM2* target, in TPMS_SIGNATURE_SM2_Unmarshal() argument
6876 return TPMS_SIGNATURE_ECC_Unmarshal(target, buffer, size); in TPMS_SIGNATURE_SM2_Unmarshal()
6883 total_size += TPMI_ALG_PUBLIC_Marshal(&source->type, buffer, size); in TPMT_PUBLIC_PARMS_Marshal()
6884 total_size += TPMU_PUBLIC_PARMS_Marshal(&source->parameters, buffer, size, in TPMT_PUBLIC_PARMS_Marshal()
6885 source->type); in TPMT_PUBLIC_PARMS_Marshal()
6889 TPM_RC TPMT_PUBLIC_PARMS_Unmarshal(TPMT_PUBLIC_PARMS* target, in TPMT_PUBLIC_PARMS_Unmarshal() argument
6893 result = TPMI_ALG_PUBLIC_Unmarshal(&target->type, buffer, size); in TPMT_PUBLIC_PARMS_Unmarshal()
6897 result = TPMU_PUBLIC_PARMS_Unmarshal(&target->parameters, buffer, size, in TPMT_PUBLIC_PARMS_Unmarshal()
6898 target->type); in TPMT_PUBLIC_PARMS_Unmarshal()
6909 total_size += TPMI_ALG_RSA_DECRYPT_Marshal(&source->scheme, buffer, size); in TPMT_RSA_DECRYPT_Marshal()
6911 TPMU_ASYM_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_RSA_DECRYPT_Marshal()
6915 TPM_RC TPMT_RSA_DECRYPT_Unmarshal(TPMT_RSA_DECRYPT* target, in TPMT_RSA_DECRYPT_Unmarshal() argument
6919 result = TPMI_ALG_RSA_DECRYPT_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_RSA_DECRYPT_Unmarshal()
6923 result = TPMU_ASYM_SCHEME_Unmarshal(&target->details, buffer, size, in TPMT_RSA_DECRYPT_Unmarshal()
6924 target->scheme); in TPMT_RSA_DECRYPT_Unmarshal()
6939 (TPMS_SIGNATURE_RSASSA*)&source->rsassa, buffer, size); in TPMU_SIGNATURE_Marshal()
6944 (TPMS_SIGNATURE_RSAPSS*)&source->rsapss, buffer, size); in TPMU_SIGNATURE_Marshal()
6948 return TPMS_SIGNATURE_ECDSA_Marshal((TPMS_SIGNATURE_ECDSA*)&source->ecdsa, in TPMU_SIGNATURE_Marshal()
6953 return TPMS_SIGNATURE_ECDAA_Marshal((TPMS_SIGNATURE_ECDAA*)&source->ecdaa, in TPMU_SIGNATURE_Marshal()
6958 return TPMS_SIGNATURE_SM2_Marshal((TPMS_SIGNATURE_SM2*)&source->sm2, in TPMU_SIGNATURE_Marshal()
6964 (TPMS_SIGNATURE_ECSCHNORR*)&source->ecschnorr, buffer, size); in TPMU_SIGNATURE_Marshal()
6968 return TPMT_HA_Marshal((TPMT_HA*)&source->hmac, buffer, size); in TPMU_SIGNATURE_Marshal()
6978 TPM_RC TPMU_SIGNATURE_Unmarshal(TPMU_SIGNATURE* target, in TPMU_SIGNATURE_Unmarshal() argument
6986 (TPMS_SIGNATURE_RSASSA*)&target->rsassa, buffer, size); in TPMU_SIGNATURE_Unmarshal()
6991 (TPMS_SIGNATURE_RSAPSS*)&target->rsapss, buffer, size); in TPMU_SIGNATURE_Unmarshal()
6996 (TPMS_SIGNATURE_ECDSA*)&target->ecdsa, buffer, size); in TPMU_SIGNATURE_Unmarshal()
7001 (TPMS_SIGNATURE_ECDAA*)&target->ecdaa, buffer, size); in TPMU_SIGNATURE_Unmarshal()
7005 return TPMS_SIGNATURE_SM2_Unmarshal((TPMS_SIGNATURE_SM2*)&target->sm2, in TPMU_SIGNATURE_Unmarshal()
7011 (TPMS_SIGNATURE_ECSCHNORR*)&target->ecschnorr, buffer, size); in TPMU_SIGNATURE_Unmarshal()
7015 return TPMT_HA_Unmarshal((TPMT_HA*)&target->hmac, buffer, size); in TPMU_SIGNATURE_Unmarshal()
7029 total_size += TPMI_ALG_SIG_SCHEME_Marshal(&source->sigAlg, buffer, size); in TPMT_SIGNATURE_Marshal()
7031 TPMU_SIGNATURE_Marshal(&source->signature, buffer, size, source->sigAlg); in TPMT_SIGNATURE_Marshal()
7035 TPM_RC TPMT_SIGNATURE_Unmarshal(TPMT_SIGNATURE* target, in TPMT_SIGNATURE_Unmarshal() argument
7039 result = TPMI_ALG_SIG_SCHEME_Unmarshal(&target->sigAlg, buffer, size, TRUE); in TPMT_SIGNATURE_Unmarshal()
7043 result = TPMU_SIGNATURE_Unmarshal(&target->signature, buffer, size, in TPMT_SIGNATURE_Unmarshal()
7044 target->sigAlg); in TPMT_SIGNATURE_Unmarshal()
7059 (TPMS_SIG_SCHEME_RSASSA*)&source->rsassa, buffer, size); in TPMU_SIG_SCHEME_Marshal()
7064 (TPMS_SIG_SCHEME_RSAPSS*)&source->rsapss, buffer, size); in TPMU_SIG_SCHEME_Marshal()
7069 (TPMS_SIG_SCHEME_ECDSA*)&source->ecdsa, buffer, size); in TPMU_SIG_SCHEME_Marshal()
7074 (TPMS_SIG_SCHEME_ECDAA*)&source->ecdaa, buffer, size); in TPMU_SIG_SCHEME_Marshal()
7078 return TPMS_SIG_SCHEME_SM2_Marshal((TPMS_SIG_SCHEME_SM2*)&source->sm2, in TPMU_SIG_SCHEME_Marshal()
7084 (TPMS_SIG_SCHEME_ECSCHNORR*)&source->ecschnorr, buffer, size); in TPMU_SIG_SCHEME_Marshal()
7088 return TPMS_SCHEME_HMAC_Marshal((TPMS_SCHEME_HMAC*)&source->hmac, buffer, in TPMU_SIG_SCHEME_Marshal()
7099 TPM_RC TPMU_SIG_SCHEME_Unmarshal(TPMU_SIG_SCHEME* target, in TPMU_SIG_SCHEME_Unmarshal() argument
7107 (TPMS_SIG_SCHEME_RSASSA*)&target->rsassa, buffer, size); in TPMU_SIG_SCHEME_Unmarshal()
7112 (TPMS_SIG_SCHEME_RSAPSS*)&target->rsapss, buffer, size); in TPMU_SIG_SCHEME_Unmarshal()
7117 (TPMS_SIG_SCHEME_ECDSA*)&target->ecdsa, buffer, size); in TPMU_SIG_SCHEME_Unmarshal()
7122 (TPMS_SIG_SCHEME_ECDAA*)&target->ecdaa, buffer, size); in TPMU_SIG_SCHEME_Unmarshal()
7126 return TPMS_SIG_SCHEME_SM2_Unmarshal((TPMS_SIG_SCHEME_SM2*)&target->sm2, in TPMU_SIG_SCHEME_Unmarshal()
7132 (TPMS_SIG_SCHEME_ECSCHNORR*)&target->ecschnorr, buffer, size); in TPMU_SIG_SCHEME_Unmarshal()
7136 return TPMS_SCHEME_HMAC_Unmarshal((TPMS_SCHEME_HMAC*)&target->hmac, in TPMU_SIG_SCHEME_Unmarshal()
7151 total_size += TPMI_ALG_SIG_SCHEME_Marshal(&source->scheme, buffer, size); in TPMT_SIG_SCHEME_Marshal()
7153 TPMU_SIG_SCHEME_Marshal(&source->details, buffer, size, source->scheme); in TPMT_SIG_SCHEME_Marshal()
7157 TPM_RC TPMT_SIG_SCHEME_Unmarshal(TPMT_SIG_SCHEME* target, in TPMT_SIG_SCHEME_Unmarshal() argument
7161 result = TPMI_ALG_SIG_SCHEME_Unmarshal(&target->scheme, buffer, size, TRUE); in TPMT_SIG_SCHEME_Unmarshal()
7166 TPMU_SIG_SCHEME_Unmarshal(&target->details, buffer, size, target->scheme); in TPMT_SIG_SCHEME_Unmarshal()
7175 total_size += TPMI_ALG_SYM_Marshal(&source->algorithm, buffer, size); in TPMT_SYM_DEF_Marshal()
7176 total_size += TPMU_SYM_KEY_BITS_Marshal(&source->keyBits, buffer, size, in TPMT_SYM_DEF_Marshal()
7177 source->algorithm); in TPMT_SYM_DEF_Marshal()
7179 TPMU_SYM_MODE_Marshal(&source->mode, buffer, size, source->algorithm); in TPMT_SYM_DEF_Marshal()
7183 TPM_RC TPMT_SYM_DEF_Unmarshal(TPMT_SYM_DEF* target, in TPMT_SYM_DEF_Unmarshal() argument
7187 result = TPMI_ALG_SYM_Unmarshal(&target->algorithm, buffer, size, TRUE); in TPMT_SYM_DEF_Unmarshal()
7191 result = TPMU_SYM_KEY_BITS_Unmarshal(&target->keyBits, buffer, size, in TPMT_SYM_DEF_Unmarshal()
7192 target->algorithm); in TPMT_SYM_DEF_Unmarshal()
7197 TPMU_SYM_MODE_Unmarshal(&target->mode, buffer, size, target->algorithm); in TPMT_SYM_DEF_Unmarshal()
7208 TPM_RC TPM_ST_Unmarshal(TPM_ST* target, BYTE** buffer, INT32* size) { in TPM_ST_Unmarshal() argument
7210 result = uint16_t_Unmarshal(target, buffer, size); in TPM_ST_Unmarshal()
7214 if (*target == TPM_ST_RSP_COMMAND) { in TPM_ST_Unmarshal()
7217 if (*target == TPM_ST_NULL) { in TPM_ST_Unmarshal()
7220 if (*target == TPM_ST_NO_SESSIONS) { in TPM_ST_Unmarshal()
7223 if (*target == TPM_ST_SESSIONS) { in TPM_ST_Unmarshal()
7226 if (*target == TPM_ST_ATTEST_NV) { in TPM_ST_Unmarshal()
7229 if (*target == TPM_ST_ATTEST_COMMAND_AUDIT) { in TPM_ST_Unmarshal()
7232 if (*target == TPM_ST_ATTEST_SESSION_AUDIT) { in TPM_ST_Unmarshal()
7235 if (*target == TPM_ST_ATTEST_CERTIFY) { in TPM_ST_Unmarshal()
7238 if (*target == TPM_ST_ATTEST_QUOTE) { in TPM_ST_Unmarshal()
7241 if (*target == TPM_ST_ATTEST_TIME) { in TPM_ST_Unmarshal()
7244 if (*target == TPM_ST_ATTEST_CREATION) { in TPM_ST_Unmarshal()
7247 if (*target == TPM_ST_CREATION) { in TPM_ST_Unmarshal()
7250 if (*target == TPM_ST_VERIFIED) { in TPM_ST_Unmarshal()
7253 if (*target == TPM_ST_AUTH_SECRET) { in TPM_ST_Unmarshal()
7256 if (*target == TPM_ST_HASHCHECK) { in TPM_ST_Unmarshal()
7259 if (*target == TPM_ST_AUTH_SIGNED) { in TPM_ST_Unmarshal()
7262 if (*target == TPM_ST_FU_MANIFEST) { in TPM_ST_Unmarshal()
7270 total_size += TPM_ST_Marshal(&source->tag, buffer, size); in TPMT_TK_AUTH_Marshal()
7271 total_size += TPMI_RH_HIERARCHY_Marshal(&source->hierarchy, buffer, size); in TPMT_TK_AUTH_Marshal()
7272 total_size += TPM2B_DIGEST_Marshal(&source->digest, buffer, size); in TPMT_TK_AUTH_Marshal()
7276 TPM_RC TPMT_TK_AUTH_Unmarshal(TPMT_TK_AUTH* target, in TPMT_TK_AUTH_Unmarshal() argument
7280 result = TPM_ST_Unmarshal(&target->tag, buffer, size); in TPMT_TK_AUTH_Unmarshal()
7284 result = TPMI_RH_HIERARCHY_Unmarshal(&target->hierarchy, buffer, size, TRUE); in TPMT_TK_AUTH_Unmarshal()
7288 result = TPM2B_DIGEST_Unmarshal(&target->digest, buffer, size); in TPMT_TK_AUTH_Unmarshal()
7299 total_size += TPM_ST_Marshal(&source->tag, buffer, size); in TPMT_TK_CREATION_Marshal()
7300 total_size += TPMI_RH_HIERARCHY_Marshal(&source->hierarchy, buffer, size); in TPMT_TK_CREATION_Marshal()
7301 total_size += TPM2B_DIGEST_Marshal(&source->digest, buffer, size); in TPMT_TK_CREATION_Marshal()
7305 TPM_RC TPMT_TK_CREATION_Unmarshal(TPMT_TK_CREATION* target, in TPMT_TK_CREATION_Unmarshal() argument
7309 result = TPM_ST_Unmarshal(&target->tag, buffer, size); in TPMT_TK_CREATION_Unmarshal()
7313 result = TPMI_RH_HIERARCHY_Unmarshal(&target->hierarchy, buffer, size, TRUE); in TPMT_TK_CREATION_Unmarshal()
7317 result = TPM2B_DIGEST_Unmarshal(&target->digest, buffer, size); in TPMT_TK_CREATION_Unmarshal()
7328 total_size += TPM_ST_Marshal(&source->tag, buffer, size); in TPMT_TK_HASHCHECK_Marshal()
7329 total_size += TPMI_RH_HIERARCHY_Marshal(&source->hierarchy, buffer, size); in TPMT_TK_HASHCHECK_Marshal()
7330 total_size += TPM2B_DIGEST_Marshal(&source->digest, buffer, size); in TPMT_TK_HASHCHECK_Marshal()
7334 TPM_RC TPMT_TK_HASHCHECK_Unmarshal(TPMT_TK_HASHCHECK* target, in TPMT_TK_HASHCHECK_Unmarshal() argument
7338 result = TPM_ST_Unmarshal(&target->tag, buffer, size); in TPMT_TK_HASHCHECK_Unmarshal()
7342 result = TPMI_RH_HIERARCHY_Unmarshal(&target->hierarchy, buffer, size, TRUE); in TPMT_TK_HASHCHECK_Unmarshal()
7346 result = TPM2B_DIGEST_Unmarshal(&target->digest, buffer, size); in TPMT_TK_HASHCHECK_Unmarshal()
7357 total_size += TPM_ST_Marshal(&source->tag, buffer, size); in TPMT_TK_VERIFIED_Marshal()
7358 total_size += TPMI_RH_HIERARCHY_Marshal(&source->hierarchy, buffer, size); in TPMT_TK_VERIFIED_Marshal()
7359 total_size += TPM2B_DIGEST_Marshal(&source->digest, buffer, size); in TPMT_TK_VERIFIED_Marshal()
7363 TPM_RC TPMT_TK_VERIFIED_Unmarshal(TPMT_TK_VERIFIED* target, in TPMT_TK_VERIFIED_Unmarshal() argument
7367 result = TPM_ST_Unmarshal(&target->tag, buffer, size); in TPMT_TK_VERIFIED_Unmarshal()
7371 result = TPMI_RH_HIERARCHY_Unmarshal(&target->hierarchy, buffer, size, TRUE); in TPMT_TK_VERIFIED_Unmarshal()
7375 result = TPM2B_DIGEST_Unmarshal(&target->digest, buffer, size); in TPMT_TK_VERIFIED_Unmarshal()
7411 TPM_RC TPMU_SYM_DETAILS_Unmarshal(TPMU_SYM_DETAILS* target, in TPMU_SYM_DETAILS_Unmarshal() argument
7446 TPM_RC TPM_ALGORITHM_ID_Unmarshal(TPM_ALGORITHM_ID* target, in TPM_ALGORITHM_ID_Unmarshal() argument
7449 return uint32_t_Unmarshal(target, buffer, size); in TPM_ALGORITHM_ID_Unmarshal()
7458 TPM_RC TPM_AUTHORIZATION_SIZE_Unmarshal(TPM_AUTHORIZATION_SIZE* target, in TPM_AUTHORIZATION_SIZE_Unmarshal() argument
7461 return uint32_t_Unmarshal(target, buffer, size); in TPM_AUTHORIZATION_SIZE_Unmarshal()
7470 TPM_RC TPM_CLOCK_ADJUST_Unmarshal(TPM_CLOCK_ADJUST* target, in TPM_CLOCK_ADJUST_Unmarshal() argument
7474 result = int8_t_Unmarshal(target, buffer, size); in TPM_CLOCK_ADJUST_Unmarshal()
7478 if (*target == TPM_CLOCK_COARSE_SLOWER) { in TPM_CLOCK_ADJUST_Unmarshal()
7481 if (*target == TPM_CLOCK_MEDIUM_SLOWER) { in TPM_CLOCK_ADJUST_Unmarshal()
7484 if (*target == TPM_CLOCK_FINE_SLOWER) { in TPM_CLOCK_ADJUST_Unmarshal()
7487 if (*target == TPM_CLOCK_NO_CHANGE) { in TPM_CLOCK_ADJUST_Unmarshal()
7490 if (*target == TPM_CLOCK_FINE_FASTER) { in TPM_CLOCK_ADJUST_Unmarshal()
7493 if (*target == TPM_CLOCK_MEDIUM_FASTER) { in TPM_CLOCK_ADJUST_Unmarshal()
7496 if (*target == TPM_CLOCK_COARSE_FASTER) { in TPM_CLOCK_ADJUST_Unmarshal()
7506 TPM_RC TPM_EO_Unmarshal(TPM_EO* target, BYTE** buffer, INT32* size) { in TPM_EO_Unmarshal() argument
7508 result = uint16_t_Unmarshal(target, buffer, size); in TPM_EO_Unmarshal()
7512 if (*target == TPM_EO_EQ) { in TPM_EO_Unmarshal()
7515 if (*target == TPM_EO_NEQ) { in TPM_EO_Unmarshal()
7518 if (*target == TPM_EO_SIGNED_GT) { in TPM_EO_Unmarshal()
7521 if (*target == TPM_EO_UNSIGNED_GT) { in TPM_EO_Unmarshal()
7524 if (*target == TPM_EO_SIGNED_LT) { in TPM_EO_Unmarshal()
7527 if (*target == TPM_EO_UNSIGNED_LT) { in TPM_EO_Unmarshal()
7530 if (*target == TPM_EO_SIGNED_GE) { in TPM_EO_Unmarshal()
7533 if (*target == TPM_EO_UNSIGNED_GE) { in TPM_EO_Unmarshal()
7536 if (*target == TPM_EO_SIGNED_LE) { in TPM_EO_Unmarshal()
7539 if (*target == TPM_EO_UNSIGNED_LE) { in TPM_EO_Unmarshal()
7542 if (*target == TPM_EO_BITSET) { in TPM_EO_Unmarshal()
7545 if (*target == TPM_EO_BITCLEAR) { in TPM_EO_Unmarshal()
7555 TPM_RC TPM_HC_Unmarshal(TPM_HC* target, BYTE** buffer, INT32* size) { in TPM_HC_Unmarshal() argument
7557 result = uint32_t_Unmarshal(target, buffer, size); in TPM_HC_Unmarshal()
7561 if (*target == HR_HANDLE_MASK) { in TPM_HC_Unmarshal()
7564 if (*target == HR_RANGE_MASK) { in TPM_HC_Unmarshal()
7567 if (*target == HR_SHIFT) { in TPM_HC_Unmarshal()
7570 if (*target == HR_PCR) { in TPM_HC_Unmarshal()
7573 if (*target == HR_HMAC_SESSION) { in TPM_HC_Unmarshal()
7576 if (*target == HR_POLICY_SESSION) { in TPM_HC_Unmarshal()
7579 if (*target == HR_TRANSIENT) { in TPM_HC_Unmarshal()
7582 if (*target == HR_PERSISTENT) { in TPM_HC_Unmarshal()
7585 if (*target == HR_NV_INDEX) { in TPM_HC_Unmarshal()
7588 if (*target == HR_PERMANENT) { in TPM_HC_Unmarshal()
7591 if (*target == PCR_FIRST) { in TPM_HC_Unmarshal()
7594 if (*target == PCR_LAST) { in TPM_HC_Unmarshal()
7597 if (*target == HMAC_SESSION_FIRST) { in TPM_HC_Unmarshal()
7600 if (*target == HMAC_SESSION_LAST) { in TPM_HC_Unmarshal()
7603 if (*target == LOADED_SESSION_FIRST) { in TPM_HC_Unmarshal()
7606 if (*target == LOADED_SESSION_LAST) { in TPM_HC_Unmarshal()
7609 if (*target == POLICY_SESSION_FIRST) { in TPM_HC_Unmarshal()
7612 if (*target == POLICY_SESSION_LAST) { in TPM_HC_Unmarshal()
7615 if (*target == TRANSIENT_FIRST) { in TPM_HC_Unmarshal()
7618 if (*target == ACTIVE_SESSION_FIRST) { in TPM_HC_Unmarshal()
7621 if (*target == ACTIVE_SESSION_LAST) { in TPM_HC_Unmarshal()
7624 if (*target == TRANSIENT_LAST) { in TPM_HC_Unmarshal()
7627 if (*target == PERSISTENT_FIRST) { in TPM_HC_Unmarshal()
7630 if (*target == PERSISTENT_LAST) { in TPM_HC_Unmarshal()
7633 if (*target == PLATFORM_PERSISTENT) { in TPM_HC_Unmarshal()
7636 if (*target == NV_INDEX_FIRST) { in TPM_HC_Unmarshal()
7639 if (*target == NV_INDEX_LAST) { in TPM_HC_Unmarshal()
7642 if (*target == PERMANENT_FIRST) { in TPM_HC_Unmarshal()
7645 if (*target == PERMANENT_LAST) { in TPM_HC_Unmarshal()
7655 TPM_RC TPM_HT_Unmarshal(TPM_HT* target, BYTE** buffer, INT32* size) { in TPM_HT_Unmarshal() argument
7657 result = uint8_t_Unmarshal(target, buffer, size); in TPM_HT_Unmarshal()
7661 if (*target == TPM_HT_PCR) { in TPM_HT_Unmarshal()
7664 if (*target == TPM_HT_NV_INDEX) { in TPM_HT_Unmarshal()
7667 if (*target == TPM_HT_HMAC_SESSION) { in TPM_HT_Unmarshal()
7670 if (*target == TPM_HT_LOADED_SESSION) { in TPM_HT_Unmarshal()
7673 if (*target == TPM_HT_POLICY_SESSION) { in TPM_HT_Unmarshal()
7676 if (*target == TPM_HT_ACTIVE_SESSION) { in TPM_HT_Unmarshal()
7679 if (*target == TPM_HT_PERMANENT) { in TPM_HT_Unmarshal()
7682 if (*target == TPM_HT_TRANSIENT) { in TPM_HT_Unmarshal()
7685 if (*target == TPM_HT_PERSISTENT) { in TPM_HT_Unmarshal()
7695 TPM_RC TPM_KEY_SIZE_Unmarshal(TPM_KEY_SIZE* target, in TPM_KEY_SIZE_Unmarshal() argument
7698 return uint16_t_Unmarshal(target, buffer, size); in TPM_KEY_SIZE_Unmarshal()
7707 TPM_RC TPM_MODIFIER_INDICATOR_Unmarshal(TPM_MODIFIER_INDICATOR* target, in TPM_MODIFIER_INDICATOR_Unmarshal() argument
7710 return uint32_t_Unmarshal(target, buffer, size); in TPM_MODIFIER_INDICATOR_Unmarshal()
7717 TPM_RC TPM_NV_INDEX_Unmarshal(TPM_NV_INDEX* target, in TPM_NV_INDEX_Unmarshal() argument
7721 result = uint32_t_Unmarshal((uint32_t*)target, buffer, size); in TPM_NV_INDEX_Unmarshal()
7734 TPM_RC TPM_PARAMETER_SIZE_Unmarshal(TPM_PARAMETER_SIZE* target, in TPM_PARAMETER_SIZE_Unmarshal() argument
7737 return uint32_t_Unmarshal(target, buffer, size); in TPM_PARAMETER_SIZE_Unmarshal()
7744 TPM_RC TPM_PS_Unmarshal(TPM_PS* target, BYTE** buffer, INT32* size) { in TPM_PS_Unmarshal() argument
7746 result = uint32_t_Unmarshal(target, buffer, size); in TPM_PS_Unmarshal()
7750 if (*target == TPM_PS_MAIN) { in TPM_PS_Unmarshal()
7753 if (*target == TPM_PS_PC) { in TPM_PS_Unmarshal()
7756 if (*target == TPM_PS_PDA) { in TPM_PS_Unmarshal()
7759 if (*target == TPM_PS_CELL_PHONE) { in TPM_PS_Unmarshal()
7762 if (*target == TPM_PS_SERVER) { in TPM_PS_Unmarshal()
7765 if (*target == TPM_PS_PERIPHERAL) { in TPM_PS_Unmarshal()
7768 if (*target == TPM_PS_TSS) { in TPM_PS_Unmarshal()
7771 if (*target == TPM_PS_STORAGE) { in TPM_PS_Unmarshal()
7774 if (*target == TPM_PS_AUTHENTICATION) { in TPM_PS_Unmarshal()
7777 if (*target == TPM_PS_EMBEDDED) { in TPM_PS_Unmarshal()
7780 if (*target == TPM_PS_HARDCOPY) { in TPM_PS_Unmarshal()
7783 if (*target == TPM_PS_INFRASTRUCTURE) { in TPM_PS_Unmarshal()
7786 if (*target == TPM_PS_VIRTUALIZATION) { in TPM_PS_Unmarshal()
7789 if (*target == TPM_PS_TNC) { in TPM_PS_Unmarshal()
7792 if (*target == TPM_PS_MULTI_TENANT) { in TPM_PS_Unmarshal()
7795 if (*target == TPM_PS_TC) { in TPM_PS_Unmarshal()
7805 TPM_RC TPM_PT_PCR_Unmarshal(TPM_PT_PCR* target, BYTE** buffer, INT32* size) { in TPM_PT_PCR_Unmarshal() argument
7807 result = uint32_t_Unmarshal(target, buffer, size); in TPM_PT_PCR_Unmarshal()
7811 if (*target == TPM_PT_PCR_FIRST) { in TPM_PT_PCR_Unmarshal()
7814 if (*target == TPM_PT_PCR_SAVE) { in TPM_PT_PCR_Unmarshal()
7817 if (*target == TPM_PT_PCR_EXTEND_L0) { in TPM_PT_PCR_Unmarshal()
7820 if (*target == TPM_PT_PCR_RESET_L0) { in TPM_PT_PCR_Unmarshal()
7823 if (*target == TPM_PT_PCR_EXTEND_L1) { in TPM_PT_PCR_Unmarshal()
7826 if (*target == TPM_PT_PCR_RESET_L1) { in TPM_PT_PCR_Unmarshal()
7829 if (*target == TPM_PT_PCR_EXTEND_L2) { in TPM_PT_PCR_Unmarshal()
7832 if (*target == TPM_PT_PCR_RESET_L2) { in TPM_PT_PCR_Unmarshal()
7835 if (*target == TPM_PT_PCR_EXTEND_L3) { in TPM_PT_PCR_Unmarshal()
7838 if (*target == TPM_PT_PCR_RESET_L3) { in TPM_PT_PCR_Unmarshal()
7841 if (*target == TPM_PT_PCR_EXTEND_L4) { in TPM_PT_PCR_Unmarshal()
7844 if (*target == TPM_PT_PCR_RESET_L4) { in TPM_PT_PCR_Unmarshal()
7847 if (*target == TPM_PT_PCR_NO_INCREMENT) { in TPM_PT_PCR_Unmarshal()
7850 if (*target == TPM_PT_PCR_DRTM_RESET) { in TPM_PT_PCR_Unmarshal()
7853 if (*target == TPM_PT_PCR_POLICY) { in TPM_PT_PCR_Unmarshal()
7856 if (*target == TPM_PT_PCR_AUTH) { in TPM_PT_PCR_Unmarshal()
7859 if (*target == TPM_PT_PCR_LAST) { in TPM_PT_PCR_Unmarshal()
7869 TPM_RC TPM_RC_Unmarshal(TPM_RC* target, BYTE** buffer, INT32* size) { in TPM_RC_Unmarshal() argument
7871 result = uint32_t_Unmarshal(target, buffer, size); in TPM_RC_Unmarshal()
7875 if (*target == TPM_RC_SUCCESS) { in TPM_RC_Unmarshal()
7878 if (*target == TPM_RC_BAD_TAG) { in TPM_RC_Unmarshal()
7881 if (*target == RC_VER1) { in TPM_RC_Unmarshal()
7884 if (*target == TPM_RC_INITIALIZE) { in TPM_RC_Unmarshal()
7887 if (*target == TPM_RC_FAILURE) { in TPM_RC_Unmarshal()
7890 if (*target == TPM_RC_SEQUENCE) { in TPM_RC_Unmarshal()
7893 if (*target == TPM_RC_PRIVATE) { in TPM_RC_Unmarshal()
7896 if (*target == TPM_RC_HMAC) { in TPM_RC_Unmarshal()
7899 if (*target == TPM_RC_DISABLED) { in TPM_RC_Unmarshal()
7902 if (*target == TPM_RC_EXCLUSIVE) { in TPM_RC_Unmarshal()
7905 if (*target == TPM_RC_AUTH_TYPE) { in TPM_RC_Unmarshal()
7908 if (*target == TPM_RC_AUTH_MISSING) { in TPM_RC_Unmarshal()
7911 if (*target == TPM_RC_POLICY) { in TPM_RC_Unmarshal()
7914 if (*target == TPM_RC_PCR) { in TPM_RC_Unmarshal()
7917 if (*target == TPM_RC_PCR_CHANGED) { in TPM_RC_Unmarshal()
7920 if (*target == TPM_RC_UPGRADE) { in TPM_RC_Unmarshal()
7923 if (*target == TPM_RC_TOO_MANY_CONTEXTS) { in TPM_RC_Unmarshal()
7926 if (*target == TPM_RC_AUTH_UNAVAILABLE) { in TPM_RC_Unmarshal()
7929 if (*target == TPM_RC_REBOOT) { in TPM_RC_Unmarshal()
7932 if (*target == TPM_RC_UNBALANCED) { in TPM_RC_Unmarshal()
7935 if (*target == TPM_RC_COMMAND_SIZE) { in TPM_RC_Unmarshal()
7938 if (*target == TPM_RC_COMMAND_CODE) { in TPM_RC_Unmarshal()
7941 if (*target == TPM_RC_AUTHSIZE) { in TPM_RC_Unmarshal()
7944 if (*target == TPM_RC_AUTH_CONTEXT) { in TPM_RC_Unmarshal()
7947 if (*target == TPM_RC_NV_RANGE) { in TPM_RC_Unmarshal()
7950 if (*target == TPM_RC_NV_SIZE) { in TPM_RC_Unmarshal()
7953 if (*target == TPM_RC_NV_LOCKED) { in TPM_RC_Unmarshal()
7956 if (*target == TPM_RC_NV_AUTHORIZATION) { in TPM_RC_Unmarshal()
7959 if (*target == TPM_RC_NV_UNINITIALIZED) { in TPM_RC_Unmarshal()
7962 if (*target == TPM_RC_NV_SPACE) { in TPM_RC_Unmarshal()
7965 if (*target == TPM_RC_NV_DEFINED) { in TPM_RC_Unmarshal()
7968 if (*target == TPM_RC_BAD_CONTEXT) { in TPM_RC_Unmarshal()
7971 if (*target == TPM_RC_CPHASH) { in TPM_RC_Unmarshal()
7974 if (*target == TPM_RC_PARENT) { in TPM_RC_Unmarshal()
7977 if (*target == TPM_RC_NEEDS_TEST) { in TPM_RC_Unmarshal()
7980 if (*target == TPM_RC_NO_RESULT) { in TPM_RC_Unmarshal()
7983 if (*target == TPM_RC_SENSITIVE) { in TPM_RC_Unmarshal()
7986 if (*target == RC_MAX_FM0) { in TPM_RC_Unmarshal()
7989 if (*target == RC_FMT1) { in TPM_RC_Unmarshal()
7992 if (*target == TPM_RC_ASYMMETRIC) { in TPM_RC_Unmarshal()
7995 if (*target == TPM_RC_ATTRIBUTES) { in TPM_RC_Unmarshal()
7998 if (*target == TPM_RC_HASH) { in TPM_RC_Unmarshal()
8001 if (*target == TPM_RC_VALUE) { in TPM_RC_Unmarshal()
8004 if (*target == TPM_RC_HIERARCHY) { in TPM_RC_Unmarshal()
8007 if (*target == TPM_RC_KEY_SIZE) { in TPM_RC_Unmarshal()
8010 if (*target == TPM_RC_MGF) { in TPM_RC_Unmarshal()
8013 if (*target == TPM_RC_MODE) { in TPM_RC_Unmarshal()
8016 if (*target == TPM_RC_TYPE) { in TPM_RC_Unmarshal()
8019 if (*target == TPM_RC_HANDLE) { in TPM_RC_Unmarshal()
8022 if (*target == TPM_RC_KDF) { in TPM_RC_Unmarshal()
8025 if (*target == TPM_RC_RANGE) { in TPM_RC_Unmarshal()
8028 if (*target == TPM_RC_AUTH_FAIL) { in TPM_RC_Unmarshal()
8031 if (*target == TPM_RC_NONCE) { in TPM_RC_Unmarshal()
8034 if (*target == TPM_RC_PP) { in TPM_RC_Unmarshal()
8037 if (*target == TPM_RC_SCHEME) { in TPM_RC_Unmarshal()
8040 if (*target == TPM_RC_SIZE) { in TPM_RC_Unmarshal()
8043 if (*target == TPM_RC_SYMMETRIC) { in TPM_RC_Unmarshal()
8046 if (*target == TPM_RC_TAG) { in TPM_RC_Unmarshal()
8049 if (*target == TPM_RC_SELECTOR) { in TPM_RC_Unmarshal()
8052 if (*target == TPM_RC_INSUFFICIENT) { in TPM_RC_Unmarshal()
8055 if (*target == TPM_RC_SIGNATURE) { in TPM_RC_Unmarshal()
8058 if (*target == TPM_RC_KEY) { in TPM_RC_Unmarshal()
8061 if (*target == TPM_RC_POLICY_FAIL) { in TPM_RC_Unmarshal()
8064 if (*target == TPM_RC_INTEGRITY) { in TPM_RC_Unmarshal()
8067 if (*target == TPM_RC_TICKET) { in TPM_RC_Unmarshal()
8070 if (*target == TPM_RC_RESERVED_BITS) { in TPM_RC_Unmarshal()
8073 if (*target == TPM_RC_BAD_AUTH) { in TPM_RC_Unmarshal()
8076 if (*target == TPM_RC_EXPIRED) { in TPM_RC_Unmarshal()
8079 if (*target == TPM_RC_POLICY_CC) { in TPM_RC_Unmarshal()
8082 if (*target == TPM_RC_BINDING) { in TPM_RC_Unmarshal()
8085 if (*target == TPM_RC_CURVE) { in TPM_RC_Unmarshal()
8088 if (*target == TPM_RC_ECC_POINT) { in TPM_RC_Unmarshal()
8091 if (*target == RC_WARN) { in TPM_RC_Unmarshal()
8094 if (*target == TPM_RC_CONTEXT_GAP) { in TPM_RC_Unmarshal()
8097 if (*target == TPM_RC_OBJECT_MEMORY) { in TPM_RC_Unmarshal()
8100 if (*target == TPM_RC_SESSION_MEMORY) { in TPM_RC_Unmarshal()
8103 if (*target == TPM_RC_MEMORY) { in TPM_RC_Unmarshal()
8106 if (*target == TPM_RC_SESSION_HANDLES) { in TPM_RC_Unmarshal()
8109 if (*target == TPM_RC_OBJECT_HANDLES) { in TPM_RC_Unmarshal()
8112 if (*target == TPM_RC_LOCALITY) { in TPM_RC_Unmarshal()
8115 if (*target == TPM_RC_YIELDED) { in TPM_RC_Unmarshal()
8118 if (*target == TPM_RC_CANCELED) { in TPM_RC_Unmarshal()
8121 if (*target == TPM_RC_TESTING) { in TPM_RC_Unmarshal()
8124 if (*target == TPM_RC_REFERENCE_H0) { in TPM_RC_Unmarshal()
8127 if (*target == TPM_RC_REFERENCE_H1) { in TPM_RC_Unmarshal()
8130 if (*target == TPM_RC_REFERENCE_H2) { in TPM_RC_Unmarshal()
8133 if (*target == TPM_RC_REFERENCE_H3) { in TPM_RC_Unmarshal()
8136 if (*target == TPM_RC_REFERENCE_H4) { in TPM_RC_Unmarshal()
8139 if (*target == TPM_RC_REFERENCE_H5) { in TPM_RC_Unmarshal()
8142 if (*target == TPM_RC_REFERENCE_H6) { in TPM_RC_Unmarshal()
8145 if (*target == TPM_RC_REFERENCE_S0) { in TPM_RC_Unmarshal()
8148 if (*target == TPM_RC_REFERENCE_S1) { in TPM_RC_Unmarshal()
8151 if (*target == TPM_RC_REFERENCE_S2) { in TPM_RC_Unmarshal()
8154 if (*target == TPM_RC_REFERENCE_S3) { in TPM_RC_Unmarshal()
8157 if (*target == TPM_RC_REFERENCE_S4) { in TPM_RC_Unmarshal()
8160 if (*target == TPM_RC_REFERENCE_S5) { in TPM_RC_Unmarshal()
8163 if (*target == TPM_RC_REFERENCE_S6) { in TPM_RC_Unmarshal()
8166 if (*target == TPM_RC_NV_RATE) { in TPM_RC_Unmarshal()
8169 if (*target == TPM_RC_LOCKOUT) { in TPM_RC_Unmarshal()
8172 if (*target == TPM_RC_RETRY) { in TPM_RC_Unmarshal()
8175 if (*target == TPM_RC_NV_UNAVAILABLE) { in TPM_RC_Unmarshal()
8178 if (*target == TPM_RC_NOT_USED) { in TPM_RC_Unmarshal()
8181 if (*target == TPM_RC_H) { in TPM_RC_Unmarshal()
8184 if (*target == TPM_RC_P) { in TPM_RC_Unmarshal()
8187 if (*target == TPM_RC_S) { in TPM_RC_Unmarshal()
8190 if (*target == TPM_RC_1) { in TPM_RC_Unmarshal()
8193 if (*target == TPM_RC_2) { in TPM_RC_Unmarshal()
8196 if (*target == TPM_RC_3) { in TPM_RC_Unmarshal()
8199 if (*target == TPM_RC_4) { in TPM_RC_Unmarshal()
8202 if (*target == TPM_RC_5) { in TPM_RC_Unmarshal()
8205 if (*target == TPM_RC_6) { in TPM_RC_Unmarshal()
8208 if (*target == TPM_RC_7) { in TPM_RC_Unmarshal()
8211 if (*target == TPM_RC_8) { in TPM_RC_Unmarshal()
8214 if (*target == TPM_RC_9) { in TPM_RC_Unmarshal()
8217 if (*target == TPM_RC_A) { in TPM_RC_Unmarshal()
8220 if (*target == TPM_RC_B) { in TPM_RC_Unmarshal()
8223 if (*target == TPM_RC_C) { in TPM_RC_Unmarshal()
8226 if (*target == TPM_RC_D) { in TPM_RC_Unmarshal()
8229 if (*target == TPM_RC_E) { in TPM_RC_Unmarshal()
8232 if (*target == TPM_RC_F) { in TPM_RC_Unmarshal()
8235 if (*target == TPM_RC_N_MASK) { in TPM_RC_Unmarshal()
8245 TPM_RC TPM_RH_Unmarshal(TPM_RH* target, BYTE** buffer, INT32* size) { in TPM_RH_Unmarshal() argument
8247 result = uint32_t_Unmarshal(target, buffer, size); in TPM_RH_Unmarshal()
8251 if (*target == TPM_RH_FIRST) { in TPM_RH_Unmarshal()
8254 if (*target == TPM_RH_SRK) { in TPM_RH_Unmarshal()
8257 if (*target == TPM_RH_OWNER) { in TPM_RH_Unmarshal()
8260 if (*target == TPM_RH_REVOKE) { in TPM_RH_Unmarshal()
8263 if (*target == TPM_RH_TRANSPORT) { in TPM_RH_Unmarshal()
8266 if (*target == TPM_RH_OPERATOR) { in TPM_RH_Unmarshal()
8269 if (*target == TPM_RH_ADMIN) { in TPM_RH_Unmarshal()
8272 if (*target == TPM_RH_EK) { in TPM_RH_Unmarshal()
8275 if (*target == TPM_RH_NULL) { in TPM_RH_Unmarshal()
8278 if (*target == TPM_RH_UNASSIGNED) { in TPM_RH_Unmarshal()
8281 if (*target == TPM_RS_PW) { in TPM_RH_Unmarshal()
8284 if (*target == TPM_RH_LOCKOUT) { in TPM_RH_Unmarshal()
8287 if (*target == TPM_RH_ENDORSEMENT) { in TPM_RH_Unmarshal()
8290 if (*target == TPM_RH_PLATFORM) { in TPM_RH_Unmarshal()
8293 if (*target == TPM_RH_PLATFORM_NV) { in TPM_RH_Unmarshal()
8296 if (*target == TPM_RH_AUTH_00) { in TPM_RH_Unmarshal()
8299 if (*target == TPM_RH_AUTH_FF) { in TPM_RH_Unmarshal()
8302 if (*target == TPM_RH_LAST) { in TPM_RH_Unmarshal()
8312 TPM_RC TPM_SE_Unmarshal(TPM_SE* target, BYTE** buffer, INT32* size) { in TPM_SE_Unmarshal() argument
8314 result = uint8_t_Unmarshal(target, buffer, size); in TPM_SE_Unmarshal()
8318 if (*target == TPM_SE_HMAC) { in TPM_SE_Unmarshal()
8321 if (*target == TPM_SE_POLICY) { in TPM_SE_Unmarshal()
8324 if (*target == TPM_SE_TRIAL) { in TPM_SE_Unmarshal()
8334 TPM_RC TPM_SPEC_Unmarshal(TPM_SPEC* target, BYTE** buffer, INT32* size) { in TPM_SPEC_Unmarshal() argument
8336 result = uint32_t_Unmarshal(target, buffer, size); in TPM_SPEC_Unmarshal()
8340 if (*target == TPM_SPEC_FAMILY) { in TPM_SPEC_Unmarshal()
8343 if (*target == TPM_SPEC_LEVEL) { in TPM_SPEC_Unmarshal()
8346 if (*target == TPM_SPEC_VERSION) { in TPM_SPEC_Unmarshal()
8349 if (*target == TPM_SPEC_YEAR) { in TPM_SPEC_Unmarshal()
8352 if (*target == TPM_SPEC_DAY_OF_YEAR) { in TPM_SPEC_Unmarshal()
8362 TPM_RC TPM_SU_Unmarshal(TPM_SU* target, BYTE** buffer, INT32* size) { in TPM_SU_Unmarshal() argument
8364 result = uint16_t_Unmarshal(target, buffer, size); in TPM_SU_Unmarshal()
8368 if (*target == TPM_SU_CLEAR) { in TPM_SU_Unmarshal()
8371 if (*target == TPM_SU_STATE) { in TPM_SU_Unmarshal()
8379 total_size += TPM2B_DIGEST_Marshal(&source->integrityHMAC, buffer, size); in _ID_OBJECT_Marshal()
8380 total_size += TPM2B_DIGEST_Marshal(&source->encIdentity, buffer, size); in _ID_OBJECT_Marshal()
8384 TPM_RC _ID_OBJECT_Unmarshal(_ID_OBJECT* target, BYTE** buffer, INT32* size) { in _ID_OBJECT_Unmarshal() argument
8386 result = TPM2B_DIGEST_Unmarshal(&target->integrityHMAC, buffer, size); in _ID_OBJECT_Unmarshal()
8390 result = TPM2B_DIGEST_Unmarshal(&target->encIdentity, buffer, size); in _ID_OBJECT_Unmarshal()
8399 total_size += TPM2B_DIGEST_Marshal(&source->integrityOuter, buffer, size); in _PRIVATE_Marshal()
8400 total_size += TPM2B_DIGEST_Marshal(&source->integrityInner, buffer, size); in _PRIVATE_Marshal()
8401 total_size += TPMT_SENSITIVE_Marshal(&source->sensitive, buffer, size); in _PRIVATE_Marshal()
8405 TPM_RC _PRIVATE_Unmarshal(_PRIVATE* target, BYTE** buffer, INT32* size) { in _PRIVATE_Unmarshal() argument
8407 result = TPM2B_DIGEST_Unmarshal(&target->integrityOuter, buffer, size); in _PRIVATE_Unmarshal()
8411 result = TPM2B_DIGEST_Unmarshal(&target->integrityInner, buffer, size); in _PRIVATE_Unmarshal()
8415 result = TPMT_SENSITIVE_Unmarshal(&target->sensitive, buffer, size); in _PRIVATE_Unmarshal()