1 /********************************************************************************/
2 /* */
3 /* TSS Marshal and Unmarshal */
4 /* Written by Ken Goldman */
5 /* IBM Thomas J. Watson Research Center */
6 /* */
7 /* (c) Copyright IBM Corporation 2015 - 2019. */
8 /* */
9 /* All rights reserved. */
10 /* */
11 /* Redistribution and use in source and binary forms, with or without */
12 /* modification, are permitted provided that the following conditions are */
13 /* met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright notice, */
16 /* this list of conditions and the following disclaimer. */
17 /* */
18 /* Redistributions in binary form must reproduce the above copyright */
19 /* notice, this list of conditions and the following disclaimer in the */
20 /* documentation and/or other materials provided with the distribution. */
21 /* */
22 /* Neither the names of the IBM Corporation nor the names of its */
23 /* contributors may be used to endorse or promote products derived from */
24 /* this software without specific prior written permission. */
25 /* */
26 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
27 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
28 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
29 /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
30 /* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
31 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
32 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
33 /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
34 /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
35 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
36 /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
37 /********************************************************************************/
38
39 #include <string.h>
40
41 #include <ibmtss/tssmarshal.h>
42 #include <ibmtss/tsserror.h>
43 #include <ibmtss/tssprint.h>
44 #include <ibmtss/Unmarshal_fp.h>
45
46 /* This file holds:
47
48 ---------------------------------------
49
50 Recommended functions - with an unsigned size
51
52 * Primary marshal functions TSS_primary_Marshalu
53 * Primary unmarshal functions TSS_primary_Unmarshalu in Unmarshal.c
54 * TPM 2.0 structure marshal functions TSS_structure_Marshalu
55 * TPM 2.0 structure unmarshal functions TSS_structure_Unmarshalu in Unmarshal.c
56 * TPM 2.0 command marshal functions TSS_command_In_Marshalu
57 TPM 2.0 command unmarshal functions command_In_Unmarshal
58 * TPM 2.0 response unmarshal functions TSS_response_Out_Unmarshalu
59
60 ---------------------------------------
61
62 Deprecated functions - with a signed size
63
64 * Primary marshal functions TSS_primary_Marshal
65 * Primary unmarshal functions primary_Unmarshal in Unmarshal.c
66 * TPM 2.0 structure marshal functions TSS_structure_Marshal
67 * TPM 2.0 structure unmarshal functions structure_Unmarshal in Unmarshal.c
68 * TPM 2.0 command marshal functions TSS_command_In_Marshal
69 * TPM 2.0 response unmarshal functions TSS_response_Out_Unmarshal
70
71 * are exposed in /tss2/
72 */
73
74 /* The marshaling function prototype pattern is:
75
76 Return:
77
78 An extra return code, TSS_RC_INSUFFICIENT_BUFFER, indicates that the supplied buffer size is too
79 small. The TPM functions assert.
80
81 'source' is the structure to be marshaled.
82 'written' is the __additional__ number of bytes written.
83 'buffer' is the buffer written.
84 ' size' is the remaining size of the buffer.
85
86 If 'buffer' is NULL, 'written' is updated but no marshaling is performed. This is used in a two
87 pass pattern, where the first pass returns the size of the buffer to be malloc'ed.
88
89 If 'size' is NULL, the source is marshaled without a size check. The caller must ensure that
90 the buffer is sufficient, often due to a malloc after the first pass. */
91
92 /* Marshal functions shared by TPM 1.2 and TPM 2.0 */
93
94 /* The functions with the _Marshalu suffix are preferred. They use an unsigned size. The functions
95 with _Marshalu are deprecated. */
96
97 TPM_RC
TSS_UINT8_Marshalu(const UINT8 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)98 TSS_UINT8_Marshalu(const UINT8 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
99 {
100 TPM_RC rc = 0;
101 if (buffer != NULL) { /* if buffer is NULL, don't marshal, just return written */
102 /* if size is NULL, ignore it, else check sufficient */
103 if ((size == NULL) || (*size >= sizeof(UINT8))) {
104 /* marshal, move the buffer */
105 (*buffer)[0] = *source;
106 *buffer += sizeof(UINT8);
107 /* is size was supplied, update it */
108 if (size != NULL) {
109 *size -= sizeof(UINT8);
110 }
111 }
112 else {
113 rc = TSS_RC_INSUFFICIENT_BUFFER;
114 }
115 }
116 *written += sizeof(UINT8);
117 return rc;
118 }
119
120 TPM_RC
TSS_INT8_Marshalu(const INT8 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)121 TSS_INT8_Marshalu(const INT8 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
122 {
123 TPM_RC rc = 0;
124 rc = TSS_UINT8_Marshalu((const UINT8 *)source, written, buffer, size);
125 return rc;
126 }
127
128 TPM_RC
TSS_UINT16_Marshalu(const UINT16 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)129 TSS_UINT16_Marshalu(const UINT16 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
130 {
131 TPM_RC rc = 0;
132 if (buffer != NULL) {
133 if ((size == NULL) || (*size >= sizeof(uint16_t))) {
134
135 (*buffer)[0] = (BYTE)((*source >> 8) & 0xff);
136 (*buffer)[1] = (BYTE)((*source >> 0) & 0xff);
137 *buffer += sizeof(uint16_t);
138
139 if (size != NULL) {
140 *size -= sizeof(uint16_t);
141 }
142 }
143 else {
144 rc = TSS_RC_INSUFFICIENT_BUFFER;
145 }
146 }
147 *written += sizeof(uint16_t);
148 return rc;
149 }
150
151 TPM_RC
TSS_UINT32_Marshalu(const UINT32 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)152 TSS_UINT32_Marshalu(const UINT32 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
153 {
154 TPM_RC rc = 0;
155 if (buffer != NULL) {
156 if ((size == NULL) || (*size >= sizeof(uint32_t))) {
157
158 (*buffer)[0] = (BYTE)((*source >> 24) & 0xff);
159 (*buffer)[1] = (BYTE)((*source >> 16) & 0xff);
160 (*buffer)[2] = (BYTE)((*source >> 8) & 0xff);
161 (*buffer)[3] = (BYTE)((*source >> 0) & 0xff);
162 *buffer += sizeof(uint32_t);
163
164 if (size != NULL) {
165 *size -= sizeof(uint32_t);
166 }
167 }
168 else {
169 rc = TSS_RC_INSUFFICIENT_BUFFER;
170 }
171 }
172 *written += sizeof(uint32_t);
173 return rc;
174 }
175
176 TPM_RC
TSS_INT32_Marshalu(const INT32 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)177 TSS_INT32_Marshalu(const INT32 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
178 {
179 TPM_RC rc = 0;
180 rc = TSS_UINT32_Marshalu((const UINT32 *)source, written, buffer, size);
181 return rc;
182 }
183
184 TPM_RC
TSS_UINT64_Marshalu(const UINT64 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)185 TSS_UINT64_Marshalu(const UINT64 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
186 {
187 TPM_RC rc = 0;
188 if (buffer != NULL) {
189 if ((size == NULL) || (*size >= sizeof(UINT64))) {
190
191 (*buffer)[0] = (BYTE)((*source >> 56) & 0xff);
192 (*buffer)[1] = (BYTE)((*source >> 48) & 0xff);
193 (*buffer)[2] = (BYTE)((*source >> 40) & 0xff);
194 (*buffer)[3] = (BYTE)((*source >> 32) & 0xff);
195 (*buffer)[4] = (BYTE)((*source >> 24) & 0xff);
196 (*buffer)[5] = (BYTE)((*source >> 16) & 0xff);
197 (*buffer)[6] = (BYTE)((*source >> 8) & 0xff);
198 (*buffer)[7] = (BYTE)((*source >> 0) & 0xff);
199 *buffer += sizeof(UINT64);
200
201 if (size != NULL) {
202 *size -= sizeof(UINT64);
203 }
204 }
205 else {
206 rc = TSS_RC_INSUFFICIENT_BUFFER;
207 }
208 }
209 *written += sizeof(UINT64);
210 return rc;
211 }
212
213 TPM_RC
TSS_Array_Marshalu(const BYTE * source,uint16_t sourceSize,uint16_t * written,BYTE ** buffer,uint32_t * size)214 TSS_Array_Marshalu(const BYTE *source, uint16_t sourceSize, uint16_t *written, BYTE **buffer, uint32_t *size)
215 {
216 TPM_RC rc = 0;
217 if (buffer != NULL) {
218 if ((size == NULL) || (*size >= sourceSize)) {
219 memcpy(*buffer, source, sourceSize);
220
221 *buffer += sourceSize;
222
223 if (size != NULL) {
224 *size -= sourceSize;
225 }
226 }
227 else {
228 rc = TSS_RC_INSUFFICIENT_BUFFER;
229 }
230 }
231 *written += sourceSize;
232 return rc;
233 }
234
235
236 #ifdef TPM_TPM20
237
238 /*
239 TPM 2.0 Command parameter marshaling
240 */
241
242 TPM_RC
TSS_Startup_In_Marshalu(const Startup_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)243 TSS_Startup_In_Marshalu(const Startup_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
244 {
245 TPM_RC rc = 0;
246 if (rc == 0) {
247 rc = TSS_TPM_SU_Marshalu(&source->startupType, written, buffer, size);
248 }
249 return rc;
250 }
251 TPM_RC
TSS_Shutdown_In_Marshalu(const Shutdown_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)252 TSS_Shutdown_In_Marshalu(const Shutdown_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
253 {
254 TPM_RC rc = 0;
255 if (rc == 0) {
256 rc = TSS_TPM_SU_Marshalu(&source->shutdownType, written, buffer, size);
257 }
258 return rc;
259 }
260 TPM_RC
TSS_SelfTest_In_Marshalu(const SelfTest_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)261 TSS_SelfTest_In_Marshalu(const SelfTest_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
262 {
263 TPM_RC rc = 0;
264 if (rc == 0) {
265 rc = TSS_TPMI_YES_NO_Marshalu(&source->fullTest, written, buffer, size);
266 }
267 return rc;
268 }
269 TPM_RC
TSS_IncrementalSelfTest_In_Marshalu(const IncrementalSelfTest_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)270 TSS_IncrementalSelfTest_In_Marshalu(const IncrementalSelfTest_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
271 {
272 TPM_RC rc = 0;
273 if (rc == 0) {
274 rc = TSS_TPML_ALG_Marshalu(&source->toTest, written, buffer, size);
275 }
276 return rc;
277 }
278 TPM_RC
TSS_StartAuthSession_In_Marshalu(const StartAuthSession_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)279 TSS_StartAuthSession_In_Marshalu(const StartAuthSession_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
280 {
281 TPM_RC rc = 0;
282 if (rc == 0) {
283 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->tpmKey, written, buffer, size);
284 }
285 if (rc == 0) {
286 rc = TSS_TPMI_DH_ENTITY_Marshalu(&source->bind, written, buffer, size);
287 }
288 if (rc == 0) {
289 rc = TSS_TPM2B_NONCE_Marshalu(&source->nonceCaller, written, buffer, size);
290 }
291 if (rc == 0) {
292 rc = TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(&source->encryptedSalt, written, buffer, size);
293 }
294 if (rc == 0) {
295 rc = TSS_TPM_SE_Marshalu(&source->sessionType, written, buffer, size);
296 }
297 if (rc == 0) {
298 rc = TSS_TPMT_SYM_DEF_Marshalu(&source->symmetric, written, buffer, size);
299 }
300 if (rc == 0) {
301 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->authHash, written, buffer, size);
302 }
303 return rc;
304 }
305 TPM_RC
TSS_PolicyRestart_In_Marshalu(const PolicyRestart_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)306 TSS_PolicyRestart_In_Marshalu(const PolicyRestart_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
307 {
308 TPM_RC rc = 0;
309 if (rc == 0) {
310 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->sessionHandle, written, buffer, size);
311 }
312 return rc;
313 }
314 TPM_RC
TSS_Create_In_Marshalu(const Create_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)315 TSS_Create_In_Marshalu(const Create_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
316 {
317 TPM_RC rc = 0;
318 if (rc == 0) {
319 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->parentHandle, written, buffer, size);
320 }
321 if (rc == 0) {
322 rc = TSS_TPM2B_SENSITIVE_CREATE_Marshalu(&source->inSensitive, written, buffer, size);
323 }
324 if (rc == 0) {
325 rc = TSS_TPM2B_PUBLIC_Marshalu(&source->inPublic, written, buffer, size);
326 }
327 if (rc == 0) {
328 rc = TSS_TPM2B_DATA_Marshalu(&source->outsideInfo, written, buffer, size);
329 }
330 if (rc == 0) {
331 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->creationPCR, written, buffer, size);
332 }
333 return rc;
334 }
335 TPM_RC
TSS_Load_In_Marshalu(const Load_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)336 TSS_Load_In_Marshalu(const Load_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
337 {
338 TPM_RC rc = 0;
339 if (rc == 0) {
340 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->parentHandle, written, buffer, size);
341 }
342 if (rc == 0) {
343 rc = TSS_TPM2B_PRIVATE_Marshalu(&source->inPrivate, written, buffer, size);
344 }
345 if (rc == 0) {
346 rc = TSS_TPM2B_PUBLIC_Marshalu(&source->inPublic, written, buffer, size);
347 }
348 return rc;
349 }
350 TPM_RC
TSS_LoadExternal_In_Marshalu(const LoadExternal_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)351 TSS_LoadExternal_In_Marshalu(const LoadExternal_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
352 {
353 TPM_RC rc = 0;
354 if (rc == 0) {
355 /* optional parameter, use size as flag */
356 if (source->inPrivate.b.size == 0) { /* not present */
357 uint16_t zero = 0;
358 rc = TSS_UINT16_Marshalu(&zero, written, buffer, size);
359 }
360 else {
361 rc = TSS_TPM2B_SENSITIVE_Marshalu(&source->inPrivate, written, buffer, size);
362 }
363 }
364 if (rc == 0) {
365 rc = TSS_TPM2B_PUBLIC_Marshalu(&source->inPublic, written, buffer, size);
366 }
367 if (rc == 0) {
368 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
369 }
370 return rc;
371 }
372 TPM_RC
TSS_ReadPublic_In_Marshalu(const ReadPublic_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)373 TSS_ReadPublic_In_Marshalu(const ReadPublic_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
374 {
375 TPM_RC rc = 0;
376 if (rc == 0) {
377 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
378 }
379 return rc;
380 }
381 TPM_RC
TSS_ActivateCredential_In_Marshalu(const ActivateCredential_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)382 TSS_ActivateCredential_In_Marshalu(const ActivateCredential_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
383 {
384 TPM_RC rc = 0;
385 if (rc == 0) {
386 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->activateHandle, written, buffer, size);
387 }
388 if (rc == 0) {
389 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
390 }
391 if (rc == 0) {
392 rc = TSS_TPM2B_ID_OBJECT_Marshalu(&source->credentialBlob, written, buffer, size);
393 }
394 if (rc == 0) {
395 rc = TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(&source->secret, written, buffer, size);
396 }
397 return rc;
398 }
399 TPM_RC
TSS_MakeCredential_In_Marshalu(const MakeCredential_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)400 TSS_MakeCredential_In_Marshalu(const MakeCredential_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
401 {
402 TPM_RC rc = 0;
403 if (rc == 0) {
404 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->handle, written, buffer, size);
405 }
406 if (rc == 0) {
407 rc = TSS_TPM2B_DIGEST_Marshalu(&source->credential, written, buffer, size);
408 }
409 if (rc == 0) {
410 rc = TSS_TPM2B_NAME_Marshalu(&source->objectName, written, buffer, size);
411 }
412 return rc;
413 }
414 TPM_RC
TSS_Unseal_In_Marshalu(const Unseal_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)415 TSS_Unseal_In_Marshalu(const Unseal_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
416 {
417 TPM_RC rc = 0;
418 if (rc == 0) {
419 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->itemHandle, written, buffer, size);
420 }
421 return rc;
422 }
423 TPM_RC
TSS_ObjectChangeAuth_In_Marshalu(const ObjectChangeAuth_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)424 TSS_ObjectChangeAuth_In_Marshalu(const ObjectChangeAuth_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
425 {
426 TPM_RC rc = 0;
427 if (rc == 0) {
428 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
429 }
430 if (rc == 0) {
431 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->parentHandle, written, buffer, size);
432 }
433 if (rc == 0) {
434 rc = TSS_TPM2B_AUTH_Marshalu(&source->newAuth, written, buffer, size);
435 }
436 return rc;
437 }
438 TPM_RC
TSS_CreateLoaded_In_Marshalu(const CreateLoaded_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)439 TSS_CreateLoaded_In_Marshalu(const CreateLoaded_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
440 {
441 TPM_RC rc = 0;
442 if (rc == 0) {
443 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->parentHandle, written, buffer, size);
444 }
445 if (rc == 0) {
446 rc = TSS_TPM2B_SENSITIVE_CREATE_Marshalu(&source->inSensitive, written, buffer, size);
447 }
448 if (rc == 0) {
449 rc = TSS_TPM2B_TEMPLATE_Marshalu(&source->inPublic, written, buffer, size);
450 }
451 return rc;
452 }
453 TPM_RC
TSS_Duplicate_In_Marshalu(const Duplicate_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)454 TSS_Duplicate_In_Marshalu(const Duplicate_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
455 {
456 TPM_RC rc = 0;
457 if (rc == 0) {
458 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
459 }
460 if (rc == 0) {
461 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->newParentHandle, written, buffer, size);
462 }
463 if (rc == 0) {
464 rc = TSS_TPM2B_DATA_Marshalu(&source->encryptionKeyIn, written, buffer, size);
465 }
466 if (rc == 0) {
467 rc = TSS_TPMT_SYM_DEF_OBJECT_Marshalu(&source->symmetricAlg, written, buffer, size);
468 }
469 return rc;
470 }
471 TPM_RC
TSS_Rewrap_In_Marshalu(const Rewrap_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)472 TSS_Rewrap_In_Marshalu(const Rewrap_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
473 {
474 TPM_RC rc = 0;
475 if (rc == 0) {
476 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->oldParent, written, buffer, size);
477 }
478 if (rc == 0) {
479 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->newParent, written, buffer, size);
480 }
481 if (rc == 0) {
482 rc = TSS_TPM2B_PRIVATE_Marshalu(&source->inDuplicate, written, buffer, size);
483 }
484 if (rc == 0) {
485 rc = TSS_TPM2B_NAME_Marshalu(&source->name, written, buffer, size);
486 }
487 if (rc == 0) {
488 rc = TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(&source->inSymSeed, written, buffer, size);
489 }
490 return rc;
491 }
492 TPM_RC
TSS_Import_In_Marshalu(const Import_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)493 TSS_Import_In_Marshalu(const Import_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
494 {
495 TPM_RC rc = 0;
496 if (rc == 0) {
497 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->parentHandle, written, buffer, size);
498 }
499 if (rc == 0) {
500 rc = TSS_TPM2B_DATA_Marshalu(&source->encryptionKey, written, buffer, size);
501 }
502 if (rc == 0) {
503 rc = TSS_TPM2B_PUBLIC_Marshalu(&source->objectPublic, written, buffer, size);
504 }
505 if (rc == 0) {
506 rc = TSS_TPM2B_PRIVATE_Marshalu(&source->duplicate, written, buffer, size);
507 }
508 if (rc == 0) {
509 rc = TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(&source->inSymSeed, written, buffer, size);
510 }
511 if (rc == 0) {
512 rc = TSS_TPMT_SYM_DEF_OBJECT_Marshalu(&source->symmetricAlg, written, buffer, size);
513 }
514 return rc;
515 }
516 TPM_RC
TSS_RSA_Encrypt_In_Marshalu(const RSA_Encrypt_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)517 TSS_RSA_Encrypt_In_Marshalu(const RSA_Encrypt_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
518 {
519 TPM_RC rc = 0;
520 if (rc == 0) {
521 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
522 }
523 if (rc == 0) {
524 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(&source->message, written, buffer, size);
525 }
526 if (rc == 0) {
527 rc = TSS_TPMT_RSA_DECRYPT_Marshalu(&source->inScheme, written, buffer, size);
528 }
529 if (rc == 0) {
530 rc = TSS_TPM2B_DATA_Marshalu(&source->label, written, buffer, size);
531 }
532 return rc;
533 }
534 TPM_RC
TSS_RSA_Decrypt_In_Marshalu(const RSA_Decrypt_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)535 TSS_RSA_Decrypt_In_Marshalu(const RSA_Decrypt_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
536 {
537 TPM_RC rc = 0;
538 if (rc == 0) {
539 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
540 }
541 if (rc == 0) {
542 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(&source->cipherText, written, buffer, size);
543 }
544 if (rc == 0) {
545 rc = TSS_TPMT_RSA_DECRYPT_Marshalu(&source->inScheme, written, buffer, size);
546 }
547 if (rc == 0) {
548 rc = TSS_TPM2B_DATA_Marshalu(&source->label, written, buffer, size);
549 }
550 return rc;
551 }
552 TPM_RC
TSS_ECDH_KeyGen_In_Marshalu(const ECDH_KeyGen_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)553 TSS_ECDH_KeyGen_In_Marshalu(const ECDH_KeyGen_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
554 {
555 TPM_RC rc = 0;
556 if (rc == 0) {
557 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
558 }
559 return rc;
560 }
561 TPM_RC
TSS_ECDH_ZGen_In_Marshalu(const ECDH_ZGen_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)562 TSS_ECDH_ZGen_In_Marshalu(const ECDH_ZGen_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
563 {
564 TPM_RC rc = 0;
565 if (rc == 0) {
566 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
567 }
568 if (rc == 0) {
569 rc = TSS_TPM2B_ECC_POINT_Marshalu(&source->inPoint, written, buffer, size);
570 }
571 return rc;
572 }
573 TPM_RC
TSS_ECC_Parameters_In_Marshalu(const ECC_Parameters_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)574 TSS_ECC_Parameters_In_Marshalu(const ECC_Parameters_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
575 {
576 TPM_RC rc = 0;
577 if (rc == 0) {
578 rc = TSS_TPMI_ECC_CURVE_Marshalu(&source->curveID, written, buffer, size);
579 }
580 return rc;
581 }
582 TPM_RC
TSS_ZGen_2Phase_In_Marshalu(const ZGen_2Phase_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)583 TSS_ZGen_2Phase_In_Marshalu(const ZGen_2Phase_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
584 {
585 TPM_RC rc = 0;
586 if (rc == 0) {
587 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyA, written, buffer, size);
588 }
589 if (rc == 0) {
590 rc = TSS_TPM2B_ECC_POINT_Marshalu(&source->inQsB, written, buffer, size);
591 }
592 if (rc == 0) {
593 rc = TSS_TPM2B_ECC_POINT_Marshalu(&source->inQeB, written, buffer, size);
594 }
595 if (rc == 0) {
596 rc = TSS_TPMI_ECC_KEY_EXCHANGE_Marshalu(&source->inScheme, written, buffer, size);
597 }
598 if (rc == 0) {
599 rc = TSS_UINT16_Marshalu(&source->counter, written, buffer, size);
600 }
601 return rc;
602 }
603 TPM_RC
TSS_EncryptDecrypt_In_Marshalu(const EncryptDecrypt_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)604 TSS_EncryptDecrypt_In_Marshalu(const EncryptDecrypt_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
605 {
606 TPM_RC rc = 0;
607 if (rc == 0) {
608 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
609 }
610 if (rc == 0) {
611 rc = TSS_TPMI_YES_NO_Marshalu(&source->decrypt, written, buffer, size);
612 }
613 if (rc == 0) {
614 rc = TSS_TPMI_ALG_CIPHER_MODE_Marshalu(&source->mode, written, buffer, size);
615 }
616 if (rc == 0) {
617 rc = TSS_TPM2B_IV_Marshalu(&source->ivIn, written, buffer, size);
618 }
619 if (rc == 0) {
620 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->inData, written, buffer, size);
621 }
622 return rc;
623 }
624 TPM_RC
TSS_EncryptDecrypt2_In_Marshalu(const EncryptDecrypt2_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)625 TSS_EncryptDecrypt2_In_Marshalu(const EncryptDecrypt2_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
626 {
627 TPM_RC rc = 0;
628 if (rc == 0) {
629 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
630 }
631 if (rc == 0) {
632 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->inData, written, buffer, size);
633 }
634 if (rc == 0) {
635 rc = TSS_TPMI_YES_NO_Marshalu(&source->decrypt, written, buffer, size);
636 }
637 if (rc == 0) {
638 rc = TSS_TPMI_ALG_CIPHER_MODE_Marshalu(&source->mode, written, buffer, size);
639 }
640 if (rc == 0) {
641 rc = TSS_TPM2B_IV_Marshalu(&source->ivIn, written, buffer, size);
642 }
643 return rc;
644 }
645 TPM_RC
TSS_Hash_In_Marshalu(const Hash_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)646 TSS_Hash_In_Marshalu(const Hash_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
647 {
648 TPM_RC rc = 0;
649 if (rc == 0) {
650 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->data, written, buffer, size);
651 }
652 if (rc == 0) {
653 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
654 }
655 if (rc == 0) {
656 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
657 }
658 return rc;
659 }
660 TPM_RC
TSS_HMAC_In_Marshalu(const HMAC_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)661 TSS_HMAC_In_Marshalu(const HMAC_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
662 {
663 TPM_RC rc = 0;
664 if (rc == 0) {
665 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->handle, written, buffer, size);
666 }
667 if (rc == 0) {
668 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->buffer, written, buffer, size);
669 }
670 if (rc == 0) {
671 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
672 }
673 return rc;
674 }
675 TPM_RC
TSS_GetRandom_In_Marshalu(const GetRandom_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)676 TSS_GetRandom_In_Marshalu(const GetRandom_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
677 {
678 TPM_RC rc = 0;
679 if (rc == 0) {
680 rc = TSS_UINT16_Marshalu(&source->bytesRequested, written, buffer, size);
681 }
682 return rc;
683 }
684 TPM_RC
TSS_StirRandom_In_Marshalu(const StirRandom_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)685 TSS_StirRandom_In_Marshalu(const StirRandom_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
686 {
687 TPM_RC rc = 0;
688 if (rc == 0) {
689 rc = TSS_TPM2B_SENSITIVE_DATA_Marshalu(&source->inData, written, buffer, size);
690 }
691 return rc;
692 }
693 TPM_RC
TSS_HMAC_Start_In_Marshalu(const HMAC_Start_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)694 TSS_HMAC_Start_In_Marshalu(const HMAC_Start_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
695 {
696 TPM_RC rc = 0;
697 if (rc == 0) {
698 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->handle, written, buffer, size);
699 }
700 if (rc == 0) {
701 rc = TSS_TPM2B_AUTH_Marshalu(&source->auth, written, buffer, size);
702 }
703 if (rc == 0) {
704 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
705 }
706 return rc;
707 }
708 TPM_RC
TSS_HashSequenceStart_In_Marshalu(const HashSequenceStart_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)709 TSS_HashSequenceStart_In_Marshalu(const HashSequenceStart_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
710 {
711 TPM_RC rc = 0;
712 if (rc == 0) {
713 rc = TSS_TPM2B_AUTH_Marshalu(&source->auth, written, buffer, size);
714 }
715 if (rc == 0) {
716 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
717 }
718 return rc;
719 }
720 TPM_RC
TSS_SequenceUpdate_In_Marshalu(const SequenceUpdate_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)721 TSS_SequenceUpdate_In_Marshalu(const SequenceUpdate_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
722 {
723 TPM_RC rc = 0;
724 if (rc == 0) {
725 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->sequenceHandle, written, buffer, size);
726 }
727 if (rc == 0) {
728 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->buffer, written, buffer, size);
729 }
730 return rc;
731 }
732 TPM_RC
TSS_SequenceComplete_In_Marshalu(const SequenceComplete_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)733 TSS_SequenceComplete_In_Marshalu(const SequenceComplete_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
734 {
735 TPM_RC rc = 0;
736 if (rc == 0) {
737 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->sequenceHandle, written, buffer, size);
738 }
739 if (rc == 0) {
740 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->buffer, written, buffer, size);
741 }
742 if (rc == 0) {
743 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
744 }
745 return rc;
746 }
747 TPM_RC
TSS_EventSequenceComplete_In_Marshalu(const EventSequenceComplete_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)748 TSS_EventSequenceComplete_In_Marshalu(const EventSequenceComplete_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
749 {
750 TPM_RC rc = 0;
751 if (rc == 0) {
752 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrHandle, written, buffer, size);
753 }
754 if (rc == 0) {
755 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->sequenceHandle, written, buffer, size);
756 }
757 if (rc == 0) {
758 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->buffer, written, buffer, size);
759 }
760 return rc;
761 }
762 TPM_RC
TSS_Certify_In_Marshalu(const Certify_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)763 TSS_Certify_In_Marshalu(const Certify_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
764 {
765 TPM_RC rc = 0;
766 if (rc == 0) {
767 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
768 }
769 if (rc == 0) {
770 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
771 }
772 if (rc == 0) {
773 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
774 }
775 if (rc == 0) {
776 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
777 }
778 return rc;
779 }
780 TPM_RC
TSS_CertifyCreation_In_Marshalu(const CertifyCreation_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)781 TSS_CertifyCreation_In_Marshalu(const CertifyCreation_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
782 {
783 TPM_RC rc = 0;
784 if (rc == 0) {
785 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
786 }
787 if (rc == 0) {
788 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
789 }
790 if (rc == 0) {
791 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
792 }
793 if (rc == 0) {
794 rc = TSS_TPM2B_DIGEST_Marshalu(&source->creationHash, written, buffer, size);
795 }
796 if (rc == 0) {
797 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
798 }
799 if (rc == 0) {
800 rc = TSS_TPMT_TK_CREATION_Marshalu(&source->creationTicket, written, buffer, size);
801 }
802 return rc;
803 }
804 TPM_RC
TSS_CertifyX509_In_Marshalu(const CertifyX509_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)805 TSS_CertifyX509_In_Marshalu(const CertifyX509_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
806 {
807 TPM_RC rc = 0;
808 if (rc == 0) {
809 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
810 }
811 if (rc == 0) {
812 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
813 }
814 if (rc == 0) {
815 rc = TSS_TPM2B_DATA_Marshalu(&source->reserved, written, buffer, size);
816 }
817 if (rc == 0) {
818 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
819 }
820 if (rc == 0) {
821 rc = TSS_TPM2B_MAX_BUFFER_Marshalu(&source->partialCertificate, written, buffer, size);
822 }
823 return rc;
824 }
825 TPM_RC
TSS_Quote_In_Marshalu(const Quote_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)826 TSS_Quote_In_Marshalu(const Quote_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
827 {
828 TPM_RC rc = 0;
829 if (rc == 0) {
830 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
831 }
832 if (rc == 0) {
833 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
834 }
835 if (rc == 0) {
836 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
837 }
838 if (rc == 0) {
839 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->PCRselect, written, buffer, size);
840 }
841 return rc;
842 }
843 TPM_RC
TSS_GetSessionAuditDigest_In_Marshalu(const GetSessionAuditDigest_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)844 TSS_GetSessionAuditDigest_In_Marshalu(const GetSessionAuditDigest_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
845 {
846 TPM_RC rc = 0;
847 if (rc == 0) {
848 rc = TSS_TPMI_RH_ENDORSEMENT_Marshalu(&source->privacyAdminHandle, written, buffer, size);
849 }
850 if (rc == 0) {
851 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
852 }
853 if (rc == 0) {
854 rc = TSS_TPMI_SH_HMAC_Marshalu(&source->sessionHandle, written, buffer, size);
855 }
856 if (rc == 0) {
857 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
858 }
859 if (rc == 0) {
860 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
861 }
862 return rc;
863 }
864 TPM_RC
TSS_GetCommandAuditDigest_In_Marshalu(const GetCommandAuditDigest_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)865 TSS_GetCommandAuditDigest_In_Marshalu(const GetCommandAuditDigest_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
866 {
867 TPM_RC rc = 0;
868 if (rc == 0) {
869 rc = TSS_TPMI_RH_ENDORSEMENT_Marshalu(&source->privacyHandle, written, buffer, size);
870 }
871 if (rc == 0) {
872 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
873 }
874 if (rc == 0) {
875 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
876 }
877 if (rc == 0) {
878 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
879 }
880 return rc;
881 }
882 TPM_RC
TSS_GetTime_In_Marshalu(const GetTime_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)883 TSS_GetTime_In_Marshalu(const GetTime_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
884 {
885 TPM_RC rc = 0;
886 if (rc == 0) {
887 rc = TSS_TPMI_RH_ENDORSEMENT_Marshalu(&source->privacyAdminHandle, written, buffer, size);
888 }
889 if (rc == 0) {
890 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
891 }
892 if (rc == 0) {
893 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
894 }
895 if (rc == 0) {
896 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
897 }
898 return rc;
899 }
900 TPM_RC
TSS_Commit_In_Marshalu(const Commit_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)901 TSS_Commit_In_Marshalu(const Commit_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
902 {
903 TPM_RC rc = 0;
904 if (rc == 0) {
905 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
906 }
907 if (rc == 0) {
908 rc = TSS_TPM2B_ECC_POINT_Marshalu(&source->P1, written, buffer, size);
909 }
910 if (rc == 0) {
911 rc = TSS_TPM2B_SENSITIVE_DATA_Marshalu(&source->s2, written, buffer, size);
912 }
913 if (rc == 0) {
914 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->y2, written, buffer, size);
915 }
916 return rc;
917 }
918 TPM_RC
TSS_EC_Ephemeral_In_Marshalu(const EC_Ephemeral_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)919 TSS_EC_Ephemeral_In_Marshalu(const EC_Ephemeral_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
920 {
921 TPM_RC rc = 0;
922 if (rc == 0) {
923 rc = TSS_TPMI_ECC_CURVE_Marshalu(&source->curveID, written, buffer, size);
924 }
925 return rc;
926 }
927 TPM_RC
TSS_VerifySignature_In_Marshalu(const VerifySignature_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)928 TSS_VerifySignature_In_Marshalu(const VerifySignature_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
929 {
930 TPM_RC rc = 0;
931 if (rc == 0) {
932 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
933 }
934 if (rc == 0) {
935 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
936 }
937 if (rc == 0) {
938 rc = TSS_TPMT_SIGNATURE_Marshalu(&source->signature, written, buffer, size);
939 }
940 return rc;
941 }
942 TPM_RC
TSS_Sign_In_Marshalu(const Sign_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)943 TSS_Sign_In_Marshalu(const Sign_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
944 {
945 TPM_RC rc = 0;
946 if (rc == 0) {
947 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->keyHandle, written, buffer, size);
948 }
949 if (rc == 0) {
950 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
951 }
952 if (rc == 0) {
953 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
954 }
955 if (rc == 0) {
956 rc = TSS_TPMT_TK_HASHCHECK_Marshalu(&source->validation, written, buffer, size);
957 }
958 return rc;
959 }
960 TPM_RC
TSS_SetCommandCodeAuditStatus_In_Marshalu(const SetCommandCodeAuditStatus_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)961 TSS_SetCommandCodeAuditStatus_In_Marshalu(const SetCommandCodeAuditStatus_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
962 {
963 TPM_RC rc = 0;
964 if (rc == 0) {
965 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->auth, written, buffer, size);
966 }
967 if (rc == 0) {
968 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->auditAlg, written, buffer, size);
969 }
970 if (rc == 0) {
971 rc = TSS_TPML_CC_Marshalu(&source->setList, written, buffer, size);
972 }
973 if (rc == 0) {
974 rc = TSS_TPML_CC_Marshalu(&source->clearList, written, buffer, size);
975 }
976 return rc;
977 }
978 TPM_RC
TSS_PCR_Extend_In_Marshalu(const PCR_Extend_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)979 TSS_PCR_Extend_In_Marshalu(const PCR_Extend_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
980 {
981 TPM_RC rc = 0;
982 if (rc == 0) {
983 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrHandle, written, buffer, size);
984 }
985 if (rc == 0) {
986 rc = TSS_TPML_DIGEST_VALUES_Marshalu(&source->digests, written, buffer, size);
987 }
988 return rc;
989 }
990 TPM_RC
TSS_PCR_Event_In_Marshalu(const PCR_Event_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)991 TSS_PCR_Event_In_Marshalu(const PCR_Event_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
992 {
993 TPM_RC rc = 0;
994 if (rc == 0) {
995 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrHandle, written, buffer, size);
996 }
997 if (rc == 0) {
998 rc = TSS_TPM2B_EVENT_Marshalu(&source->eventData, written, buffer, size);
999 }
1000 return rc;
1001 }
1002 TPM_RC
TSS_PCR_Read_In_Marshalu(const PCR_Read_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1003 TSS_PCR_Read_In_Marshalu(const PCR_Read_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1004 {
1005 TPM_RC rc = 0;
1006 if (rc == 0) {
1007 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->pcrSelectionIn, written, buffer, size);
1008 }
1009 return rc;
1010 }
1011 TPM_RC
TSS_PCR_Allocate_In_Marshalu(const PCR_Allocate_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1012 TSS_PCR_Allocate_In_Marshalu(const PCR_Allocate_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1013 {
1014 TPM_RC rc = 0;
1015 if (rc == 0) {
1016 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->authHandle, written, buffer, size);
1017 }
1018 if (rc == 0) {
1019 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->pcrAllocation, written, buffer, size);
1020 }
1021 return rc;
1022 }
1023 TPM_RC
TSS_PCR_SetAuthPolicy_In_Marshalu(const PCR_SetAuthPolicy_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1024 TSS_PCR_SetAuthPolicy_In_Marshalu(const PCR_SetAuthPolicy_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1025 {
1026 TPM_RC rc = 0;
1027 if (rc == 0) {
1028 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->authHandle, written, buffer, size);
1029 }
1030 if (rc == 0) {
1031 rc = TSS_TPM2B_DIGEST_Marshalu(&source->authPolicy, written, buffer, size);
1032 }
1033 if (rc == 0) {
1034 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
1035 }
1036 if (rc == 0) {
1037 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrNum, written, buffer, size);
1038 }
1039 return rc;
1040 }
1041 TPM_RC
TSS_PCR_SetAuthValue_In_Marshalu(const PCR_SetAuthValue_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1042 TSS_PCR_SetAuthValue_In_Marshalu(const PCR_SetAuthValue_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1043 {
1044 TPM_RC rc = 0;
1045 if (rc == 0) {
1046 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrHandle, written, buffer, size);
1047 }
1048 if (rc == 0) {
1049 rc = TSS_TPM2B_DIGEST_Marshalu(&source->auth, written, buffer, size);
1050 }
1051 return rc;
1052 }
1053 TPM_RC
TSS_PCR_Reset_In_Marshalu(const PCR_Reset_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1054 TSS_PCR_Reset_In_Marshalu(const PCR_Reset_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1055 {
1056 TPM_RC rc = 0;
1057 if (rc == 0) {
1058 rc = TSS_TPMI_DH_PCR_Marshalu(&source->pcrHandle, written, buffer, size);
1059 }
1060 return rc;
1061 }
1062 TPM_RC
TSS_PolicySigned_In_Marshalu(const PolicySigned_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1063 TSS_PolicySigned_In_Marshalu(const PolicySigned_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1064 {
1065 TPM_RC rc = 0;
1066 if (rc == 0) {
1067 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->authObject, written, buffer, size);
1068 }
1069 if (rc == 0) {
1070 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1071 }
1072 if (rc == 0) {
1073 rc = TSS_TPM2B_NONCE_Marshalu(&source->nonceTPM, written, buffer, size);
1074 }
1075 if (rc == 0) {
1076 rc = TSS_TPM2B_DIGEST_Marshalu(&source->cpHashA, written, buffer, size);
1077 }
1078 if (rc == 0) {
1079 rc = TSS_TPM2B_NONCE_Marshalu(&source->policyRef, written, buffer, size);
1080 }
1081 if (rc == 0) {
1082 rc = TSS_INT32_Marshalu(&source->expiration, written, buffer, size);
1083 }
1084 if (rc == 0) {
1085 rc = TSS_TPMT_SIGNATURE_Marshalu(&source->auth, written, buffer, size);
1086 }
1087 return rc;
1088 }
1089 TPM_RC
TSS_PolicySecret_In_Marshalu(const PolicySecret_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1090 TSS_PolicySecret_In_Marshalu(const PolicySecret_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1091 {
1092 TPM_RC rc = 0;
1093 if (rc == 0) {
1094 rc = TSS_TPMI_DH_ENTITY_Marshalu(&source->authHandle, written, buffer, size);
1095 }
1096 if (rc == 0) {
1097 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1098 }
1099 if (rc == 0) {
1100 rc = TSS_TPM2B_NONCE_Marshalu(&source->nonceTPM, written, buffer, size);
1101 }
1102 if (rc == 0) {
1103 rc = TSS_TPM2B_DIGEST_Marshalu(&source->cpHashA, written, buffer, size);
1104 }
1105 if (rc == 0) {
1106 rc = TSS_TPM2B_NONCE_Marshalu(&source->policyRef, written, buffer, size);
1107 }
1108 if (rc == 0) {
1109 rc = TSS_INT32_Marshalu(&source->expiration, written, buffer, size);
1110 }
1111 return rc;
1112 }
1113 TPM_RC
TSS_PolicyTicket_In_Marshalu(const PolicyTicket_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1114 TSS_PolicyTicket_In_Marshalu(const PolicyTicket_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1115 {
1116 TPM_RC rc = 0;
1117 if (rc == 0) {
1118 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1119 }
1120 if (rc == 0) {
1121 rc = TSS_TPM2B_TIMEOUT_Marshalu(&source->timeout, written, buffer, size);
1122 }
1123 if (rc == 0) {
1124 rc = TSS_TPM2B_DIGEST_Marshalu(&source->cpHashA, written, buffer, size);
1125 }
1126 if (rc == 0) {
1127 rc = TSS_TPM2B_NONCE_Marshalu(&source->policyRef, written, buffer, size);
1128 }
1129 if (rc == 0) {
1130 rc = TSS_TPM2B_NAME_Marshalu(&source->authName, written, buffer, size);
1131 }
1132 if (rc == 0) {
1133 rc = TSS_TPMT_TK_AUTH_Marshalu(&source->ticket, written, buffer, size);
1134 }
1135 return rc;
1136 }
1137 TPM_RC
TSS_PolicyOR_In_Marshalu(const PolicyOR_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1138 TSS_PolicyOR_In_Marshalu(const PolicyOR_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1139 {
1140 TPM_RC rc = 0;
1141 if (rc == 0) {
1142 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1143 }
1144 if (rc == 0) {
1145 rc = TSS_TPML_DIGEST_Marshalu(&source->pHashList, written, buffer, size);
1146 }
1147 return rc;
1148 }
1149 TPM_RC
TSS_PolicyPCR_In_Marshalu(const PolicyPCR_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1150 TSS_PolicyPCR_In_Marshalu(const PolicyPCR_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1151 {
1152 TPM_RC rc = 0;
1153 if (rc == 0) {
1154 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1155 }
1156 if (rc == 0) {
1157 rc = TSS_TPM2B_DIGEST_Marshalu(&source->pcrDigest, written, buffer, size);
1158 }
1159 if (rc == 0) {
1160 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->pcrs, written, buffer, size);
1161 }
1162 return rc;
1163 }
1164 TPM_RC
TSS_PolicyLocality_In_Marshalu(const PolicyLocality_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1165 TSS_PolicyLocality_In_Marshalu(const PolicyLocality_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1166 {
1167 TPM_RC rc = 0;
1168 if (rc == 0) {
1169 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1170 }
1171 if (rc == 0) {
1172 rc = TSS_TPMA_LOCALITY_Marshalu(&source->locality, written, buffer, size);
1173 }
1174 return rc;
1175 }
1176 TPM_RC
TSS_PolicyNV_In_Marshalu(const PolicyNV_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1177 TSS_PolicyNV_In_Marshalu(const PolicyNV_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1178 {
1179 TPM_RC rc = 0;
1180 if (rc == 0) {
1181 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1182 }
1183 if (rc == 0) {
1184 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1185 }
1186 if (rc == 0) {
1187 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1188 }
1189 if (rc == 0) {
1190 rc = TSS_TPM2B_OPERAND_Marshalu(&source->operandB, written, buffer, size);
1191 }
1192 if (rc == 0) {
1193 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
1194 }
1195 if (rc == 0) {
1196 rc = TSS_TPM_EO_Marshalu(&source->operation, written, buffer, size);
1197 }
1198 return rc;
1199 }
1200 TPM_RC
TSS_PolicyCounterTimer_In_Marshalu(const PolicyCounterTimer_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1201 TSS_PolicyCounterTimer_In_Marshalu(const PolicyCounterTimer_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1202 {
1203 TPM_RC rc = 0;
1204 if (rc == 0) {
1205 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1206 }
1207 if (rc == 0) {
1208 rc = TSS_TPM2B_OPERAND_Marshalu(&source->operandB, written, buffer, size);
1209 }
1210 if (rc == 0) {
1211 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
1212 }
1213 if (rc == 0) {
1214 rc = TSS_TPM_EO_Marshalu(&source->operation, written, buffer, size);
1215 }
1216 return rc;
1217 }
1218 TPM_RC
TSS_PolicyCommandCode_In_Marshalu(const PolicyCommandCode_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1219 TSS_PolicyCommandCode_In_Marshalu(const PolicyCommandCode_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1220 {
1221 TPM_RC rc = 0;
1222 if (rc == 0) {
1223 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1224 }
1225 if (rc == 0) {
1226 rc = TSS_TPM_CC_Marshalu(&source->code, written, buffer, size);
1227 }
1228 return rc;
1229 }
1230 TPM_RC
TSS_PolicyPhysicalPresence_In_Marshalu(const PolicyPhysicalPresence_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1231 TSS_PolicyPhysicalPresence_In_Marshalu(const PolicyPhysicalPresence_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1232 {
1233 TPM_RC rc = 0;
1234 if (rc == 0) {
1235 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1236 }
1237 return rc;
1238 }
1239 TPM_RC
TSS_PolicyCpHash_In_Marshalu(const PolicyCpHash_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1240 TSS_PolicyCpHash_In_Marshalu(const PolicyCpHash_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1241 {
1242 TPM_RC rc = 0;
1243 if (rc == 0) {
1244 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1245 }
1246 if (rc == 0) {
1247 rc = TSS_TPM2B_DIGEST_Marshalu(&source->cpHashA, written, buffer, size);
1248 }
1249 return rc;
1250 }
1251 TPM_RC
TSS_PolicyNameHash_In_Marshalu(const PolicyNameHash_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1252 TSS_PolicyNameHash_In_Marshalu(const PolicyNameHash_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1253 {
1254 TPM_RC rc = 0;
1255 if (rc == 0) {
1256 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1257 }
1258 if (rc == 0) {
1259 rc = TSS_TPM2B_DIGEST_Marshalu(&source->nameHash, written, buffer, size);
1260 }
1261 return rc;
1262 }
1263 TPM_RC
TSS_PolicyDuplicationSelect_In_Marshalu(const PolicyDuplicationSelect_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1264 TSS_PolicyDuplicationSelect_In_Marshalu(const PolicyDuplicationSelect_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1265 {
1266 TPM_RC rc = 0;
1267 if (rc == 0) {
1268 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1269 }
1270 if (rc == 0) {
1271 rc = TSS_TPM2B_NAME_Marshalu(&source->objectName, written, buffer, size);
1272 }
1273 if (rc == 0) {
1274 rc = TSS_TPM2B_NAME_Marshalu(&source->newParentName, written, buffer, size);
1275 }
1276 if (rc == 0) {
1277 rc = TSS_TPMI_YES_NO_Marshalu(&source->includeObject, written, buffer, size);
1278 }
1279 return rc;
1280 }
1281 TPM_RC
TSS_PolicyAuthorize_In_Marshalu(const PolicyAuthorize_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1282 TSS_PolicyAuthorize_In_Marshalu(const PolicyAuthorize_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1283 {
1284 TPM_RC rc = 0;
1285 if (rc == 0) {
1286 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1287 }
1288 if (rc == 0) {
1289 rc = TSS_TPM2B_DIGEST_Marshalu(&source->approvedPolicy, written, buffer, size);
1290 }
1291 if (rc == 0) {
1292 rc = TSS_TPM2B_NONCE_Marshalu(&source->policyRef, written, buffer, size);
1293 }
1294 if (rc == 0) {
1295 rc = TSS_TPM2B_NAME_Marshalu(&source->keySign, written, buffer, size);
1296 }
1297 if (rc == 0) {
1298 rc = TSS_TPMT_TK_VERIFIED_Marshalu(&source->checkTicket, written, buffer, size);
1299 }
1300 return rc;
1301 }
1302 TPM_RC
TSS_PolicyAuthValue_In_Marshalu(const PolicyAuthValue_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1303 TSS_PolicyAuthValue_In_Marshalu(const PolicyAuthValue_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1304 {
1305 TPM_RC rc = 0;
1306 if (rc == 0) {
1307 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1308 }
1309 return rc;
1310 }
1311 TPM_RC
TSS_PolicyPassword_In_Marshalu(const PolicyPassword_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1312 TSS_PolicyPassword_In_Marshalu(const PolicyPassword_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1313 {
1314 TPM_RC rc = 0;
1315 if (rc == 0) {
1316 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1317 }
1318 return rc;
1319 }
1320 TPM_RC
TSS_PolicyGetDigest_In_Marshalu(const PolicyGetDigest_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1321 TSS_PolicyGetDigest_In_Marshalu(const PolicyGetDigest_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1322 {
1323 TPM_RC rc = 0;
1324 if (rc == 0) {
1325 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1326 }
1327 return rc;
1328 }
1329 TPM_RC
TSS_PolicyNvWritten_In_Marshalu(const PolicyNvWritten_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1330 TSS_PolicyNvWritten_In_Marshalu(const PolicyNvWritten_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1331 {
1332 TPM_RC rc = 0;
1333 if (rc == 0) {
1334 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1335 }
1336 if (rc == 0) {
1337 rc = TSS_TPMI_YES_NO_Marshalu(&source->writtenSet, written, buffer, size);
1338 }
1339 return rc;
1340 }
1341 TPM_RC
TSS_PolicyTemplate_In_Marshalu(const PolicyTemplate_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1342 TSS_PolicyTemplate_In_Marshalu(const PolicyTemplate_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1343 {
1344 TPM_RC rc = 0;
1345 if (rc == 0) {
1346 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1347 }
1348 if (rc == 0) {
1349 rc = TSS_TPM2B_DIGEST_Marshalu(&source->templateHash, written, buffer, size);
1350 }
1351 return rc;
1352 }
1353 TPM_RC
TSS_PolicyAuthorizeNV_In_Marshalu(const PolicyAuthorizeNV_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1354 TSS_PolicyAuthorizeNV_In_Marshalu(const PolicyAuthorizeNV_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1355 {
1356 TPM_RC rc = 0;
1357 if (rc == 0) {
1358 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1359 }
1360 if (rc == 0) {
1361 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1362 }
1363 if (rc == 0) {
1364 rc = TSS_TPMI_SH_POLICY_Marshalu(&source->policySession, written, buffer, size);
1365 }
1366 return rc;
1367 }
1368 TPM_RC
TSS_CreatePrimary_In_Marshalu(const CreatePrimary_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1369 TSS_CreatePrimary_In_Marshalu(const CreatePrimary_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1370 {
1371 TPM_RC rc = 0;
1372 if (rc == 0) {
1373 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->primaryHandle, written, buffer, size);
1374 }
1375 if (rc == 0) {
1376 rc = TSS_TPM2B_SENSITIVE_CREATE_Marshalu(&source->inSensitive, written, buffer, size);
1377 }
1378 if (rc == 0) {
1379 rc = TSS_TPM2B_PUBLIC_Marshalu(&source->inPublic, written, buffer, size);
1380 }
1381 if (rc == 0) {
1382 rc = TSS_TPM2B_DATA_Marshalu(&source->outsideInfo, written, buffer, size);
1383 }
1384 if (rc == 0) {
1385 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->creationPCR, written, buffer, size);
1386 }
1387 return rc;
1388 }
1389 TPM_RC
TSS_HierarchyControl_In_Marshalu(const HierarchyControl_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1390 TSS_HierarchyControl_In_Marshalu(const HierarchyControl_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1391 {
1392 TPM_RC rc = 0;
1393 if (rc == 0) {
1394 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->authHandle, written, buffer, size);
1395 }
1396 if (rc == 0) {
1397 rc = TSS_TPMI_RH_ENABLES_Marshalu(&source->enable, written, buffer, size);
1398 }
1399 if (rc == 0) {
1400 rc = TSS_TPMI_YES_NO_Marshalu(&source->state, written, buffer, size);
1401 }
1402 return rc;
1403 }
1404 TPM_RC
TSS_SetPrimaryPolicy_In_Marshalu(const SetPrimaryPolicy_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1405 TSS_SetPrimaryPolicy_In_Marshalu(const SetPrimaryPolicy_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1406 {
1407 TPM_RC rc = 0;
1408 if (rc == 0) {
1409 rc = TSS_TPMI_RH_HIERARCHY_POLICY_Marshalu(&source->authHandle, written, buffer, size);
1410 }
1411 if (rc == 0) {
1412 rc = TSS_TPM2B_DIGEST_Marshalu(&source->authPolicy, written, buffer, size);
1413 }
1414 if (rc == 0) {
1415 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
1416 }
1417 return rc;
1418 }
1419 TPM_RC
TSS_ChangePPS_In_Marshalu(const ChangePPS_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1420 TSS_ChangePPS_In_Marshalu(const ChangePPS_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1421 {
1422 TPM_RC rc = 0;
1423 if (rc == 0) {
1424 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->authHandle, written, buffer, size);
1425 }
1426 return rc;
1427 }
1428 TPM_RC
TSS_ChangeEPS_In_Marshalu(const ChangeEPS_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1429 TSS_ChangeEPS_In_Marshalu(const ChangeEPS_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1430 {
1431 TPM_RC rc = 0;
1432 if (rc == 0) {
1433 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->authHandle, written, buffer, size);
1434 }
1435 return rc;
1436 }
1437 TPM_RC
TSS_Clear_In_Marshalu(const Clear_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1438 TSS_Clear_In_Marshalu(const Clear_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1439 {
1440 TPM_RC rc = 0;
1441 if (rc == 0) {
1442 rc = TSS_TPMI_RH_CLEAR_Marshalu(&source->authHandle, written, buffer, size);
1443 }
1444 return rc;
1445 }
1446 TPM_RC
TSS_ClearControl_In_Marshalu(const ClearControl_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1447 TSS_ClearControl_In_Marshalu(const ClearControl_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1448 {
1449 TPM_RC rc = 0;
1450 if (rc == 0) {
1451 rc = TSS_TPMI_RH_CLEAR_Marshalu(&source->auth, written, buffer, size);
1452 }
1453 if (rc == 0) {
1454 rc = TSS_TPMI_YES_NO_Marshalu(&source->disable, written, buffer, size);
1455 }
1456 return rc;
1457 }
1458 TPM_RC
TSS_HierarchyChangeAuth_In_Marshalu(const HierarchyChangeAuth_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1459 TSS_HierarchyChangeAuth_In_Marshalu(const HierarchyChangeAuth_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1460 {
1461 TPM_RC rc = 0;
1462 if (rc == 0) {
1463 rc = TSS_TPMI_RH_HIERARCHY_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1464 }
1465 if (rc == 0) {
1466 rc = TSS_TPM2B_AUTH_Marshalu(&source->newAuth, written, buffer, size);
1467 }
1468 return rc;
1469 }
1470 TPM_RC
TSS_DictionaryAttackLockReset_In_Marshalu(const DictionaryAttackLockReset_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1471 TSS_DictionaryAttackLockReset_In_Marshalu(const DictionaryAttackLockReset_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1472 {
1473 TPM_RC rc = 0;
1474 if (rc == 0) {
1475 rc = TSS_TPMI_RH_LOCKOUT_Marshalu(&source->lockHandle, written, buffer, size);
1476 }
1477 return rc;
1478 }
1479 TPM_RC
TSS_DictionaryAttackParameters_In_Marshalu(const DictionaryAttackParameters_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1480 TSS_DictionaryAttackParameters_In_Marshalu(const DictionaryAttackParameters_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1481 {
1482 TPM_RC rc = 0;
1483 if (rc == 0) {
1484 rc = TSS_TPMI_RH_LOCKOUT_Marshalu(&source->lockHandle, written, buffer, size);
1485 }
1486 if (rc == 0) {
1487 rc = TSS_UINT32_Marshalu(&source->newMaxTries, written, buffer, size);
1488 }
1489 if (rc == 0) {
1490 rc = TSS_UINT32_Marshalu(&source->newRecoveryTime, written, buffer, size);
1491 }
1492 if (rc == 0) {
1493 rc = TSS_UINT32_Marshalu(&source->lockoutRecovery, written, buffer, size);
1494 }
1495 return rc;
1496 }
1497 TPM_RC
TSS_PP_Commands_In_Marshalu(const PP_Commands_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1498 TSS_PP_Commands_In_Marshalu(const PP_Commands_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1499 {
1500 TPM_RC rc = 0;
1501 if (rc == 0) {
1502 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->auth, written, buffer, size);
1503 }
1504 if (rc == 0) {
1505 rc = TSS_TPML_CC_Marshalu(&source->setList, written, buffer, size);
1506 }
1507 if (rc == 0) {
1508 rc = TSS_TPML_CC_Marshalu(&source->clearList, written, buffer, size);
1509 }
1510 return rc;
1511 }
1512 TPM_RC
TSS_SetAlgorithmSet_In_Marshalu(const SetAlgorithmSet_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1513 TSS_SetAlgorithmSet_In_Marshalu(const SetAlgorithmSet_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1514 {
1515 TPM_RC rc = 0;
1516 if (rc == 0) {
1517 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->authHandle, written, buffer, size);
1518 }
1519 if (rc == 0) {
1520 rc = TSS_UINT32_Marshalu(&source->algorithmSet, written, buffer, size);
1521 }
1522 return rc;
1523 }
1524 TPM_RC
TSS_ContextSave_In_Marshalu(const ContextSave_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1525 TSS_ContextSave_In_Marshalu(const ContextSave_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1526 {
1527 TPM_RC rc = 0;
1528 if (rc == 0) {
1529 rc = TSS_TPMI_DH_CONTEXT_Marshalu(&source->saveHandle, written, buffer, size);
1530 }
1531 return rc;
1532 }
1533 TPM_RC
TSS_ContextLoad_In_Marshalu(const ContextLoad_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1534 TSS_ContextLoad_In_Marshalu(const ContextLoad_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1535 {
1536 TPM_RC rc = 0;
1537 if (rc == 0) {
1538 rc = TSS_TPMS_CONTEXT_Marshalu(&source->context, written, buffer, size);
1539 }
1540 return rc;
1541 }
1542 TPM_RC
TSS_FlushContext_In_Marshalu(const FlushContext_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1543 TSS_FlushContext_In_Marshalu(const FlushContext_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1544 {
1545 TPM_RC rc = 0;
1546 if (rc == 0) {
1547 rc = TSS_TPMI_DH_CONTEXT_Marshalu(&source->flushHandle, written, buffer, size);
1548 }
1549 return rc;
1550 }
1551 TPM_RC
TSS_EvictControl_In_Marshalu(const EvictControl_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1552 TSS_EvictControl_In_Marshalu(const EvictControl_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1553 {
1554 TPM_RC rc = 0;
1555 if (rc == 0) {
1556 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->auth, written, buffer, size);
1557 }
1558 if (rc == 0) {
1559 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->objectHandle, written, buffer, size);
1560 }
1561 if (rc == 0) {
1562 rc = TSS_TPMI_DH_PERSISTENT_Marshalu(&source->persistentHandle, written, buffer, size);
1563 }
1564 return rc;
1565 }
1566 TPM_RC
TSS_ClockSet_In_Marshalu(const ClockSet_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1567 TSS_ClockSet_In_Marshalu(const ClockSet_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1568 {
1569 TPM_RC rc = 0;
1570 if (rc == 0) {
1571 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->auth, written, buffer, size);
1572 }
1573 if (rc == 0) {
1574 rc = TSS_UINT64_Marshalu(&source->newTime, written, buffer, size);
1575 }
1576 return rc;
1577 }
1578 TPM_RC
TSS_ClockRateAdjust_In_Marshalu(const ClockRateAdjust_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1579 TSS_ClockRateAdjust_In_Marshalu(const ClockRateAdjust_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1580 {
1581 TPM_RC rc = 0;
1582 if (rc == 0) {
1583 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->auth, written, buffer, size);
1584 }
1585 if (rc == 0) {
1586 rc = TSS_TPM_CLOCK_ADJUST_Marshalu(&source->rateAdjust, written, buffer, size);
1587 }
1588 return rc;
1589 }
1590 TPM_RC
TSS_GetCapability_In_Marshalu(const GetCapability_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1591 TSS_GetCapability_In_Marshalu(const GetCapability_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1592 {
1593 TPM_RC rc = 0;
1594 if (rc == 0) {
1595 rc = TSS_TPM_CAP_Marshalu(&source->capability, written, buffer, size);
1596 }
1597 if (rc == 0) {
1598 rc = TSS_UINT32_Marshalu(&source->property, written, buffer, size);
1599 }
1600 if (rc == 0) {
1601 rc = TSS_UINT32_Marshalu(&source->propertyCount, written, buffer, size);
1602 }
1603 return rc;
1604 }
1605 TPM_RC
TSS_TestParms_In_Marshalu(const TestParms_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1606 TSS_TestParms_In_Marshalu(const TestParms_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1607 {
1608 TPM_RC rc = 0;
1609 if (rc == 0) {
1610 rc = TSS_TPMT_PUBLIC_PARMS_Marshalu(&source->parameters, written, buffer, size);
1611 }
1612 return rc;
1613 }
1614 TPM_RC
TSS_NV_DefineSpace_In_Marshalu(const NV_DefineSpace_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1615 TSS_NV_DefineSpace_In_Marshalu(const NV_DefineSpace_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1616 {
1617 TPM_RC rc = 0;
1618 if (rc == 0) {
1619 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->authHandle, written, buffer, size);
1620 }
1621 if (rc == 0) {
1622 rc = TSS_TPM2B_AUTH_Marshalu(&source->auth, written, buffer, size);
1623 }
1624 if (rc == 0) {
1625 rc = TSS_TPM2B_NV_PUBLIC_Marshalu(&source->publicInfo, written, buffer, size);
1626 }
1627 return rc;
1628 }
1629 TPM_RC
TSS_NV_UndefineSpace_In_Marshalu(const NV_UndefineSpace_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1630 TSS_NV_UndefineSpace_In_Marshalu(const NV_UndefineSpace_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1631 {
1632 TPM_RC rc = 0;
1633 if (rc == 0) {
1634 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->authHandle, written, buffer, size);
1635 }
1636 if (rc == 0) {
1637 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1638 }
1639 return rc;
1640 }
1641 TPM_RC
TSS_NV_UndefineSpaceSpecial_In_Marshalu(const NV_UndefineSpaceSpecial_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1642 TSS_NV_UndefineSpaceSpecial_In_Marshalu(const NV_UndefineSpaceSpecial_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1643 {
1644 TPM_RC rc = 0;
1645 if (rc == 0) {
1646 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1647 }
1648 if (rc == 0) {
1649 rc = TSS_TPMI_RH_PLATFORM_Marshalu(&source->platform, written, buffer, size);
1650 }
1651 return rc;
1652 }
1653 TPM_RC
TSS_NV_ReadPublic_In_Marshalu(const NV_ReadPublic_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1654 TSS_NV_ReadPublic_In_Marshalu(const NV_ReadPublic_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1655 {
1656 TPM_RC rc = 0;
1657 if (rc == 0) {
1658 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1659 }
1660 return rc;
1661 }
1662 TPM_RC
TSS_NV_Write_In_Marshalu(const NV_Write_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1663 TSS_NV_Write_In_Marshalu(const NV_Write_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1664 {
1665 TPM_RC rc = 0;
1666 if (rc == 0) {
1667 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1668 }
1669 if (rc == 0) {
1670 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1671 }
1672 if (rc == 0) {
1673 rc = TSS_TPM2B_MAX_NV_BUFFER_Marshalu(&source->data, written, buffer, size);
1674 }
1675 if (rc == 0) {
1676 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
1677 }
1678 return rc;
1679 }
1680 TPM_RC
TSS_NV_Increment_In_Marshalu(const NV_Increment_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1681 TSS_NV_Increment_In_Marshalu(const NV_Increment_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1682 {
1683 TPM_RC rc = 0;
1684 if (rc == 0) {
1685 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1686 }
1687 if (rc == 0) {
1688 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1689 }
1690 return rc;
1691 }
1692 TPM_RC
TSS_NV_Extend_In_Marshalu(const NV_Extend_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1693 TSS_NV_Extend_In_Marshalu(const NV_Extend_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1694 {
1695 TPM_RC rc = 0;
1696 if (rc == 0) {
1697 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1698 }
1699 if (rc == 0) {
1700 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1701 }
1702 if (rc == 0) {
1703 rc = TSS_TPM2B_MAX_NV_BUFFER_Marshalu(&source->data, written, buffer, size);
1704 }
1705 return rc;
1706 }
1707 TPM_RC
TSS_NV_SetBits_In_Marshalu(const NV_SetBits_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1708 TSS_NV_SetBits_In_Marshalu(const NV_SetBits_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1709 {
1710 TPM_RC rc = 0;
1711 if (rc == 0) {
1712 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1713 }
1714 if (rc == 0) {
1715 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1716 }
1717 if (rc == 0) {
1718 rc = TSS_UINT64_Marshalu(&source->bits, written, buffer, size);
1719 }
1720 return rc;
1721 }
1722 TPM_RC
TSS_NV_WriteLock_In_Marshalu(const NV_WriteLock_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1723 TSS_NV_WriteLock_In_Marshalu(const NV_WriteLock_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1724 {
1725 TPM_RC rc = 0;
1726 if (rc == 0) {
1727 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1728 }
1729 if (rc == 0) {
1730 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1731 }
1732 return rc;
1733 }
1734 TPM_RC
TSS_NV_GlobalWriteLock_In_Marshalu(const NV_GlobalWriteLock_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1735 TSS_NV_GlobalWriteLock_In_Marshalu(const NV_GlobalWriteLock_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1736 {
1737 TPM_RC rc = 0;
1738 if (rc == 0) {
1739 rc = TSS_TPMI_RH_PROVISION_Marshalu(&source->authHandle, written, buffer, size);
1740 }
1741 return rc;
1742 }
1743 TPM_RC
TSS_NV_Read_In_Marshalu(const NV_Read_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1744 TSS_NV_Read_In_Marshalu(const NV_Read_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1745 {
1746 TPM_RC rc = 0;
1747 if (rc == 0) {
1748 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1749 }
1750 if (rc == 0) {
1751 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1752 }
1753 if (rc == 0) {
1754 rc = TSS_UINT16_Marshalu(&source->size, written, buffer, size);
1755 }
1756 if (rc == 0) {
1757 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
1758 }
1759 return rc;
1760 }
1761 TPM_RC
TSS_NV_ReadLock_In_Marshalu(const NV_ReadLock_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1762 TSS_NV_ReadLock_In_Marshalu(const NV_ReadLock_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1763 {
1764 TPM_RC rc = 0;
1765 if (rc == 0) {
1766 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1767 }
1768 if (rc == 0) {
1769 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1770 }
1771 return rc;
1772 }
1773 TPM_RC
TSS_NV_ChangeAuth_In_Marshalu(const NV_ChangeAuth_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1774 TSS_NV_ChangeAuth_In_Marshalu(const NV_ChangeAuth_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1775 {
1776 TPM_RC rc = 0;
1777 if (rc == 0) {
1778 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1779 }
1780 if (rc == 0) {
1781 rc = TSS_TPM2B_AUTH_Marshalu(&source->newAuth, written, buffer, size);
1782 }
1783 return rc;
1784 }
1785 TPM_RC
TSS_NV_Certify_In_Marshalu(const NV_Certify_In * source,uint16_t * written,BYTE ** buffer,uint32_t * size)1786 TSS_NV_Certify_In_Marshalu(const NV_Certify_In *source, uint16_t *written, BYTE **buffer, uint32_t *size)
1787 {
1788 TPM_RC rc = 0;
1789 if (rc == 0) {
1790 rc = TSS_TPMI_DH_OBJECT_Marshalu(&source->signHandle, written, buffer, size);
1791 }
1792 if (rc == 0) {
1793 rc = TSS_TPMI_RH_NV_AUTH_Marshalu(&source->authHandle, written, buffer, size);
1794 }
1795 if (rc == 0) {
1796 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
1797 }
1798 if (rc == 0) {
1799 rc = TSS_TPM2B_DATA_Marshalu(&source->qualifyingData, written, buffer, size);
1800 }
1801 if (rc == 0) {
1802 rc = TSS_TPMT_SIG_SCHEME_Marshalu(&source->inScheme, written, buffer, size);
1803 }
1804 if (rc == 0) {
1805 rc = TSS_UINT16_Marshalu(&source->size, written, buffer, size);
1806 }
1807 if (rc == 0) {
1808 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
1809 }
1810 return rc;
1811 }
1812
1813 /*
1814 TPM 2.0 Response parameter unmarshaling
1815 */
1816
1817 TPM_RC
TSS_IncrementalSelfTest_Out_Unmarshalu(IncrementalSelfTest_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1818 TSS_IncrementalSelfTest_Out_Unmarshalu(IncrementalSelfTest_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1819 {
1820 TPM_RC rc = TPM_RC_SUCCESS;
1821 uint32_t parameterSize = 0;
1822 if (rc == TPM_RC_SUCCESS) {
1823 if (tag == TPM_ST_SESSIONS) {
1824 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1825 }
1826 }
1827 if (rc == TPM_RC_SUCCESS) {
1828 rc = TSS_TPML_ALG_Unmarshalu(&target->toDoList, buffer, size);
1829 }
1830 return rc;
1831 }
1832 TPM_RC
TSS_GetTestResult_Out_Unmarshalu(GetTestResult_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1833 TSS_GetTestResult_Out_Unmarshalu(GetTestResult_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1834 {
1835 TPM_RC rc = TPM_RC_SUCCESS;
1836
1837 uint32_t parameterSize;
1838 if (rc == TPM_RC_SUCCESS) {
1839 if (tag == TPM_ST_SESSIONS) {
1840 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1841 }
1842 }
1843 if (rc == TPM_RC_SUCCESS) {
1844 rc = TSS_TPM2B_MAX_BUFFER_Unmarshalu(&target->outData, buffer, size);
1845 }
1846 if (rc == TPM_RC_SUCCESS) {
1847 rc = TSS_TPM_RC_Unmarshalu(&target->testResult, buffer, size);
1848 }
1849 return rc;
1850 }
1851 TPM_RC
TSS_StartAuthSession_Out_Unmarshalu(StartAuthSession_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1852 TSS_StartAuthSession_Out_Unmarshalu(StartAuthSession_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1853 {
1854 TPM_RC rc = TPM_RC_SUCCESS;
1855 uint32_t parameterSize = 0;
1856
1857 if (rc == TPM_RC_SUCCESS) {
1858 rc = TSS_TPMI_SH_AUTH_SESSION_Unmarshalu(&target->sessionHandle, buffer, size, NO);
1859 }
1860 if (rc == TPM_RC_SUCCESS) {
1861 if (tag == TPM_ST_SESSIONS) {
1862 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1863 }
1864 }
1865 if (rc == TPM_RC_SUCCESS) {
1866 rc = TSS_TPM2B_NONCE_Unmarshalu(&target->nonceTPM, buffer, size);
1867 }
1868 return rc;
1869 }
1870 TPM_RC
TSS_Create_Out_Unmarshalu(Create_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1871 TSS_Create_Out_Unmarshalu(Create_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1872 {
1873 TPM_RC rc = TPM_RC_SUCCESS;
1874 uint32_t parameterSize = 0;
1875
1876 if (rc == TPM_RC_SUCCESS) {
1877 if (tag == TPM_ST_SESSIONS) {
1878 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1879 }
1880 }
1881 if (rc == TPM_RC_SUCCESS) {
1882 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->outPrivate, buffer, size);
1883 }
1884 if (rc == TPM_RC_SUCCESS) {
1885 rc = TSS_TPM2B_PUBLIC_Unmarshalu(&target->outPublic, buffer, size, NO);
1886 }
1887 if (rc == TPM_RC_SUCCESS) {
1888 rc = TSS_TPM2B_CREATION_DATA_Unmarshalu(&target->creationData, buffer, size);
1889 }
1890 if (rc == TPM_RC_SUCCESS) {
1891 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->creationHash, buffer, size);
1892 }
1893 if (rc == TPM_RC_SUCCESS) {
1894 rc = TSS_TPMT_TK_CREATION_Unmarshalu(&target->creationTicket, buffer, size);
1895 }
1896 return rc;
1897 }
1898 TPM_RC
TSS_Load_Out_Unmarshalu(Load_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1899 TSS_Load_Out_Unmarshalu(Load_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1900 {
1901 TPM_RC rc = TPM_RC_SUCCESS;
1902 uint32_t parameterSize = 0;
1903
1904 if (rc == TPM_RC_SUCCESS) {
1905 rc = TSS_TPM_HANDLE_Unmarshalu(&target->objectHandle, buffer, size);
1906 }
1907 if (rc == TPM_RC_SUCCESS) {
1908 if (tag == TPM_ST_SESSIONS) {
1909 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1910 }
1911 }
1912 if (rc == TPM_RC_SUCCESS) {
1913 rc = TSS_TPM2B_NAME_Unmarshalu(&target->name, buffer, size);
1914 }
1915 return rc;
1916 }
1917 TPM_RC
TSS_LoadExternal_Out_Unmarshalu(LoadExternal_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1918 TSS_LoadExternal_Out_Unmarshalu(LoadExternal_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1919 {
1920 TPM_RC rc = TPM_RC_SUCCESS;
1921 uint32_t parameterSize = 0;
1922
1923 if (rc == TPM_RC_SUCCESS) {
1924 rc = TSS_TPM_HANDLE_Unmarshalu(&target->objectHandle, buffer, size);
1925 }
1926 if (rc == TPM_RC_SUCCESS) {
1927 if (tag == TPM_ST_SESSIONS) {
1928 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1929 }
1930 }
1931 if (rc == TPM_RC_SUCCESS) {
1932 rc = TSS_TPM2B_NAME_Unmarshalu(&target->name, buffer, size);
1933 }
1934 return rc;
1935 }
1936 TPM_RC
TSS_ReadPublic_Out_Unmarshalu(ReadPublic_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1937 TSS_ReadPublic_Out_Unmarshalu(ReadPublic_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1938 {
1939 TPM_RC rc = TPM_RC_SUCCESS;
1940 uint32_t parameterSize = 0;
1941
1942 if (rc == TPM_RC_SUCCESS) {
1943 if (tag == TPM_ST_SESSIONS) {
1944 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1945 }
1946 }
1947 if (rc == TPM_RC_SUCCESS) {
1948 rc = TSS_TPM2B_PUBLIC_Unmarshalu(&target->outPublic, buffer, size, NO);
1949 }
1950 if (rc == TPM_RC_SUCCESS) {
1951 rc = TSS_TPM2B_NAME_Unmarshalu(&target->name, buffer, size);
1952 }
1953 if (rc == TPM_RC_SUCCESS) {
1954 rc = TSS_TPM2B_NAME_Unmarshalu(&target->qualifiedName, buffer, size);
1955 }
1956 return rc;
1957 }
1958 TPM_RC
TSS_ActivateCredential_Out_Unmarshalu(ActivateCredential_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1959 TSS_ActivateCredential_Out_Unmarshalu(ActivateCredential_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1960 {
1961 TPM_RC rc = TPM_RC_SUCCESS;
1962 uint32_t parameterSize = 0;
1963
1964 if (rc == TPM_RC_SUCCESS) {
1965 if (tag == TPM_ST_SESSIONS) {
1966 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1967 }
1968 }
1969 if (rc == TPM_RC_SUCCESS) {
1970 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->certInfo, buffer, size);
1971 }
1972 return rc;
1973 }
1974 TPM_RC
TSS_MakeCredential_Out_Unmarshalu(MakeCredential_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1975 TSS_MakeCredential_Out_Unmarshalu(MakeCredential_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1976 {
1977 TPM_RC rc = TPM_RC_SUCCESS;
1978 uint32_t parameterSize = 0;
1979
1980 if (rc == TPM_RC_SUCCESS) {
1981 if (tag == TPM_ST_SESSIONS) {
1982 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
1983 }
1984 }
1985 if (rc == TPM_RC_SUCCESS) {
1986 rc = TSS_TPM2B_ID_OBJECT_Unmarshalu(&target->credentialBlob, buffer, size);
1987 }
1988 if (rc == TPM_RC_SUCCESS) {
1989 rc = TSS_TPM2B_ENCRYPTED_SECRET_Unmarshalu(&target->secret, buffer, size);
1990 }
1991 return rc;
1992 }
1993 TPM_RC
TSS_Unseal_Out_Unmarshalu(Unseal_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)1994 TSS_Unseal_Out_Unmarshalu(Unseal_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
1995 {
1996 TPM_RC rc = TPM_RC_SUCCESS;
1997 uint32_t parameterSize = 0;
1998 if (rc == TPM_RC_SUCCESS) {
1999 if (tag == TPM_ST_SESSIONS) {
2000 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2001 }
2002 }
2003 if (rc == TPM_RC_SUCCESS) {
2004 rc = TSS_TPM2B_SENSITIVE_DATA_Unmarshalu(&target->outData, buffer, size);
2005 }
2006 return rc;
2007 }
2008 TPM_RC
TSS_ObjectChangeAuth_Out_Unmarshalu(ObjectChangeAuth_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2009 TSS_ObjectChangeAuth_Out_Unmarshalu(ObjectChangeAuth_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2010 {
2011 TPM_RC rc = TPM_RC_SUCCESS;
2012 uint32_t parameterSize = 0;
2013 if (rc == TPM_RC_SUCCESS) {
2014 if (tag == TPM_ST_SESSIONS) {
2015 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2016 }
2017 }
2018 if (rc == TPM_RC_SUCCESS) {
2019 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->outPrivate, buffer, size);
2020 }
2021 return rc;
2022 }
2023 TPM_RC
TSS_CreateLoaded_Out_Unmarshalu(CreateLoaded_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2024 TSS_CreateLoaded_Out_Unmarshalu(CreateLoaded_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2025 {
2026 TPM_RC rc = TPM_RC_SUCCESS;
2027 uint32_t parameterSize = 0;
2028
2029 if (rc == TPM_RC_SUCCESS) {
2030 rc = TSS_TPM_HANDLE_Unmarshalu(&target->objectHandle, buffer, size);
2031 }
2032 if (rc == TPM_RC_SUCCESS) {
2033 if (tag == TPM_ST_SESSIONS) {
2034 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2035 }
2036 }
2037 if (rc == TPM_RC_SUCCESS) {
2038 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->outPrivate, buffer, size);
2039 }
2040 if (rc == TPM_RC_SUCCESS) {
2041 rc = TSS_TPM2B_PUBLIC_Unmarshalu(&target->outPublic, buffer, size, NO);
2042 }
2043 if (rc == TPM_RC_SUCCESS) {
2044 rc = TSS_TPM2B_NAME_Unmarshalu(&target->name, buffer, size);
2045 }
2046 return rc;
2047 }
2048 TPM_RC
TSS_Duplicate_Out_Unmarshalu(Duplicate_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2049 TSS_Duplicate_Out_Unmarshalu(Duplicate_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2050 {
2051 TPM_RC rc = TPM_RC_SUCCESS;
2052 uint32_t parameterSize = 0;
2053 if (rc == TPM_RC_SUCCESS) {
2054 if (tag == TPM_ST_SESSIONS) {
2055 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2056 }
2057 }
2058 if (rc == TPM_RC_SUCCESS) {
2059 rc = TSS_TPM2B_DATA_Unmarshalu(&target->encryptionKeyOut, buffer, size);
2060 }
2061 if (rc == TPM_RC_SUCCESS) {
2062 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->duplicate, buffer, size);
2063 }
2064 if (rc == TPM_RC_SUCCESS) {
2065 rc = TSS_TPM2B_ENCRYPTED_SECRET_Unmarshalu(&target->outSymSeed, buffer, size);
2066 }
2067 return rc;
2068 }
2069 TPM_RC
TSS_Rewrap_Out_Unmarshalu(Rewrap_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2070 TSS_Rewrap_Out_Unmarshalu(Rewrap_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2071 {
2072 TPM_RC rc = TPM_RC_SUCCESS;
2073 uint32_t parameterSize = 0;
2074 if (rc == TPM_RC_SUCCESS) {
2075 if (tag == TPM_ST_SESSIONS) {
2076 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2077 }
2078 }
2079 if (rc == TPM_RC_SUCCESS) {
2080 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->outDuplicate, buffer, size);
2081 }
2082 if (rc == TPM_RC_SUCCESS) {
2083 rc = TSS_TPM2B_ENCRYPTED_SECRET_Unmarshalu(&target->outSymSeed, buffer, size);
2084 }
2085 return rc;
2086 }
2087 TPM_RC
TSS_Import_Out_Unmarshalu(Import_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2088 TSS_Import_Out_Unmarshalu(Import_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2089 {
2090 TPM_RC rc = TPM_RC_SUCCESS;
2091 uint32_t parameterSize = 0;
2092 if (rc == TPM_RC_SUCCESS) {
2093 if (tag == TPM_ST_SESSIONS) {
2094 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2095 }
2096 }
2097 if (rc == TPM_RC_SUCCESS) {
2098 rc = TSS_TPM2B_PRIVATE_Unmarshalu(&target->outPrivate, buffer, size);
2099 }
2100 return rc;
2101 }
2102 TPM_RC
TSS_RSA_Encrypt_Out_Unmarshalu(RSA_Encrypt_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2103 TSS_RSA_Encrypt_Out_Unmarshalu(RSA_Encrypt_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2104 {
2105 TPM_RC rc = TPM_RC_SUCCESS;
2106 uint32_t parameterSize = 0;
2107 if (rc == TPM_RC_SUCCESS) {
2108 if (tag == TPM_ST_SESSIONS) {
2109 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2110 }
2111 }
2112 if (rc == TPM_RC_SUCCESS) {
2113 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Unmarshalu(&target->outData, buffer, size);
2114 }
2115 return rc;
2116 }
2117 TPM_RC
TSS_RSA_Decrypt_Out_Unmarshalu(RSA_Decrypt_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2118 TSS_RSA_Decrypt_Out_Unmarshalu(RSA_Decrypt_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2119 {
2120 TPM_RC rc = TPM_RC_SUCCESS;
2121 uint32_t parameterSize = 0;
2122 if (rc == TPM_RC_SUCCESS) {
2123 if (tag == TPM_ST_SESSIONS) {
2124 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2125 }
2126 }
2127 if (rc == TPM_RC_SUCCESS) {
2128 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Unmarshalu(&target->message, buffer, size);
2129 }
2130 return rc;
2131 }
2132 TPM_RC
TSS_ECDH_KeyGen_Out_Unmarshalu(ECDH_KeyGen_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2133 TSS_ECDH_KeyGen_Out_Unmarshalu(ECDH_KeyGen_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2134 {
2135 TPM_RC rc = TPM_RC_SUCCESS;
2136 uint32_t parameterSize = 0;
2137 if (rc == TPM_RC_SUCCESS) {
2138 if (tag == TPM_ST_SESSIONS) {
2139 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2140 }
2141 }
2142 if (rc == TPM_RC_SUCCESS) {
2143 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->zPoint, buffer, size);
2144 }
2145 if (rc == TPM_RC_SUCCESS) {
2146 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->pubPoint, buffer, size);
2147 }
2148 return rc;
2149 }
2150 TPM_RC
TSS_ECDH_ZGen_Out_Unmarshalu(ECDH_ZGen_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2151 TSS_ECDH_ZGen_Out_Unmarshalu(ECDH_ZGen_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2152 {
2153 TPM_RC rc = TPM_RC_SUCCESS;
2154 uint32_t parameterSize = 0;
2155 if (rc == TPM_RC_SUCCESS) {
2156 if (tag == TPM_ST_SESSIONS) {
2157 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2158 }
2159 }
2160 if (rc == TPM_RC_SUCCESS) {
2161 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->outPoint, buffer, size);
2162 }
2163 return rc;
2164 }
2165 TPM_RC
TSS_ECC_Parameters_Out_Unmarshalu(ECC_Parameters_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2166 TSS_ECC_Parameters_Out_Unmarshalu(ECC_Parameters_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2167 {
2168 TPM_RC rc = TPM_RC_SUCCESS;
2169 uint32_t parameterSize = 0;
2170 if (rc == TPM_RC_SUCCESS) {
2171 if (tag == TPM_ST_SESSIONS) {
2172 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2173 }
2174 }
2175 if (rc == TPM_RC_SUCCESS) {
2176 rc = TSS_TPMS_ALGORITHM_DETAIL_ECC_Unmarshalu(&target->parameters, buffer, size);
2177 }
2178 return rc;
2179 }
2180 TPM_RC
TSS_ZGen_2Phase_Out_Unmarshalu(ZGen_2Phase_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2181 TSS_ZGen_2Phase_Out_Unmarshalu(ZGen_2Phase_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2182 {
2183 TPM_RC rc = TPM_RC_SUCCESS;
2184 uint32_t parameterSize = 0;
2185 if (rc == TPM_RC_SUCCESS) {
2186 if (tag == TPM_ST_SESSIONS) {
2187 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2188 }
2189 }
2190 if (rc == TPM_RC_SUCCESS) {
2191 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->outZ1, buffer, size);
2192 }
2193 if (rc == TPM_RC_SUCCESS) {
2194 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->outZ2, buffer, size);
2195 }
2196 return rc;
2197 }
2198 TPM_RC
TSS_EncryptDecrypt_Out_Unmarshalu(EncryptDecrypt_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2199 TSS_EncryptDecrypt_Out_Unmarshalu(EncryptDecrypt_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2200 {
2201 TPM_RC rc = TPM_RC_SUCCESS;
2202 uint32_t parameterSize = 0;
2203 if (rc == TPM_RC_SUCCESS) {
2204 if (tag == TPM_ST_SESSIONS) {
2205 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2206 }
2207 }
2208 if (rc == TPM_RC_SUCCESS) {
2209 rc = TSS_TPM2B_MAX_BUFFER_Unmarshalu(&target->outData, buffer, size);
2210 }
2211 if (rc == TPM_RC_SUCCESS) {
2212 rc = TSS_TPM2B_IV_Unmarshalu(&target->ivOut, buffer, size);
2213 }
2214 return rc;
2215 }
2216 TPM_RC
TSS_EncryptDecrypt2_Out_Unmarshalu(EncryptDecrypt2_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2217 TSS_EncryptDecrypt2_Out_Unmarshalu(EncryptDecrypt2_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2218 {
2219 return TSS_EncryptDecrypt_Out_Unmarshalu((EncryptDecrypt_Out *)target, tag, buffer, size);
2220 }
2221 TPM_RC
TSS_Hash_Out_Unmarshalu(Hash_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2222 TSS_Hash_Out_Unmarshalu(Hash_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2223 {
2224 TPM_RC rc = TPM_RC_SUCCESS;
2225 uint32_t parameterSize = 0;
2226 if (rc == TPM_RC_SUCCESS) {
2227 if (tag == TPM_ST_SESSIONS) {
2228 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2229 }
2230 }
2231 if (rc == TPM_RC_SUCCESS) {
2232 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->outHash, buffer, size);
2233 }
2234 if (rc == TPM_RC_SUCCESS) {
2235 rc = TSS_TPMT_TK_HASHCHECK_Unmarshalu(&target->validation, buffer, size);
2236 }
2237 return rc;
2238 }
2239 TPM_RC
TSS_HMAC_Out_Unmarshalu(HMAC_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2240 TSS_HMAC_Out_Unmarshalu(HMAC_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2241 {
2242 TPM_RC rc = TPM_RC_SUCCESS;
2243 uint32_t parameterSize = 0;
2244 if (rc == TPM_RC_SUCCESS) {
2245 if (tag == TPM_ST_SESSIONS) {
2246 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2247 }
2248 }
2249 if (rc == TPM_RC_SUCCESS) {
2250 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->outHMAC, buffer, size);
2251 }
2252 return rc;
2253 }
2254 TPM_RC
TSS_GetRandom_Out_Unmarshalu(GetRandom_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2255 TSS_GetRandom_Out_Unmarshalu(GetRandom_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2256 {
2257 TPM_RC rc = TPM_RC_SUCCESS;
2258 uint32_t parameterSize = 0;
2259 if (rc == TPM_RC_SUCCESS) {
2260 if (tag == TPM_ST_SESSIONS) {
2261 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2262 }
2263 }
2264 if (rc == TPM_RC_SUCCESS) {
2265 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->randomBytes, buffer, size);
2266 }
2267 return rc;
2268 }
2269 TPM_RC
TSS_HMAC_Start_Out_Unmarshalu(HMAC_Start_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2270 TSS_HMAC_Start_Out_Unmarshalu(HMAC_Start_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2271 {
2272 TPM_RC rc = TPM_RC_SUCCESS;
2273 uint32_t parameterSize = 0;
2274 if (rc == TPM_RC_SUCCESS) {
2275 rc = TSS_TPMI_DH_OBJECT_Unmarshalu(&target->sequenceHandle, buffer, size, NO);
2276 }
2277 if (rc == TPM_RC_SUCCESS) {
2278 if (tag == TPM_ST_SESSIONS) {
2279 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2280 }
2281 }
2282 return rc;
2283 }
2284 TPM_RC
TSS_HashSequenceStart_Out_Unmarshalu(HashSequenceStart_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2285 TSS_HashSequenceStart_Out_Unmarshalu(HashSequenceStart_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2286 {
2287 TPM_RC rc = TPM_RC_SUCCESS;
2288 uint32_t parameterSize = 0;
2289 if (rc == TPM_RC_SUCCESS) {
2290 rc = TSS_TPMI_DH_OBJECT_Unmarshalu(&target->sequenceHandle, buffer, size, NO);
2291 }
2292 if (rc == TPM_RC_SUCCESS) {
2293 if (tag == TPM_ST_SESSIONS) {
2294 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2295 }
2296 }
2297 return rc;
2298 }
2299 TPM_RC
TSS_SequenceComplete_Out_Unmarshalu(SequenceComplete_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2300 TSS_SequenceComplete_Out_Unmarshalu(SequenceComplete_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2301 {
2302 TPM_RC rc = TPM_RC_SUCCESS;
2303 uint32_t parameterSize = 0;
2304 if (rc == TPM_RC_SUCCESS) {
2305 if (tag == TPM_ST_SESSIONS) {
2306 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2307 }
2308 }
2309 if (rc == TPM_RC_SUCCESS) {
2310 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->result, buffer, size);
2311 }
2312 if (rc == TPM_RC_SUCCESS) {
2313 rc = TSS_TPMT_TK_HASHCHECK_Unmarshalu(&target->validation, buffer, size);
2314 }
2315 return rc;
2316 }
2317 TPM_RC
TSS_EventSequenceComplete_Out_Unmarshalu(EventSequenceComplete_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2318 TSS_EventSequenceComplete_Out_Unmarshalu(EventSequenceComplete_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2319 {
2320 TPM_RC rc = TPM_RC_SUCCESS;
2321 uint32_t parameterSize = 0;
2322 if (rc == TPM_RC_SUCCESS) {
2323 if (tag == TPM_ST_SESSIONS) {
2324 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2325 }
2326 }
2327 if (rc == TPM_RC_SUCCESS) {
2328 rc = TSS_TPML_DIGEST_VALUES_Unmarshalu(&target->results, buffer, size);
2329 }
2330 return rc;
2331 }
2332 TPM_RC
TSS_Certify_Out_Unmarshalu(Certify_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2333 TSS_Certify_Out_Unmarshalu(Certify_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2334 {
2335 TPM_RC rc = TPM_RC_SUCCESS;
2336 uint32_t parameterSize = 0;
2337 if (rc == TPM_RC_SUCCESS) {
2338 if (tag == TPM_ST_SESSIONS) {
2339 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2340 }
2341 }
2342 if (rc == TPM_RC_SUCCESS) {
2343 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->certifyInfo, buffer, size);
2344 }
2345 if (rc == TPM_RC_SUCCESS) {
2346 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2347 }
2348 return rc;
2349 }
2350 TPM_RC
TSS_CertifyCreation_Out_Unmarshalu(CertifyCreation_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2351 TSS_CertifyCreation_Out_Unmarshalu(CertifyCreation_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2352 {
2353 TPM_RC rc = TPM_RC_SUCCESS;
2354 uint32_t parameterSize = 0;
2355 if (rc == TPM_RC_SUCCESS) {
2356 if (tag == TPM_ST_SESSIONS) {
2357 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2358 }
2359 }
2360 if (rc == TPM_RC_SUCCESS) {
2361 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->certifyInfo, buffer, size);
2362 }
2363 if (rc == TPM_RC_SUCCESS) {
2364 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2365 }
2366 return rc;
2367 }
2368 TPM_RC
TSS_CertifyX509_Out_Unmarshalu(CertifyX509_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2369 TSS_CertifyX509_Out_Unmarshalu(CertifyX509_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2370 {
2371 TPM_RC rc = TPM_RC_SUCCESS;
2372 uint32_t parameterSize = 0;
2373 if (rc == TPM_RC_SUCCESS) {
2374 if (tag == TPM_ST_SESSIONS) {
2375 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2376 }
2377 }
2378 if (rc == TPM_RC_SUCCESS) {
2379 rc = TSS_TPM2B_MAX_BUFFER_Unmarshalu(&target->addedToCertificate, buffer, size);
2380 }
2381 if (rc == TPM_RC_SUCCESS) {
2382 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->tbsDigest, buffer, size);
2383 }
2384 if (rc == TPM_RC_SUCCESS) {
2385 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2386 }
2387 return rc;
2388 }
2389 TPM_RC
TSS_Quote_Out_Unmarshalu(Quote_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2390 TSS_Quote_Out_Unmarshalu(Quote_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2391 {
2392 TPM_RC rc = TPM_RC_SUCCESS;
2393 uint32_t parameterSize = 0;
2394 if (rc == TPM_RC_SUCCESS) {
2395 if (tag == TPM_ST_SESSIONS) {
2396 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2397 }
2398 }
2399 if (rc == TPM_RC_SUCCESS) {
2400 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->quoted, buffer, size);
2401 }
2402 if (rc == TPM_RC_SUCCESS) {
2403 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2404 }
2405 return rc;
2406 }
2407 TPM_RC
TSS_GetSessionAuditDigest_Out_Unmarshalu(GetSessionAuditDigest_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2408 TSS_GetSessionAuditDigest_Out_Unmarshalu(GetSessionAuditDigest_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2409 {
2410 TPM_RC rc = TPM_RC_SUCCESS;
2411 uint32_t parameterSize = 0;
2412 if (rc == TPM_RC_SUCCESS) {
2413 if (tag == TPM_ST_SESSIONS) {
2414 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2415 }
2416 }
2417 if (rc == TPM_RC_SUCCESS) {
2418 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->auditInfo, buffer, size);
2419 }
2420 if (rc == TPM_RC_SUCCESS) {
2421 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2422 }
2423 return rc;
2424 }
2425 TPM_RC
TSS_GetCommandAuditDigest_Out_Unmarshalu(GetCommandAuditDigest_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2426 TSS_GetCommandAuditDigest_Out_Unmarshalu(GetCommandAuditDigest_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2427 {
2428 TPM_RC rc = TPM_RC_SUCCESS;
2429 uint32_t parameterSize = 0;
2430 if (rc == TPM_RC_SUCCESS) {
2431 if (tag == TPM_ST_SESSIONS) {
2432 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2433 }
2434 }
2435 if (rc == TPM_RC_SUCCESS) {
2436 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->auditInfo, buffer, size);
2437 }
2438 if (rc == TPM_RC_SUCCESS) {
2439 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2440 }
2441 return rc;
2442 }
2443 TPM_RC
TSS_GetTime_Out_Unmarshalu(GetTime_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2444 TSS_GetTime_Out_Unmarshalu(GetTime_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2445 {
2446 TPM_RC rc = TPM_RC_SUCCESS;
2447 uint32_t parameterSize = 0;
2448 if (rc == TPM_RC_SUCCESS) {
2449 if (tag == TPM_ST_SESSIONS) {
2450 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2451 }
2452 }
2453 if (rc == TPM_RC_SUCCESS) {
2454 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->timeInfo, buffer, size);
2455 }
2456 if (rc == TPM_RC_SUCCESS) {
2457 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2458 }
2459 return rc;
2460 }
2461 TPM_RC
TSS_Commit_Out_Unmarshalu(Commit_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2462 TSS_Commit_Out_Unmarshalu(Commit_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2463 {
2464 TPM_RC rc = TPM_RC_SUCCESS;
2465 uint32_t parameterSize = 0;
2466 if (rc == TPM_RC_SUCCESS) {
2467 if (tag == TPM_ST_SESSIONS) {
2468 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2469 }
2470 }
2471 if (rc == TPM_RC_SUCCESS) {
2472 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->K, buffer, size);
2473 }
2474 if (rc == TPM_RC_SUCCESS) {
2475 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->L, buffer, size);
2476 }
2477 if (rc == TPM_RC_SUCCESS) {
2478 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->E, buffer, size);
2479 }
2480 if (rc == TPM_RC_SUCCESS) {
2481 rc = TSS_UINT16_Unmarshalu(&target->counter, buffer, size);
2482 }
2483 return rc;
2484 }
2485 TPM_RC
TSS_EC_Ephemeral_Out_Unmarshalu(EC_Ephemeral_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2486 TSS_EC_Ephemeral_Out_Unmarshalu(EC_Ephemeral_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2487 {
2488 TPM_RC rc = TPM_RC_SUCCESS;
2489 uint32_t parameterSize = 0;
2490 if (rc == TPM_RC_SUCCESS) {
2491 if (tag == TPM_ST_SESSIONS) {
2492 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2493 }
2494 }
2495 if (rc == TPM_RC_SUCCESS) {
2496 rc = TSS_TPM2B_ECC_POINT_Unmarshalu(&target->Q, buffer, size);
2497 }
2498 if (rc == TPM_RC_SUCCESS) {
2499 rc = TSS_UINT16_Unmarshalu(&target->counter, buffer, size);
2500 }
2501 return rc;
2502 }
2503 TPM_RC
TSS_VerifySignature_Out_Unmarshalu(VerifySignature_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2504 TSS_VerifySignature_Out_Unmarshalu(VerifySignature_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2505 {
2506 TPM_RC rc = TPM_RC_SUCCESS;
2507 uint32_t parameterSize = 0;
2508 if (rc == TPM_RC_SUCCESS) {
2509 if (tag == TPM_ST_SESSIONS) {
2510 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2511 }
2512 }
2513 if (rc == TPM_RC_SUCCESS) {
2514 rc = TSS_TPMT_TK_VERIFIED_Unmarshalu(&target->validation, buffer, size);
2515 }
2516 return rc;
2517 }
2518 TPM_RC
TSS_Sign_Out_Unmarshalu(Sign_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2519 TSS_Sign_Out_Unmarshalu(Sign_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2520 {
2521 TPM_RC rc = TPM_RC_SUCCESS;
2522 uint32_t parameterSize = 0;
2523 if (rc == TPM_RC_SUCCESS) {
2524 if (tag == TPM_ST_SESSIONS) {
2525 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2526 }
2527 }
2528 if (rc == TPM_RC_SUCCESS) {
2529 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, NO);
2530 }
2531 return rc;
2532 }
2533 TPM_RC
TSS_PCR_Event_Out_Unmarshalu(PCR_Event_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2534 TSS_PCR_Event_Out_Unmarshalu(PCR_Event_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2535 {
2536 TPM_RC rc = TPM_RC_SUCCESS;
2537 uint32_t parameterSize = 0;
2538 if (rc == TPM_RC_SUCCESS) {
2539 if (tag == TPM_ST_SESSIONS) {
2540 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2541 }
2542 }
2543 if (rc == TPM_RC_SUCCESS) {
2544 rc = TSS_TPML_DIGEST_VALUES_Unmarshalu(&target->digests, buffer, size);
2545 }
2546 return rc;
2547 }
2548 TPM_RC
TSS_PCR_Read_Out_Unmarshalu(PCR_Read_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2549 TSS_PCR_Read_Out_Unmarshalu(PCR_Read_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2550 {
2551 TPM_RC rc = TPM_RC_SUCCESS;
2552 uint32_t parameterSize = 0;
2553 if (rc == TPM_RC_SUCCESS) {
2554 if (tag == TPM_ST_SESSIONS) {
2555 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2556 }
2557 }
2558 if (rc == TPM_RC_SUCCESS) {
2559 rc = TSS_UINT32_Unmarshalu(&target->pcrUpdateCounter, buffer, size);
2560 }
2561 if (rc == TPM_RC_SUCCESS) {
2562 rc = TSS_TPML_PCR_SELECTION_Unmarshalu(&target->pcrSelectionOut, buffer, size);
2563 }
2564 if (rc == TPM_RC_SUCCESS) {
2565 rc = TSS_TPML_DIGEST_Unmarshalu(&target->pcrValues, buffer, size, 0);
2566 }
2567 return rc;
2568 }
2569 TPM_RC
TSS_PCR_Allocate_Out_Unmarshalu(PCR_Allocate_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2570 TSS_PCR_Allocate_Out_Unmarshalu(PCR_Allocate_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2571 {
2572 TPM_RC rc = TPM_RC_SUCCESS;
2573 uint32_t parameterSize = 0;
2574 if (rc == TPM_RC_SUCCESS) {
2575 if (tag == TPM_ST_SESSIONS) {
2576 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2577 }
2578 }
2579 if (rc == TPM_RC_SUCCESS) {
2580 rc = TSS_TPMI_YES_NO_Unmarshalu(&target->allocationSuccess, buffer, size);
2581 }
2582 if (rc == TPM_RC_SUCCESS) {
2583 rc = TSS_UINT32_Unmarshalu(&target->maxPCR, buffer, size);
2584 }
2585 if (rc == TPM_RC_SUCCESS) {
2586 rc = TSS_UINT32_Unmarshalu(&target->sizeNeeded, buffer, size);
2587 }
2588 if (rc == TPM_RC_SUCCESS) {
2589 rc = TSS_UINT32_Unmarshalu(&target->sizeAvailable, buffer, size);
2590 }
2591 return rc;
2592 }
2593 TPM_RC
TSS_PolicySigned_Out_Unmarshalu(PolicySigned_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2594 TSS_PolicySigned_Out_Unmarshalu(PolicySigned_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2595 {
2596 TPM_RC rc = TPM_RC_SUCCESS;
2597 uint32_t parameterSize = 0;
2598 if (rc == TPM_RC_SUCCESS) {
2599 if (tag == TPM_ST_SESSIONS) {
2600 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2601 }
2602 }
2603 if (rc == TPM_RC_SUCCESS) {
2604 rc = TSS_TPM2B_TIMEOUT_Unmarshalu(&target->timeout, buffer, size);
2605 }
2606 if (rc == TPM_RC_SUCCESS) {
2607 rc = TSS_TPMT_TK_AUTH_Unmarshalu(&target->policyTicket, buffer, size);
2608 }
2609 return rc;
2610 }
2611 TPM_RC
TSS_PolicySecret_Out_Unmarshalu(PolicySecret_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2612 TSS_PolicySecret_Out_Unmarshalu(PolicySecret_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2613 {
2614 TPM_RC rc = TPM_RC_SUCCESS;
2615 uint32_t parameterSize = 0;
2616 if (rc == TPM_RC_SUCCESS) {
2617 if (tag == TPM_ST_SESSIONS) {
2618 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2619 }
2620 }
2621 if (rc == TPM_RC_SUCCESS) {
2622 rc = TSS_TPM2B_TIMEOUT_Unmarshalu(&target->timeout, buffer, size);
2623 }
2624 if (rc == TPM_RC_SUCCESS) {
2625 rc = TSS_TPMT_TK_AUTH_Unmarshalu(&target->policyTicket, buffer, size);
2626 }
2627 return rc;
2628 }
2629 TPM_RC
TSS_PolicyGetDigest_Out_Unmarshalu(PolicyGetDigest_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2630 TSS_PolicyGetDigest_Out_Unmarshalu(PolicyGetDigest_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2631 {
2632 TPM_RC rc = TPM_RC_SUCCESS;
2633 uint32_t parameterSize = 0;
2634 if (rc == TPM_RC_SUCCESS) {
2635 if (tag == TPM_ST_SESSIONS) {
2636 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2637 }
2638 }
2639 if (rc == TPM_RC_SUCCESS) {
2640 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->policyDigest, buffer, size);
2641 }
2642 return rc;
2643 }
2644 TPM_RC
TSS_CreatePrimary_Out_Unmarshalu(CreatePrimary_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2645 TSS_CreatePrimary_Out_Unmarshalu(CreatePrimary_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2646 {
2647 TPM_RC rc = TPM_RC_SUCCESS;
2648 uint32_t parameterSize = 0;
2649
2650 if (rc == TPM_RC_SUCCESS) {
2651 rc = TSS_TPM_HANDLE_Unmarshalu(&target->objectHandle, buffer, size);
2652 }
2653 if (rc == TPM_RC_SUCCESS) {
2654 if (tag == TPM_ST_SESSIONS) {
2655 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2656 }
2657 }
2658 if (rc == TPM_RC_SUCCESS) {
2659 rc = TSS_TPM2B_PUBLIC_Unmarshalu(&target->outPublic, buffer, size, NO);
2660 }
2661 if (rc == TPM_RC_SUCCESS) {
2662 rc = TSS_TPM2B_CREATION_DATA_Unmarshalu(&target->creationData, buffer, size);
2663 }
2664 if (rc == TPM_RC_SUCCESS) {
2665 rc = TSS_TPM2B_DIGEST_Unmarshalu(&target->creationHash, buffer, size);
2666 }
2667 if (rc == TPM_RC_SUCCESS) {
2668 rc = TSS_TPMT_TK_CREATION_Unmarshalu(&target->creationTicket, buffer, size);
2669 }
2670 if (rc == TPM_RC_SUCCESS) {
2671 rc = TSS_TPM2B_NAME_Unmarshalu(&target->name, buffer, size);
2672 }
2673 return rc;
2674 }
2675 TPM_RC
TSS_ContextSave_Out_Unmarshalu(ContextSave_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2676 TSS_ContextSave_Out_Unmarshalu(ContextSave_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2677 {
2678 TPM_RC rc = TPM_RC_SUCCESS;
2679 uint32_t parameterSize = 0;
2680 if (rc == TPM_RC_SUCCESS) {
2681 if (tag == TPM_ST_SESSIONS) {
2682 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2683 }
2684 }
2685 if (rc == TPM_RC_SUCCESS) {
2686 rc = TSS_TPMS_CONTEXT_Unmarshalu(&target->context, buffer, size);
2687 }
2688 return rc;
2689 }
2690 TPM_RC
TSS_ContextLoad_Out_Unmarshalu(ContextLoad_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2691 TSS_ContextLoad_Out_Unmarshalu(ContextLoad_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2692 {
2693 TPM_RC rc = TPM_RC_SUCCESS;
2694 uint32_t parameterSize = 0;
2695 if (rc == TPM_RC_SUCCESS) {
2696 rc = TSS_TPMI_DH_CONTEXT_Unmarshalu(&target->loadedHandle, buffer, size, NO);
2697 }
2698 if (rc == TPM_RC_SUCCESS) {
2699 if (tag == TPM_ST_SESSIONS) {
2700 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2701 }
2702 }
2703 return rc;
2704 }
2705 TPM_RC
TSS_ReadClock_Out_Unmarshalu(ReadClock_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2706 TSS_ReadClock_Out_Unmarshalu(ReadClock_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2707 {
2708 TPM_RC rc = TPM_RC_SUCCESS;
2709 uint32_t parameterSize = 0;
2710 if (rc == TPM_RC_SUCCESS) {
2711 if (tag == TPM_ST_SESSIONS) {
2712 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2713 }
2714 }
2715 if (rc == TPM_RC_SUCCESS) {
2716 rc = TSS_TPMS_TIME_INFO_Unmarshalu(&target->currentTime, buffer, size);
2717 }
2718 return rc;
2719 }
2720 TPM_RC
TSS_GetCapability_Out_Unmarshalu(GetCapability_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2721 TSS_GetCapability_Out_Unmarshalu(GetCapability_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2722 {
2723 TPM_RC rc = TPM_RC_SUCCESS;
2724 uint32_t parameterSize = 0;
2725
2726 if (rc == TPM_RC_SUCCESS) {
2727 if (tag == TPM_ST_SESSIONS) {
2728 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2729 }
2730 }
2731 if (rc == TPM_RC_SUCCESS) {
2732 rc = TSS_TPMI_YES_NO_Unmarshalu(&target->moreData, buffer, size);
2733 }
2734 if (rc == TPM_RC_SUCCESS) {
2735 rc = TSS_TPMS_CAPABILITY_DATA_Unmarshalu(&target->capabilityData, buffer, size);
2736 }
2737 return rc;
2738 }
2739 TPM_RC
TSS_NV_ReadPublic_Out_Unmarshalu(NV_ReadPublic_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2740 TSS_NV_ReadPublic_Out_Unmarshalu(NV_ReadPublic_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2741 {
2742 TPM_RC rc = TPM_RC_SUCCESS;
2743 uint32_t parameterSize = 0;
2744 if (rc == TPM_RC_SUCCESS) {
2745 if (tag == TPM_ST_SESSIONS) {
2746 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2747 }
2748 }
2749 if (rc == TPM_RC_SUCCESS) {
2750 rc = TSS_TPM2B_NV_PUBLIC_Unmarshalu(&target->nvPublic, buffer, size);
2751 }
2752 if (rc == TPM_RC_SUCCESS) {
2753 rc = TSS_TPM2B_NAME_Unmarshalu(&target->nvName, buffer, size);
2754 }
2755 return rc;
2756 }
2757 TPM_RC
TSS_NV_Read_Out_Unmarshalu(NV_Read_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2758 TSS_NV_Read_Out_Unmarshalu(NV_Read_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2759 {
2760 TPM_RC rc = TPM_RC_SUCCESS;
2761 uint32_t parameterSize = 0;
2762 if (rc == TPM_RC_SUCCESS) {
2763 if (tag == TPM_ST_SESSIONS) {
2764 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2765 }
2766 }
2767 if (rc == TPM_RC_SUCCESS) {
2768 rc = TSS_TPM2B_MAX_NV_BUFFER_Unmarshalu(&target->data, buffer, size);
2769 }
2770 return rc;
2771 }
2772 TPM_RC
TSS_NV_Certify_Out_Unmarshalu(NV_Certify_Out * target,TPM_ST tag,BYTE ** buffer,uint32_t * size)2773 TSS_NV_Certify_Out_Unmarshalu(NV_Certify_Out *target, TPM_ST tag, BYTE **buffer, uint32_t *size)
2774 {
2775 TPM_RC rc = TPM_RC_SUCCESS;
2776 uint32_t parameterSize = 0;
2777 if (rc == TPM_RC_SUCCESS) {
2778 if (tag == TPM_ST_SESSIONS) {
2779 rc = TSS_UINT32_Unmarshalu(¶meterSize, buffer, size);
2780 }
2781 }
2782 if (rc == TPM_RC_SUCCESS) {
2783 rc = TSS_TPM2B_ATTEST_Unmarshalu(&target->certifyInfo, buffer, size);
2784 }
2785 if (rc == TPM_RC_SUCCESS) {
2786 rc = TSS_TPMT_SIGNATURE_Unmarshalu(&target->signature, buffer, size, YES);
2787 }
2788 return rc;
2789 }
2790
2791 /*
2792 TPM 2.0 Structure marshaling
2793 */
2794
2795 TPM_RC
TSS_TPM2B_Marshalu(const TPM2B * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2796 TSS_TPM2B_Marshalu(const TPM2B *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2797 {
2798 TPM_RC rc = 0;
2799 if (rc == 0) {
2800 rc = TSS_UINT16_Marshalu(&(source->size), written, buffer, size);
2801 }
2802 if (rc == 0) {
2803 rc = TSS_Array_Marshalu(source->buffer, source->size, written, buffer, size);
2804 }
2805 return rc;
2806 }
2807
2808 /* Table 5 - Definition of Types for Documentation Clarity */
2809
2810 TPM_RC
TSS_TPM_KEY_BITS_Marshalu(const TPM_KEY_BITS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2811 TSS_TPM_KEY_BITS_Marshalu(const TPM_KEY_BITS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2812 {
2813 TPM_RC rc = 0;
2814 if (rc == 0) {
2815 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2816 }
2817 return rc;
2818 }
2819
2820 /* Table 7 - Definition of (UINT32) TPM_GENERATED Constants <O> */
2821
2822 TPM_RC
TSS_TPM_GENERATED_Marshalu(const TPM_GENERATED * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2823 TSS_TPM_GENERATED_Marshalu(const TPM_GENERATED *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2824 {
2825 TPM_RC rc = 0;
2826 if (rc == 0) {
2827 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2828 }
2829 return rc;
2830 }
2831
2832 /* Table 9 - Definition of (UINT16) TPM_ALG_ID Constants <IN/OUT, S> */
2833
2834 TPM_RC
TSS_TPM_ALG_ID_Marshalu(const TPM_ALG_ID * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2835 TSS_TPM_ALG_ID_Marshalu(const TPM_ALG_ID *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2836 {
2837 TPM_RC rc = 0;
2838 if (rc == 0) {
2839 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2840 }
2841 return rc;
2842 }
2843
2844 /* Table 10 - Definition of (uint16_t) {ECC} TPM_ECC_CURVE Constants <IN/OUT, S> */
2845
2846 #ifdef TPM_ALG_ECC
2847 TPM_RC
TSS_TPM_ECC_CURVE_Marshalu(const TPM_ECC_CURVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2848 TSS_TPM_ECC_CURVE_Marshalu(const TPM_ECC_CURVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2849 {
2850 TPM_RC rc = 0;
2851 if (rc == 0) {
2852 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2853 }
2854 return rc;
2855 }
2856 #endif
2857
2858 /* Table 17 - Definition of (UINT32) TPM_RC Constants (Actions) <OUT> */
2859
2860 TPM_RC
TSS_TPM_RC_Marshalu(const TPM_RC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2861 TSS_TPM_RC_Marshalu(const TPM_RC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2862 {
2863 TPM_RC rc = 0;
2864 if (rc == 0) {
2865 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2866 }
2867 return rc;
2868 }
2869
2870 /* Table 18 - Definition of (INT8) TPM_CLOCK_ADJUST Constants <IN> */
2871
2872 TPM_RC
TSS_TPM_CLOCK_ADJUST_Marshalu(const TPM_CLOCK_ADJUST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2873 TSS_TPM_CLOCK_ADJUST_Marshalu(const TPM_CLOCK_ADJUST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2874 {
2875 TPM_RC rc = 0;
2876 if (rc == 0) {
2877 rc = TSS_INT8_Marshalu(source, written, buffer, size);
2878 }
2879 return rc;
2880 }
2881
2882 /* Table 19 - Definition of (UINT16) TPM_EO Constants <IN/OUT> */
2883
2884 TPM_RC
TSS_TPM_EO_Marshalu(const TPM_EO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2885 TSS_TPM_EO_Marshalu(const TPM_EO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2886 {
2887 TPM_RC rc = 0;
2888 if (rc == 0) {
2889 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2890 }
2891 return rc;
2892 }
2893
2894 /* Table 20 - Definition of (UINT16) TPM_ST Constants <IN/OUT, S> */
2895
2896 TPM_RC
TSS_TPM_ST_Marshalu(const TPM_ST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2897 TSS_TPM_ST_Marshalu(const TPM_ST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2898 {
2899 TPM_RC rc = 0;
2900 if (rc == 0) {
2901 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2902 }
2903 return rc;
2904 }
2905
2906 /* Table 21 - Definition of (UINT16) TPM_SU Constants <IN> */
2907
2908 TPM_RC
TSS_TPM_SU_Marshalu(const TPM_ST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2909 TSS_TPM_SU_Marshalu(const TPM_ST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2910 {
2911 TPM_RC rc = 0;
2912 if (rc == 0) {
2913 rc = TSS_UINT16_Marshalu(source, written, buffer, size);
2914 }
2915 return rc;
2916 }
2917
2918 /* Table 22 - Definition of (UINT8) TPM_SE Constants <IN> */
2919
2920 TPM_RC
TSS_TPM_SE_Marshalu(const TPM_SE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2921 TSS_TPM_SE_Marshalu(const TPM_SE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2922 {
2923 TPM_RC rc = 0;
2924 if (rc == 0) {
2925 rc = TSS_UINT8_Marshalu(source, written, buffer, size);
2926 }
2927 return rc;
2928 }
2929
2930 /* Table 23 - Definition of (UINT32) TPM_CAP Constants */
2931
2932 TPM_RC
TSS_TPM_CAP_Marshalu(const TPM_CAP * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2933 TSS_TPM_CAP_Marshalu(const TPM_CAP *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2934 {
2935 TPM_RC rc = 0;
2936 if (rc == 0) {
2937 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2938 }
2939 return rc;
2940 }
2941
2942 /* Table 24 - Definition of (UINT32) TPM_PT Constants <IN/OUT, S> */
2943
2944 TPM_RC
TSS_TPM_PT_Marshalu(const TPM_PT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2945 TSS_TPM_PT_Marshalu(const TPM_PT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2946 {
2947 TPM_RC rc = 0;
2948 if (rc == 0) {
2949 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2950 }
2951 return rc;
2952 }
2953
2954 /* Table 25 - Definition of (UINT32) TPM_PT_PCR Constants <IN/OUT, S> */
2955
2956 TPM_RC
TSS_TPM_PT_PCR_Marshalu(const TPM_PT_PCR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2957 TSS_TPM_PT_PCR_Marshalu(const TPM_PT_PCR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2958 {
2959 TPM_RC rc = 0;
2960 if (rc == 0) {
2961 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2962 }
2963 return rc;
2964 }
2965
2966 /* Table 27 - Definition of Types for Handles */
2967
2968 TPM_RC
TSS_TPM_HANDLE_Marshalu(const TPM_HANDLE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2969 TSS_TPM_HANDLE_Marshalu(const TPM_HANDLE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2970 {
2971 TPM_RC rc = 0;
2972 if (rc == 0) {
2973 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
2974 }
2975 return rc;
2976 }
2977
2978 /* Table 31 - Definition of (UINT32) TPMA_ALGORITHM Bits */
2979
2980 TPM_RC
TSS_TPMA_ALGORITHM_Marshalu(const TPMA_ALGORITHM * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2981 TSS_TPMA_ALGORITHM_Marshalu(const TPMA_ALGORITHM *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2982 {
2983 TPM_RC rc = 0;
2984 if (rc == 0) {
2985 rc = TSS_UINT32_Marshalu(&source->val, written, buffer, size);
2986 }
2987 return rc;
2988 }
2989
2990 /* Table 32 - Definition of (UINT32) TPMA_OBJECT Bits */
2991
2992 TPM_RC
TSS_TPMA_OBJECT_Marshalu(const TPMA_OBJECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)2993 TSS_TPMA_OBJECT_Marshalu(const TPMA_OBJECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
2994 {
2995 TPM_RC rc = 0;
2996 if (rc == 0) {
2997 rc = TSS_UINT32_Marshalu(&source->val, written, buffer, size);
2998 }
2999 return rc;
3000 }
3001
3002 /* Table 33 - Definition of (UINT8) TPMA_SESSION Bits <IN/OUT> */
3003
3004 TPM_RC
TSS_TPMA_SESSION_Marshalu(const TPMA_SESSION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3005 TSS_TPMA_SESSION_Marshalu(const TPMA_SESSION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3006 {
3007 TPM_RC rc = 0;
3008 if (rc == 0) {
3009 rc = TSS_UINT8_Marshalu(&source->val, written, buffer, size);
3010 }
3011 return rc;
3012 }
3013
3014 /* Table 34 - Definition of (UINT8) TPMA_LOCALITY Bits <IN/OUT> */
3015
3016 TPM_RC
TSS_TPMA_LOCALITY_Marshalu(const TPMA_LOCALITY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3017 TSS_TPMA_LOCALITY_Marshalu(const TPMA_LOCALITY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3018 {
3019 TPM_RC rc = 0;
3020 if (rc == 0) {
3021 rc = TSS_UINT8_Marshalu(&source->val, written, buffer, size);
3022 }
3023 return rc;
3024 }
3025
3026 /* Table 38 - Definition of (TPM_CC) TPMA_CC Bits <OUT> */
3027
3028 TPM_RC
TSS_TPM_CC_Marshalu(const TPM_CC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3029 TSS_TPM_CC_Marshalu(const TPM_CC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3030 {
3031 TPM_RC rc = 0;
3032 if (rc == 0) {
3033 rc = TSS_UINT32_Marshalu(source, written, buffer, size);
3034 }
3035 return rc;
3036 }
3037
3038 /* Table 38 - Definition of (TPM_CC) TPMA_CC Bits <OUT> */
3039
3040 TPM_RC
TSS_TPMA_CC_Marshalu(const TPMA_CC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3041 TSS_TPMA_CC_Marshalu(const TPMA_CC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3042 {
3043 TPM_RC rc = 0;
3044 if (rc == 0) {
3045 rc = TSS_UINT32_Marshalu(&source->val, written, buffer, size);
3046 }
3047 return rc;
3048 }
3049
3050 /* Table 39 - Definition of (BYTE) TPMI_YES_NO Type */
3051
3052 TPM_RC
TSS_TPMI_YES_NO_Marshalu(const TPMI_YES_NO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3053 TSS_TPMI_YES_NO_Marshalu(const TPMI_YES_NO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3054 {
3055 TPM_RC rc = 0;
3056 if (rc == 0) {
3057 rc = TSS_UINT8_Marshalu(source, written, buffer, size);
3058 }
3059 return rc;
3060 }
3061
3062 /* Table 40 - Definition of (TPM_HANDLE) TPMI_DH_OBJECT Type */
3063
3064 TPM_RC
TSS_TPMI_DH_OBJECT_Marshalu(const TPMI_DH_OBJECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3065 TSS_TPMI_DH_OBJECT_Marshalu(const TPMI_DH_OBJECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3066 {
3067 TPM_RC rc = 0;
3068 if (rc == 0) {
3069 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3070 }
3071 return rc;
3072 }
3073
3074 /* Table 41 - Definition of (TPM_HANDLE) TPMI_DH_PERSISTENT Type */
3075
3076 TPM_RC
TSS_TPMI_DH_PERSISTENT_Marshalu(const TPMI_DH_PERSISTENT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3077 TSS_TPMI_DH_PERSISTENT_Marshalu(const TPMI_DH_PERSISTENT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3078 {
3079 TPM_RC rc = 0;
3080 if (rc == 0) {
3081 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3082 }
3083 return rc;
3084 }
3085
3086 /* Table 42 - Definition of (TPM_HANDLE) TPMI_DH_ENTITY Type <IN> */
3087
3088 TPM_RC
TSS_TPMI_DH_ENTITY_Marshalu(const TPMI_DH_ENTITY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3089 TSS_TPMI_DH_ENTITY_Marshalu(const TPMI_DH_ENTITY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3090 {
3091 TPM_RC rc = 0;
3092 if (rc == 0) {
3093 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3094 }
3095 return rc;
3096 }
3097
3098 /* Table 43 - Definition of (TPM_HANDLE) TPMI_DH_PCR Type <IN> */
3099
3100 TPM_RC
TSS_TPMI_DH_PCR_Marshalu(const TPMI_DH_PCR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3101 TSS_TPMI_DH_PCR_Marshalu(const TPMI_DH_PCR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3102 {
3103 TPM_RC rc = 0;
3104 if (rc == 0) {
3105 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3106 }
3107 return rc;
3108 }
3109
3110 /* Table 44 - Definition of (TPM_HANDLE) TPMI_SH_AUTH_SESSION Type <IN/OUT> */
3111
3112 TPM_RC
TSS_TPMI_SH_AUTH_SESSION_Marshalu(const TPMI_SH_AUTH_SESSION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3113 TSS_TPMI_SH_AUTH_SESSION_Marshalu(const TPMI_SH_AUTH_SESSION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3114 {
3115 TPM_RC rc = 0;
3116 if (rc == 0) {
3117 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3118 }
3119 return rc;
3120 }
3121
3122 /* Table 45 - Definition of (TPM_HANDLE) TPMI_SH_HMAC Type <IN/OUT> */
3123
3124 TPM_RC
TSS_TPMI_SH_HMAC_Marshalu(const TPMI_SH_HMAC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3125 TSS_TPMI_SH_HMAC_Marshalu(const TPMI_SH_HMAC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3126 {
3127 TPM_RC rc = 0;
3128 if (rc == 0) {
3129 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3130 }
3131 return rc;
3132 }
3133
3134 /* Table 46 - Definition of (TPM_HANDLE) TPMI_SH_POLICY Type <IN/OUT> */
3135
3136 TPM_RC
TSS_TPMI_SH_POLICY_Marshalu(const TPMI_SH_POLICY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3137 TSS_TPMI_SH_POLICY_Marshalu(const TPMI_SH_POLICY*source, uint16_t *written, BYTE **buffer, uint32_t *size)
3138 {
3139 TPM_RC rc = 0;
3140 if (rc == 0) {
3141 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3142 }
3143 return rc;
3144 }
3145
3146 /* Table 47 - Definition of (TPM_HANDLE) TPMI_DH_CONTEXT Type */
3147
3148 TPM_RC
TSS_TPMI_DH_CONTEXT_Marshalu(const TPMI_DH_CONTEXT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3149 TSS_TPMI_DH_CONTEXT_Marshalu(const TPMI_DH_CONTEXT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3150 {
3151 TPM_RC rc = 0;
3152 if (rc == 0) {
3153 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3154 }
3155 return rc;
3156 }
3157
3158 /* Table 49 - Definition of (TPM_HANDLE) TPMI_DH_SAVED Type */
3159
3160 TPM_RC
TSS_TPMI_DH_SAVED_Marshalu(const TPMI_DH_SAVED * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3161 TSS_TPMI_DH_SAVED_Marshalu(const TPMI_DH_SAVED *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3162 {
3163 TPM_RC rc = 0;
3164 if (rc == 0) {
3165 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3166 }
3167 return rc;
3168 }
3169
3170 /* Table 48 - Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY Type */
3171
3172 TPM_RC
TSS_TPMI_RH_HIERARCHY_Marshalu(const TPMI_RH_HIERARCHY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3173 TSS_TPMI_RH_HIERARCHY_Marshalu(const TPMI_RH_HIERARCHY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3174 {
3175 TPM_RC rc = 0;
3176 if (rc == 0) {
3177 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3178 }
3179 return rc;
3180 }
3181
3182 /* Table 49 - Definition of (TPM_HANDLE) TPMI_RH_ENABLES Type */
3183
3184 TPM_RC
TSS_TPMI_RH_ENABLES_Marshalu(const TPMI_RH_ENABLES * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3185 TSS_TPMI_RH_ENABLES_Marshalu(const TPMI_RH_ENABLES *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3186 {
3187 TPM_RC rc = 0;
3188 if (rc == 0) {
3189 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3190 }
3191 return rc;
3192 }
3193
3194 /* Table 50 - Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY_AUTH Type <IN> */
3195
3196 TPM_RC
TSS_TPMI_RH_HIERARCHY_AUTH_Marshalu(const TPMI_RH_HIERARCHY_AUTH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3197 TSS_TPMI_RH_HIERARCHY_AUTH_Marshalu(const TPMI_RH_HIERARCHY_AUTH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3198 {
3199 TPM_RC rc = 0;
3200 if (rc == 0) {
3201 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3202 }
3203 return rc;
3204 }
3205
3206 /* Table 50 - Definition of (TPM_HANDLE) TPMI_RH_HIERARCHY_POLICY Type <IN> */
3207
3208 TPM_RC
TSS_TPMI_RH_HIERARCHY_POLICY_Marshalu(const TPMI_RH_HIERARCHY_POLICY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3209 TSS_TPMI_RH_HIERARCHY_POLICY_Marshalu(const TPMI_RH_HIERARCHY_POLICY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3210 {
3211 TPM_RC rc = 0;
3212 if (rc == 0) {
3213 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3214 }
3215 return rc;
3216 }
3217
3218 /* Table 51 - Definition of (TPM_HANDLE) TPMI_RH_PLATFORM Type <IN> */
3219
3220 TPM_RC
TSS_TPMI_RH_PLATFORM_Marshalu(const TPMI_RH_PLATFORM * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3221 TSS_TPMI_RH_PLATFORM_Marshalu(const TPMI_RH_PLATFORM *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3222 {
3223 TPM_RC rc = 0;
3224 if (rc == 0) {
3225 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3226 }
3227 return rc;
3228 }
3229
3230 /* Table 53 - Definition of (TPM_HANDLE) TPMI_RH_ENDORSEMENT Type <IN> */
3231
3232 TPM_RC
TSS_TPMI_RH_ENDORSEMENT_Marshalu(const TPMI_RH_ENDORSEMENT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3233 TSS_TPMI_RH_ENDORSEMENT_Marshalu(const TPMI_RH_ENDORSEMENT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3234 {
3235 TPM_RC rc = 0;
3236 if (rc == 0) {
3237 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3238 }
3239 return rc;
3240 }
3241
3242 /* Table 54 - Definition of (TPM_HANDLE) TPMI_RH_PROVISION Type <IN> */
3243
3244 TPM_RC
TSS_TPMI_RH_PROVISION_Marshalu(const TPMI_RH_PROVISION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3245 TSS_TPMI_RH_PROVISION_Marshalu(const TPMI_RH_PROVISION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3246 {
3247 TPM_RC rc = 0;
3248 if (rc == 0) {
3249 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3250 }
3251 return rc;
3252 }
3253
3254 /* Table 55 - Definition of (TPM_HANDLE) TPMI_RH_CLEAR Type <IN> */
3255
3256 TPM_RC
TSS_TPMI_RH_CLEAR_Marshalu(const TPMI_RH_CLEAR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3257 TSS_TPMI_RH_CLEAR_Marshalu(const TPMI_RH_CLEAR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3258 {
3259 TPM_RC rc = 0;
3260 if (rc == 0) {
3261 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3262 }
3263 return rc;
3264 }
3265
3266 /* Table 56 - Definition of (TPM_HANDLE) TPMI_RH_NV_AUTH Type <IN> */
3267
3268 TPM_RC
TSS_TPMI_RH_NV_AUTH_Marshalu(const TPMI_RH_NV_AUTH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3269 TSS_TPMI_RH_NV_AUTH_Marshalu(const TPMI_RH_NV_AUTH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3270 {
3271 TPM_RC rc = 0;
3272 if (rc == 0) {
3273 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3274 }
3275 return rc;
3276 }
3277
3278 /* Table 57 - Definition of (TPM_HANDLE) TPMI_RH_LOCKOUT Type <IN> */
3279
3280 TPM_RC
TSS_TPMI_RH_LOCKOUT_Marshalu(const TPMI_RH_LOCKOUT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3281 TSS_TPMI_RH_LOCKOUT_Marshalu(const TPMI_RH_LOCKOUT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3282 {
3283 TPM_RC rc = 0;
3284 if (rc == 0) {
3285 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3286 }
3287 return rc;
3288 }
3289
3290 /* Table 58 - Definition of (TPM_HANDLE) TPMI_RH_NV_INDEX Type <IN/OUT> */
3291
3292 TPM_RC
TSS_TPMI_RH_NV_INDEX_Marshalu(const TPMI_RH_NV_INDEX * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3293 TSS_TPMI_RH_NV_INDEX_Marshalu(const TPMI_RH_NV_INDEX *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3294 {
3295 TPM_RC rc = 0;
3296 if (rc == 0) {
3297 rc = TSS_TPM_HANDLE_Marshalu(source, written, buffer, size);
3298 }
3299 return rc;
3300 }
3301
3302 /* Table 59 - Definition of (TPM_ALG_ID) TPMI_ALG_HASH Type */
3303
3304 TPM_RC
TSS_TPMI_ALG_HASH_Marshalu(const TPMI_ALG_HASH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3305 TSS_TPMI_ALG_HASH_Marshalu(const TPMI_ALG_HASH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3306 {
3307 TPM_RC rc = 0;
3308 if (rc == 0) {
3309 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3310 }
3311 return rc;
3312 }
3313
3314 /* Table 61 - Definition of (TPM_ALG_ID) TPMI_ALG_SYM Type */
3315
3316 TPM_RC
TSS_TPMI_ALG_SYM_Marshalu(const TPMI_ALG_SYM * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3317 TSS_TPMI_ALG_SYM_Marshalu(const TPMI_ALG_SYM *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3318 {
3319 TPM_RC rc = 0;
3320 if (rc == 0) {
3321 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3322 }
3323 return rc;
3324 }
3325
3326 /* Table 62 - Definition of (TPM_ALG_ID) TPMI_ALG_SYM_OBJECT Type */
3327
3328 TPM_RC
TSS_TPMI_ALG_SYM_OBJECT_Marshalu(const TPMI_ALG_SYM_OBJECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3329 TSS_TPMI_ALG_SYM_OBJECT_Marshalu(const TPMI_ALG_SYM_OBJECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3330 {
3331 TPM_RC rc = 0;
3332 if (rc == 0) {
3333 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3334 }
3335 return rc;
3336 }
3337
3338 /* Table 63 - Definition of (TPM_ALG_ID) TPMI_ALG_SYM_MODE Type */
3339
3340 TPM_RC
TSS_TPMI_ALG_SYM_MODE_Marshalu(const TPMI_ALG_SYM_MODE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3341 TSS_TPMI_ALG_SYM_MODE_Marshalu(const TPMI_ALG_SYM_MODE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3342 {
3343 TPM_RC rc = 0;
3344 if (rc == 0) {
3345 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3346 }
3347 return rc;
3348 }
3349
3350 /* Table 64 - Definition of (TPM_ALG_ID) TPMI_ALG_KDF Type */
3351
3352 TPM_RC
TSS_TPMI_ALG_KDF_Marshalu(const TPMI_ALG_KDF * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3353 TSS_TPMI_ALG_KDF_Marshalu(const TPMI_ALG_KDF *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3354 {
3355 TPM_RC rc = 0;
3356 if (rc == 0) {
3357 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3358 }
3359 return rc;
3360 }
3361
3362 /* Table 65 - Definition of (TPM_ALG_ID) TPMI_ALG_SIG_SCHEME Type */
3363
3364 TPM_RC
TSS_TPMI_ALG_SIG_SCHEME_Marshalu(const TPMI_ALG_SIG_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3365 TSS_TPMI_ALG_SIG_SCHEME_Marshalu(const TPMI_ALG_SIG_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3366 {
3367 TPM_RC rc = 0;
3368 if (rc == 0) {
3369 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3370 }
3371 return rc;
3372 }
3373
3374 /* Table 66 - Definition of (TPM_ALG_ID) TPMI_ECC_KEY_EXCHANGE Type */
3375
3376 TPM_RC
TSS_TPMI_ECC_KEY_EXCHANGE_Marshalu(const TPMI_ECC_KEY_EXCHANGE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3377 TSS_TPMI_ECC_KEY_EXCHANGE_Marshalu(const TPMI_ECC_KEY_EXCHANGE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3378 {
3379 TPM_RC rc = 0;
3380 if (rc == 0) {
3381 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3382 }
3383 return rc;
3384 }
3385
3386 /* Table 67 - Definition of (TPM_ST) TPMI_ST_COMMAND_TAG Type */
3387
3388 TPM_RC
TSS_TPMI_ST_COMMAND_TAG_Marshalu(const TPMI_ST_COMMAND_TAG * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3389 TSS_TPMI_ST_COMMAND_TAG_Marshalu(const TPMI_ST_COMMAND_TAG *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3390 {
3391 TPM_RC rc = 0;
3392 if (rc == 0) {
3393 rc = TSS_TPM_ST_Marshalu(source, written, buffer, size);
3394 }
3395 return rc;
3396 }
3397
3398 /* Table 71 - Definition of (TPM_ALG_ID) TPMI_ALG_MAC_SCHEME Type */
3399
3400 TPM_RC
TSS_TPMI_ALG_MAC_SCHEME_Marshalu(const TPMI_ALG_MAC_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3401 TSS_TPMI_ALG_MAC_SCHEME_Marshalu(const TPMI_ALG_MAC_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3402 {
3403 TPM_RC rc = 0;
3404 if (rc == 0) {
3405 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3406 }
3407 return rc;
3408 }
3409
3410 /* Table 72 - Definition of (TPM_ALG_ID) TPMI_ALG_CIPHER_MODE Type */
3411
3412 TPM_RC
TSS_TPMI_ALG_CIPHER_MODE_Marshalu(const TPMI_ALG_CIPHER_MODE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3413 TSS_TPMI_ALG_CIPHER_MODE_Marshalu(const TPMI_ALG_CIPHER_MODE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3414 {
3415 TPM_RC rc = 0;
3416 if (rc == 0) {
3417 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
3418 }
3419 return rc;
3420 }
3421
3422 /* Table 70 - Definition of TPMU_HA Union <IN/OUT, S> */
3423
3424 TPM_RC
TSS_TPMU_HA_Marshalu(const TPMU_HA * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)3425 TSS_TPMU_HA_Marshalu(const TPMU_HA *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
3426 {
3427 TPM_RC rc = 0;
3428
3429 switch (selector) {
3430 #ifdef TPM_ALG_SHA1
3431 case TPM_ALG_SHA1:
3432 if (rc == 0) {
3433 rc = TSS_Array_Marshalu(&source->sha1[0], SHA1_DIGEST_SIZE, written, buffer, size);
3434 }
3435 break;
3436 #endif
3437 #ifdef TPM_ALG_SHA256
3438 case TPM_ALG_SHA256:
3439 if (rc == 0) {
3440 rc = TSS_Array_Marshalu(&source->sha256[0], SHA256_DIGEST_SIZE, written, buffer, size);
3441 }
3442 break;
3443 #endif
3444 #ifdef TPM_ALG_SHA384
3445 case TPM_ALG_SHA384:
3446 if (rc == 0) {
3447 rc = TSS_Array_Marshalu(&source->sha384[0], SHA384_DIGEST_SIZE, written, buffer, size);
3448 }
3449 break;
3450 #endif
3451 #ifdef TPM_ALG_SHA512
3452 case TPM_ALG_SHA512:
3453 if (rc == 0) {
3454 rc = TSS_Array_Marshalu(&source->sha512[0], SHA512_DIGEST_SIZE, written, buffer, size);
3455 }
3456 break;
3457 #endif
3458 #ifdef TPM_ALG_SM3_256
3459 case TPM_ALG_SM3_256:
3460 if (rc == 0) {
3461 rc = TSS_Array_Marshalu(&source->sm3_256[0], SM3_256_DIGEST_SIZE, written, buffer, size);
3462 }
3463 break;
3464 #endif
3465 case TPM_ALG_NULL:
3466 break;
3467 default:
3468 rc = TPM_RC_SELECTOR;
3469 }
3470 return rc;
3471 }
3472
3473 /* Table 71 - Definition of TPMT_HA Structure <IN/OUT> */
3474
3475 TPM_RC
TSS_TPMT_HA_Marshalu(const TPMT_HA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3476 TSS_TPMT_HA_Marshalu(const TPMT_HA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3477 {
3478 TPM_RC rc = 0;
3479 if (rc == 0) {
3480 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
3481 }
3482 if (rc == 0) {
3483 rc = TSS_TPMU_HA_Marshalu(&source->digest, written, buffer, size, source->hashAlg);
3484 }
3485 return rc;
3486 }
3487
3488 /* Table 72 - Definition of TPM2B_DIGEST Structure */
3489
3490 TPM_RC
TSS_TPM2B_DIGEST_Marshalu(const TPM2B_DIGEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3491 TSS_TPM2B_DIGEST_Marshalu(const TPM2B_DIGEST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3492 {
3493 TPM_RC rc = 0;
3494 if (rc == 0) {
3495 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3496 }
3497 return rc;
3498 }
3499
3500 /* Table 73 - Definition of TPM2B_DATA Structure */
3501
3502 TPM_RC
TSS_TPM2B_DATA_Marshalu(const TPM2B_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3503 TSS_TPM2B_DATA_Marshalu(const TPM2B_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3504 {
3505 TPM_RC rc = 0;
3506 if (rc == 0) {
3507 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3508 }
3509 return rc;
3510 }
3511
3512 /* Table 74 - Definition of Types for TPM2B_NONCE */
3513
3514 TPM_RC
TSS_TPM2B_NONCE_Marshalu(const TPM2B_NONCE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3515 TSS_TPM2B_NONCE_Marshalu(const TPM2B_NONCE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3516 {
3517 TPM_RC rc = 0;
3518 if (rc == 0) {
3519 rc = TSS_TPM2B_DIGEST_Marshalu(source, written, buffer, size);
3520 }
3521 return rc;
3522 }
3523
3524 /* Table 75 - Definition of Types for TPM2B_AUTH */
3525
3526 TPM_RC
TSS_TPM2B_AUTH_Marshalu(const TPM2B_AUTH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3527 TSS_TPM2B_AUTH_Marshalu(const TPM2B_AUTH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3528 {
3529 TPM_RC rc = 0;
3530 if (rc == 0) {
3531 rc = TSS_TPM2B_DIGEST_Marshalu(source, written, buffer, size);
3532 }
3533 return rc;
3534 }
3535
3536 /* Table 76 - Definition of Types for TPM2B_OPERAND */
3537
3538 TPM_RC
TSS_TPM2B_OPERAND_Marshalu(const TPM2B_OPERAND * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3539 TSS_TPM2B_OPERAND_Marshalu(const TPM2B_OPERAND *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3540 {
3541 TPM_RC rc = 0;
3542 if (rc == 0) {
3543 rc = TSS_TPM2B_DIGEST_Marshalu(source, written, buffer, size);
3544 }
3545 return rc;
3546 }
3547
3548 /* Table 77 - Definition of TPM2B_EVENT Structure */
3549
3550 TPM_RC
TSS_TPM2B_EVENT_Marshalu(const TPM2B_EVENT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3551 TSS_TPM2B_EVENT_Marshalu(const TPM2B_EVENT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3552 {
3553 TPM_RC rc = 0;
3554 if (rc == 0) {
3555 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3556 }
3557 return rc;
3558 }
3559
3560 /* Table 78 - Definition of TPM2B_MAX_BUFFER Structure */
3561
3562 TPM_RC
TSS_TPM2B_MAX_BUFFER_Marshalu(const TPM2B_MAX_BUFFER * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3563 TSS_TPM2B_MAX_BUFFER_Marshalu(const TPM2B_MAX_BUFFER *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3564 {
3565 TPM_RC rc = 0;
3566 if (rc == 0) {
3567 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3568 }
3569 return rc;
3570 }
3571
3572 /* Table 79 - Definition of TPM2B_MAX_NV_BUFFER Structure */
3573
3574 TPM_RC
TSS_TPM2B_MAX_NV_BUFFER_Marshalu(const TPM2B_MAX_NV_BUFFER * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3575 TSS_TPM2B_MAX_NV_BUFFER_Marshalu(const TPM2B_MAX_NV_BUFFER *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3576 {
3577 TPM_RC rc = 0;
3578 if (rc == 0) {
3579 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3580 }
3581 return rc;
3582 }
3583
3584 /* Table 80 - Definition of TPM2B_TIMEOUT Structure <IN/OUT> */
3585
3586 TPM_RC
TSS_TPM2B_TIMEOUT_Marshalu(const TPM2B_TIMEOUT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3587 TSS_TPM2B_TIMEOUT_Marshalu(const TPM2B_TIMEOUT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3588 {
3589 TPM_RC rc = 0;
3590 if (rc == 0) {
3591 rc = TSS_TPM2B_DIGEST_Marshalu(source, written, buffer, size);
3592 }
3593 return rc;
3594 }
3595
3596 /* Table 81 - Definition of TPM2B_IV Structure <IN/OUT> */
3597
3598 TPM_RC
TSS_TPM2B_IV_Marshalu(const TPM2B_IV * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3599 TSS_TPM2B_IV_Marshalu(const TPM2B_IV *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3600 {
3601 TPM_RC rc = 0;
3602 if (rc == 0) {
3603 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3604 }
3605 return rc;
3606 }
3607
3608 /* Table 83 - Definition of TPM2B_NAME Structure */
3609
3610 TPM_RC
TSS_TPM2B_NAME_Marshalu(const TPM2B_NAME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3611 TSS_TPM2B_NAME_Marshalu(const TPM2B_NAME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3612 {
3613 TPM_RC rc = 0;
3614 if (rc == 0) {
3615 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
3616 }
3617 return rc;
3618 }
3619
3620 /* Table 85 - Definition of TPMS_PCR_SELECTION Structure */
3621
3622 TPM_RC
TSS_TPMS_PCR_SELECTION_Marshalu(const TPMS_PCR_SELECTION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3623 TSS_TPMS_PCR_SELECTION_Marshalu(const TPMS_PCR_SELECTION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3624 {
3625 TPM_RC rc = 0;
3626
3627 if (rc == 0) {
3628 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hash, written, buffer, size);
3629 }
3630 if (rc == 0) {
3631 rc = TSS_UINT8_Marshalu(&source->sizeofSelect, written, buffer, size);
3632 }
3633 if (rc == 0) {
3634 rc = TSS_Array_Marshalu(&source->pcrSelect[0], source->sizeofSelect, written, buffer, size);
3635 }
3636 return rc;
3637 }
3638
3639 /* Table 88 - Definition of TPMT_TK_CREATION Structure */
3640
3641 TPM_RC
TSS_TPMT_TK_CREATION_Marshalu(const TPMT_TK_CREATION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3642 TSS_TPMT_TK_CREATION_Marshalu(const TPMT_TK_CREATION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3643 {
3644 TPM_RC rc = 0;
3645 if (rc == 0) {
3646 rc = TSS_TPM_ST_Marshalu(&source->tag, written, buffer, size);
3647 }
3648 if (rc == 0) {
3649 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
3650 }
3651 if (rc == 0) {
3652 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
3653 }
3654 return rc;
3655 }
3656
3657 /* Table 89 - Definition of TPMT_TK_VERIFIED Structure */
3658
3659 TPM_RC
TSS_TPMT_TK_VERIFIED_Marshalu(const TPMT_TK_VERIFIED * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3660 TSS_TPMT_TK_VERIFIED_Marshalu(const TPMT_TK_VERIFIED *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3661 {
3662 TPM_RC rc = 0;
3663 if (rc == 0) {
3664 rc = TSS_TPM_ST_Marshalu(&source->tag, written, buffer, size);
3665 }
3666 if (rc == 0) {
3667 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
3668 }
3669 if (rc == 0) {
3670 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
3671 }
3672 return rc;
3673 }
3674
3675 /* Table 90 - Definition of TPMT_TK_AUTH Structure */
3676
3677 TPM_RC
TSS_TPMT_TK_AUTH_Marshalu(const TPMT_TK_AUTH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3678 TSS_TPMT_TK_AUTH_Marshalu(const TPMT_TK_AUTH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3679 {
3680 TPM_RC rc = 0;
3681 if (rc == 0) {
3682 rc = TSS_TPM_ST_Marshalu(&source->tag, written, buffer, size);
3683 }
3684 if (rc == 0) {
3685 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
3686 }
3687 if (rc == 0) {
3688 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
3689 }
3690 return rc;
3691 }
3692
3693 /* Table 91 - Definition of TPMT_TK_HASHCHECK Structure */
3694
3695 TPM_RC
TSS_TPMT_TK_HASHCHECK_Marshalu(const TPMT_TK_HASHCHECK * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3696 TSS_TPMT_TK_HASHCHECK_Marshalu(const TPMT_TK_HASHCHECK *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3697 {
3698 TPM_RC rc = 0;
3699 if (rc == 0) {
3700 rc = TSS_TPM_ST_Marshalu(&source->tag, written, buffer, size);
3701 }
3702 if (rc == 0) {
3703 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
3704 }
3705 if (rc == 0) {
3706 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digest, written, buffer, size);
3707 }
3708 return rc;
3709 }
3710
3711 /* Table 92 - Definition of TPMS_ALG_PROPERTY Structure <OUT> */
3712
3713 TPM_RC
TSS_TPMS_ALG_PROPERTY_Marshalu(const TPMS_ALG_PROPERTY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3714 TSS_TPMS_ALG_PROPERTY_Marshalu(const TPMS_ALG_PROPERTY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3715 {
3716 TPM_RC rc = 0;
3717 if (rc == 0) {
3718 rc = TSS_TPM_ALG_ID_Marshalu(&source->alg, written, buffer, size);
3719 }
3720 if (rc == 0) {
3721 rc = TSS_TPMA_ALGORITHM_Marshalu(&source->algProperties, written, buffer, size);
3722 }
3723 return rc;
3724 }
3725
3726 /* Table 93 - Definition of TPMS_TAGGED_PROPERTY Structure <OUT> */
3727
3728 TPM_RC
TSS_TPMS_TAGGED_PROPERTY_Marshalu(const TPMS_TAGGED_PROPERTY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3729 TSS_TPMS_TAGGED_PROPERTY_Marshalu(const TPMS_TAGGED_PROPERTY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3730 {
3731 TPM_RC rc = 0;
3732 if (rc == 0) {
3733 rc = TSS_TPM_PT_Marshalu(&source->property, written, buffer, size);
3734 }
3735 if (rc == 0) {
3736 rc = TSS_UINT32_Marshalu(&source->value, written, buffer, size);
3737 }
3738 return rc;
3739 }
3740
3741 /* Table 94 - Definition of TPMS_TAGGED_PCR_SELECT Structure <OUT> */
3742
3743 TPM_RC
TSS_TPMS_TAGGED_PCR_SELECT_Marshalu(const TPMS_TAGGED_PCR_SELECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3744 TSS_TPMS_TAGGED_PCR_SELECT_Marshalu(const TPMS_TAGGED_PCR_SELECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3745 {
3746 TPM_RC rc = 0;
3747 if (rc == 0) {
3748 rc = TSS_TPM_PT_PCR_Marshalu(&source->tag, written, buffer, size);
3749 }
3750 if (rc == 0) {
3751 rc = TSS_UINT8_Marshalu(&source->sizeofSelect, written, buffer, size);
3752 }
3753 if (rc == 0) {
3754 rc = TSS_Array_Marshalu(&source->pcrSelect[0], source->sizeofSelect, written, buffer, size);
3755 }
3756 return rc;
3757 }
3758
3759 /* Table 95 - Definition of TPML_CC Structure */
3760
3761 TPM_RC
TSS_TPML_CC_Marshalu(const TPML_CC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3762 TSS_TPML_CC_Marshalu(const TPML_CC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3763 {
3764 TPM_RC rc = 0;
3765 uint32_t i;
3766
3767 if (rc == 0) {
3768 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3769 }
3770 for (i = 0 ; i < source->count ; i++) {
3771 if (rc == 0) {
3772 rc = TSS_TPM_CC_Marshalu(&source->commandCodes[i], written, buffer, size);
3773 }
3774 }
3775 return rc;
3776 }
3777
3778 /* Table 96 - Definition of TPML_CCA Structure <OUT> */
3779
3780 TPM_RC
TSS_TPML_CCA_Marshalu(const TPML_CCA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3781 TSS_TPML_CCA_Marshalu(const TPML_CCA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3782 {
3783 TPM_RC rc = 0;
3784 uint32_t i;
3785
3786 if (rc == 0) {
3787 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3788 }
3789 for (i = 0 ; i < source->count ; i++) {
3790 if (rc == 0) {
3791 rc = TSS_TPMA_CC_Marshalu(&source->commandAttributes[i], written, buffer, size);
3792 }
3793 }
3794 return rc;
3795 }
3796
3797 /* Table 97 - Definition of TPML_ALG Structure */
3798
3799 TPM_RC
TSS_TPML_ALG_Marshalu(const TPML_ALG * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3800 TSS_TPML_ALG_Marshalu(const TPML_ALG *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3801 {
3802 TPM_RC rc = 0;
3803 uint32_t i;
3804
3805 if (rc == 0) {
3806 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3807 }
3808 for (i = 0 ; i < source->count ; i++) {
3809 if (rc == 0) {
3810 rc = TSS_TPM_ALG_ID_Marshalu(&source->algorithms[i], written, buffer, size);
3811 }
3812 }
3813 return rc;
3814 }
3815
3816 /* Table 98 - Definition of TPML_HANDLE Structure <OUT> */
3817
3818 TPM_RC
TSS_TPML_HANDLE_Marshalu(const TPML_HANDLE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3819 TSS_TPML_HANDLE_Marshalu(const TPML_HANDLE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3820 {
3821 TPM_RC rc = 0;
3822 uint32_t i;
3823
3824 if (rc == 0) {
3825 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3826 }
3827 for (i = 0 ; i < source->count ; i++) {
3828 if (rc == 0) {
3829 rc = TSS_TPM_HANDLE_Marshalu(&source->handle[i], written, buffer, size);
3830 }
3831 }
3832 return rc;
3833 }
3834
3835 /* Table 99 - Definition of TPML_DIGEST Structure */
3836
3837 TPM_RC
TSS_TPML_DIGEST_Marshalu(const TPML_DIGEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3838 TSS_TPML_DIGEST_Marshalu(const TPML_DIGEST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3839 {
3840 TPM_RC rc = 0;
3841 uint32_t i;
3842
3843 if (rc == 0) {
3844 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3845 }
3846 for (i = 0 ; i < source->count ; i++) {
3847 if (rc == 0) {
3848 rc = TSS_TPM2B_DIGEST_Marshalu(&source->digests[i], written, buffer, size);
3849 }
3850 }
3851 return rc;
3852 }
3853
3854 /* Table 100 - Definition of TPML_DIGEST_VALUES Structure */
3855
3856 TPM_RC
TSS_TPML_DIGEST_VALUES_Marshalu(const TPML_DIGEST_VALUES * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3857 TSS_TPML_DIGEST_VALUES_Marshalu(const TPML_DIGEST_VALUES *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3858 {
3859 TPM_RC rc = 0;
3860 uint32_t i;
3861
3862 if (rc == 0) {
3863 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3864 }
3865 for (i = 0 ; i < source->count ; i++) {
3866 if (rc == 0) {
3867 rc = TSS_TPMT_HA_Marshalu(&source->digests[i], written, buffer, size);
3868 }
3869 }
3870 return rc;
3871 }
3872
3873 /* Table 102 - Definition of TPML_PCR_SELECTION Structure */
3874
3875 TPM_RC
TSS_TPML_PCR_SELECTION_Marshalu(const TPML_PCR_SELECTION * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3876 TSS_TPML_PCR_SELECTION_Marshalu(const TPML_PCR_SELECTION *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3877 {
3878 TPM_RC rc = 0;
3879 uint32_t i;
3880
3881 if (rc == 0) {
3882 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3883 }
3884 for (i = 0 ; i < source->count ; i++) {
3885 if (rc == 0) {
3886 rc = TSS_TPMS_PCR_SELECTION_Marshalu(&source->pcrSelections[i], written, buffer, size);
3887 }
3888 }
3889 return rc;
3890 }
3891
3892 /* Table 103 - Definition of TPML_ALG_PROPERTY Structure <OUT> */
3893
3894 TPM_RC
TSS_TPML_ALG_PROPERTY_Marshalu(const TPML_ALG_PROPERTY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3895 TSS_TPML_ALG_PROPERTY_Marshalu(const TPML_ALG_PROPERTY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3896 {
3897 TPM_RC rc = 0;
3898 uint32_t i;
3899
3900 if (rc == 0) {
3901 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3902 }
3903 for (i = 0 ; i < source->count ; i++) {
3904 if (rc == 0) {
3905 rc = TSS_TPMS_ALG_PROPERTY_Marshalu(&source->algProperties[i], written, buffer, size);
3906 }
3907 }
3908 return rc;
3909 }
3910
3911 /* Table 104 - Definition of TPML_TAGGED_TPM_PROPERTY Structure <OUT> */
3912
3913 TPM_RC
TSS_TPML_TAGGED_TPM_PROPERTY_Marshalu(const TPML_TAGGED_TPM_PROPERTY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3914 TSS_TPML_TAGGED_TPM_PROPERTY_Marshalu(const TPML_TAGGED_TPM_PROPERTY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3915 {
3916 TPM_RC rc = 0;
3917 uint32_t i;
3918
3919 if (rc == 0) {
3920 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3921 }
3922 for (i = 0 ; i < source->count ; i++) {
3923 if (rc == 0) {
3924 rc = TSS_TPMS_TAGGED_PROPERTY_Marshalu(&source->tpmProperty[i], written, buffer, size);
3925 }
3926 }
3927 return rc;
3928 }
3929
3930 /* Table 105 - Definition of TPML_TAGGED_PCR_PROPERTY Structure <OUT> */
3931
3932 TPM_RC
TSS_TPML_TAGGED_PCR_PROPERTY_Marshalu(const TPML_TAGGED_PCR_PROPERTY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3933 TSS_TPML_TAGGED_PCR_PROPERTY_Marshalu(const TPML_TAGGED_PCR_PROPERTY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3934 {
3935 TPM_RC rc = 0;
3936 uint32_t i;
3937
3938 if (rc == 0) {
3939 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3940 }
3941 for (i = 0 ; i < source->count ; i++) {
3942 if (rc == 0) {
3943 rc = TSS_TPMS_TAGGED_PCR_SELECT_Marshalu(&source->pcrProperty[i], written, buffer, size);
3944 }
3945 }
3946 return rc;
3947 }
3948
3949 /* Table 106 - Definition of {ECC} TPML_ECC_CURVE Structure <OUT> */
3950
3951 TPM_RC
TSS_TPML_ECC_CURVE_Marshalu(const TPML_ECC_CURVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)3952 TSS_TPML_ECC_CURVE_Marshalu(const TPML_ECC_CURVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
3953 {
3954 TPM_RC rc = 0;
3955 uint32_t i;
3956
3957 if (rc == 0) {
3958 rc = TSS_UINT32_Marshalu(&source->count, written, buffer, size);
3959 }
3960 for (i = 0 ; i < source->count ; i++) {
3961 if (rc == 0) {
3962 rc = TSS_TPM_ECC_CURVE_Marshalu(&source->eccCurves[i], written, buffer, size);
3963 }
3964 }
3965 return rc;
3966 }
3967
3968 /* Table 107 - Definition of TPMU_CAPABILITIES Union <OUT> */
3969
3970 TPM_RC
TSS_TPMU_CAPABILITIES_Marshalu(const TPMU_CAPABILITIES * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)3971 TSS_TPMU_CAPABILITIES_Marshalu(const TPMU_CAPABILITIES *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
3972 {
3973 TPM_RC rc = 0;
3974 switch (selector) {
3975 case TPM_CAP_ALGS:
3976 if (rc == 0) {
3977 rc = TSS_TPML_ALG_PROPERTY_Marshalu(&source->algorithms, written, buffer, size);
3978 }
3979 break;
3980 case TPM_CAP_HANDLES:
3981 if (rc == 0) {
3982 rc = TSS_TPML_HANDLE_Marshalu(&source->handles, written, buffer, size);
3983 }
3984 break;
3985 case TPM_CAP_COMMANDS:
3986 if (rc == 0) {
3987 rc = TSS_TPML_CCA_Marshalu(&source->command, written, buffer, size);
3988 }
3989 break;
3990 case TPM_CAP_PP_COMMANDS:
3991 if (rc == 0) {
3992 rc = TSS_TPML_CC_Marshalu(&source->ppCommands, written, buffer, size);
3993 }
3994 break;
3995 case TPM_CAP_AUDIT_COMMANDS:
3996 if (rc == 0) {
3997 rc = TSS_TPML_CC_Marshalu(&source->auditCommands, written, buffer, size);
3998 }
3999 break;
4000 case TPM_CAP_PCRS:
4001 if (rc == 0) {
4002 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->assignedPCR, written, buffer, size);
4003 }
4004 break;
4005 case TPM_CAP_TPM_PROPERTIES:
4006 if (rc == 0) {
4007 rc = TSS_TPML_TAGGED_TPM_PROPERTY_Marshalu(&source->tpmProperties, written, buffer, size);
4008 }
4009 break;
4010 case TPM_CAP_PCR_PROPERTIES:
4011 if (rc == 0) {
4012 rc = TSS_TPML_TAGGED_PCR_PROPERTY_Marshalu(&source->pcrProperties, written, buffer, size);
4013 }
4014 break;
4015 case TPM_CAP_ECC_CURVES:
4016 if (rc == 0) {
4017 rc = TSS_TPML_ECC_CURVE_Marshalu(&source->eccCurves, written, buffer, size);
4018 }
4019 break;
4020 default:
4021 rc = TPM_RC_SELECTOR;
4022 }
4023 return rc;
4024 }
4025
4026 /* Table 108 - Definition of TPMS_CAPABILITY_DATA Structure <OUT> */
4027
4028 TPM_RC
TSS_TPMS_CAPABILITY_DATA_Marshalu(const TPMS_CAPABILITY_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4029 TSS_TPMS_CAPABILITY_DATA_Marshalu(const TPMS_CAPABILITY_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4030 {
4031 TPM_RC rc = 0;
4032 if (rc == 0) {
4033 rc = TSS_TPM_CAP_Marshalu(&source->capability, written, buffer, size);
4034 }
4035 if (rc == 0) {
4036 rc = TSS_TPMU_CAPABILITIES_Marshalu(&source->data, written, buffer, size, source->capability);
4037 }
4038 return rc;
4039 }
4040
4041 /* Table 109 - Definition of TPMS_CLOCK_INFO Structure */
4042
4043 TPM_RC
TSS_TPMS_CLOCK_INFO_Marshalu(const TPMS_CLOCK_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4044 TSS_TPMS_CLOCK_INFO_Marshalu(const TPMS_CLOCK_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4045 {
4046 TPM_RC rc = 0;
4047 if (rc == 0) {
4048 rc = TSS_UINT64_Marshalu(&source->clock, written, buffer, size);
4049 }
4050 if (rc == 0) {
4051 rc = TSS_UINT32_Marshalu(&source->resetCount, written, buffer, size);
4052 }
4053 if (rc == 0) {
4054 rc = TSS_UINT32_Marshalu(&source->restartCount, written, buffer, size);
4055 }
4056 if (rc == 0) {
4057 rc = TSS_TPMI_YES_NO_Marshalu(&source->safe, written, buffer, size);
4058 }
4059 return rc;
4060 }
4061
4062 /* Table 110 - Definition of TPMS_TIME_INFO Structure */
4063
4064 TPM_RC
TSS_TPMS_TIME_INFO_Marshalu(const TPMS_TIME_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4065 TSS_TPMS_TIME_INFO_Marshalu(const TPMS_TIME_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4066 {
4067 TPM_RC rc = 0;
4068 if (rc == 0) {
4069 rc = TSS_UINT64_Marshalu(&source->time, written, buffer, size);
4070 }
4071 if (rc == 0) {
4072 rc = TSS_TPMS_CLOCK_INFO_Marshalu(&source->clockInfo, written, buffer, size);
4073 }
4074 return rc;
4075 }
4076
4077 /* Table 111 - Definition of TPMS_TIME_ATTEST_INFO Structure <OUT> */
4078
4079 TPM_RC
TSS_TPMS_TIME_ATTEST_INFO_Marshalu(const TPMS_TIME_ATTEST_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4080 TSS_TPMS_TIME_ATTEST_INFO_Marshalu(const TPMS_TIME_ATTEST_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4081 {
4082 TPM_RC rc = 0;
4083 if (rc == 0) {
4084 rc = TSS_TPMS_TIME_INFO_Marshalu(&source->time, written, buffer, size);
4085 }
4086 if (rc == 0) {
4087 rc = TSS_UINT64_Marshalu(&source->firmwareVersion, written, buffer, size);
4088 }
4089 return rc;
4090 }
4091
4092 /* Table 112 - Definition of TPMS_CERTIFY_INFO Structure <OUT> */
4093
4094 TPM_RC
TSS_TPMS_CERTIFY_INFO_Marshalu(const TPMS_CERTIFY_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4095 TSS_TPMS_CERTIFY_INFO_Marshalu(const TPMS_CERTIFY_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4096 {
4097 TPM_RC rc = 0;
4098 if (rc == 0) {
4099 rc = TSS_TPM2B_NAME_Marshalu(&source->name, written, buffer, size);
4100 }
4101 if (rc == 0) {
4102 rc = TSS_TPM2B_NAME_Marshalu(&source->qualifiedName, written, buffer, size);
4103 }
4104 return rc;
4105 }
4106
4107 /* Table 113 - Definition of TPMS_QUOTE_INFO Structure <OUT> */
4108
4109 TPM_RC
TSS_TPMS_QUOTE_INFO_Marshalu(const TPMS_QUOTE_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4110 TSS_TPMS_QUOTE_INFO_Marshalu(const TPMS_QUOTE_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4111 {
4112 TPM_RC rc = 0;
4113 if (rc == 0) {
4114 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->pcrSelect, written, buffer, size);
4115 }
4116 if (rc == 0) {
4117 rc = TSS_TPM2B_DIGEST_Marshalu(&source->pcrDigest, written, buffer, size);
4118 }
4119 return rc;
4120 }
4121
4122 /* Table 114 - Definition of TPMS_COMMAND_AUDIT_INFO Structure <OUT> */
4123
4124 TPM_RC
TSS_TPMS_COMMAND_AUDIT_INFO_Marshalu(const TPMS_COMMAND_AUDIT_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4125 TSS_TPMS_COMMAND_AUDIT_INFO_Marshalu(const TPMS_COMMAND_AUDIT_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4126 {
4127 TPM_RC rc = 0;
4128 if (rc == 0) {
4129 rc = TSS_UINT64_Marshalu(&source->auditCounter, written, buffer, size);
4130 }
4131 if (rc == 0) {
4132 rc = TSS_TPM_ALG_ID_Marshalu(&source->digestAlg, written, buffer, size);
4133 }
4134 if (rc == 0) {
4135 rc = TSS_TPM2B_DIGEST_Marshalu(&source->auditDigest, written, buffer, size);
4136 }
4137 if (rc == 0) {
4138 rc = TSS_TPM2B_DIGEST_Marshalu(&source->commandDigest, written, buffer, size);
4139 }
4140 return rc;
4141 }
4142
4143 /* Table 115 - Definition of TPMS_SESSION_AUDIT_INFO Structure <OUT> */
4144
4145 TPM_RC
TSS_TPMS_SESSION_AUDIT_INFO_Marshalu(const TPMS_SESSION_AUDIT_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4146 TSS_TPMS_SESSION_AUDIT_INFO_Marshalu(const TPMS_SESSION_AUDIT_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4147 {
4148 TPM_RC rc = 0;
4149 if (rc == 0) {
4150 rc = TSS_TPMI_YES_NO_Marshalu(&source->exclusiveSession, written, buffer, size);
4151 }
4152 if (rc == 0) {
4153 rc = TSS_TPM2B_DIGEST_Marshalu(&source->sessionDigest, written, buffer, size);
4154 }
4155 return rc;
4156 }
4157
4158 /* Table 116 - Definition of TPMS_CREATION_INFO Structure <OUT> */
4159
4160 TPM_RC
TSS_TPMS_CREATION_INFO_Marshalu(const TPMS_CREATION_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4161 TSS_TPMS_CREATION_INFO_Marshalu(const TPMS_CREATION_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4162 {
4163 TPM_RC rc = 0;
4164 if (rc == 0) {
4165 rc = TSS_TPM2B_NAME_Marshalu(&source->objectName, written, buffer, size);
4166 }
4167 if (rc == 0) {
4168 rc = TSS_TPM2B_DIGEST_Marshalu(&source->creationHash, written, buffer, size);
4169 }
4170 return rc;
4171 }
4172
4173 /* Table 117 - Definition of TPMS_NV_CERTIFY_INFO Structure <OUT> */
4174
4175 TPM_RC
TSS_TPMS_NV_CERTIFY_INFO_Marshalu(const TPMS_NV_CERTIFY_INFO * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4176 TSS_TPMS_NV_CERTIFY_INFO_Marshalu(const TPMS_NV_CERTIFY_INFO *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4177 {
4178 TPM_RC rc = 0;
4179 if (rc == 0) {
4180 rc = TSS_TPM2B_NAME_Marshalu(&source->indexName, written, buffer, size);
4181 }
4182 if (rc == 0) {
4183 rc = TSS_UINT16_Marshalu(&source->offset, written, buffer, size);
4184 }
4185 if (rc == 0) {
4186 rc = TSS_TPM2B_MAX_NV_BUFFER_Marshalu(&source->nvContents, written, buffer, size);
4187 }
4188 return rc;
4189 }
4190
4191 /* Table 118 - Definition of (TPM_ST) TPMI_ST_ATTEST Type <OUT> */
4192
4193 TPM_RC
TSS_TPMI_ST_ATTEST_Marshalu(const TPMI_ST_ATTEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4194 TSS_TPMI_ST_ATTEST_Marshalu(const TPMI_ST_ATTEST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4195 {
4196 TPM_RC rc = 0;
4197 if (rc == 0) {
4198 rc = TSS_TPM_ST_Marshalu(source, written, buffer, size);
4199 }
4200 return rc;
4201 }
4202
4203 /* Table 119 - Definition of TPMU_ATTEST Union <OUT> */
4204
4205 TPM_RC
TSS_TPMU_ATTEST_Marshalu(const TPMU_ATTEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4206 TSS_TPMU_ATTEST_Marshalu(const TPMU_ATTEST *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4207 {
4208 TPM_RC rc = 0;
4209 switch (selector) {
4210 case TPM_ST_ATTEST_CERTIFY:
4211 if (rc == 0) {
4212 rc = TSS_TPMS_CERTIFY_INFO_Marshalu(&source->certify, written, buffer, size);
4213 }
4214 break;
4215 case TPM_ST_ATTEST_CREATION:
4216 if (rc == 0) {
4217 rc = TSS_TPMS_CREATION_INFO_Marshalu(&source->creation, written, buffer, size);
4218 }
4219 break;
4220 case TPM_ST_ATTEST_QUOTE:
4221 if (rc == 0) {
4222 rc = TSS_TPMS_QUOTE_INFO_Marshalu(&source->quote, written, buffer, size);
4223 }
4224 break;
4225 case TPM_ST_ATTEST_COMMAND_AUDIT:
4226 if (rc == 0) {
4227 rc = TSS_TPMS_COMMAND_AUDIT_INFO_Marshalu(&source->commandAudit, written, buffer, size);
4228 }
4229 break;
4230 case TPM_ST_ATTEST_SESSION_AUDIT:
4231 if (rc == 0) {
4232 rc = TSS_TPMS_SESSION_AUDIT_INFO_Marshalu(&source->sessionAudit, written, buffer, size);
4233 }
4234 break;
4235 case TPM_ST_ATTEST_TIME:
4236 if (rc == 0) {
4237 rc = TSS_TPMS_TIME_ATTEST_INFO_Marshalu(&source->time, written, buffer, size);
4238 }
4239 break;
4240 case TPM_ST_ATTEST_NV:
4241 if (rc == 0) {
4242 rc = TSS_TPMS_NV_CERTIFY_INFO_Marshalu(&source->nv, written, buffer, size);
4243 }
4244 break;
4245 default:
4246 rc = TPM_RC_SELECTOR;
4247 }
4248 return rc;
4249 }
4250
4251 /* Table 120 - Definition of TPMS_ATTEST Structure <OUT> */
4252
4253 TPM_RC
TSS_TPMS_ATTEST_Marshalu(const TPMS_ATTEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4254 TSS_TPMS_ATTEST_Marshalu(const TPMS_ATTEST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4255 {
4256 TPM_RC rc = 0;
4257 if (rc == 0) {
4258 rc = TSS_TPM_GENERATED_Marshalu(&source->magic, written, buffer, size);
4259 }
4260 if (rc == 0) {
4261 rc = TSS_TPMI_ST_ATTEST_Marshalu(&source->type, written, buffer, size);
4262 }
4263 if (rc == 0) {
4264 rc = TSS_TPM2B_NAME_Marshalu(&source->qualifiedSigner, written, buffer, size);
4265 }
4266 if (rc == 0) {
4267 rc = TSS_TPM2B_DATA_Marshalu(&source->extraData, written, buffer, size);
4268 }
4269 if (rc == 0) {
4270 rc = TSS_TPMS_CLOCK_INFO_Marshalu(&source->clockInfo, written, buffer, size);
4271 }
4272 if (rc == 0) {
4273 rc = TSS_UINT64_Marshalu(&source->firmwareVersion, written, buffer, size);
4274 }
4275 if (rc == 0) {
4276 rc = TSS_TPMU_ATTEST_Marshalu(&source->attested, written, buffer, size,source->type);
4277 }
4278 return rc;
4279 }
4280
4281 /* Table 121 - Definition of TPM2B_ATTEST Structure <OUT> */
4282
4283 TPM_RC
TSS_TPM2B_ATTEST_Marshalu(const TPM2B_ATTEST * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4284 TSS_TPM2B_ATTEST_Marshalu(const TPM2B_ATTEST *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4285 {
4286 TPM_RC rc = 0;
4287 if (rc == 0) {
4288 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
4289 }
4290 return rc;
4291 }
4292
4293 /* Table 122 - Definition of TPMS_AUTH_COMMAND Structure <IN> */
4294
4295 TPM_RC
TSS_TPMS_AUTH_COMMAND_Marshalu(const TPMS_AUTH_COMMAND * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4296 TSS_TPMS_AUTH_COMMAND_Marshalu(const TPMS_AUTH_COMMAND *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4297 {
4298 TPM_RC rc = 0;
4299 if (rc == 0) {
4300 rc = TSS_TPMI_SH_AUTH_SESSION_Marshalu(&source->sessionHandle, written, buffer, size);
4301 }
4302 if (rc == 0) {
4303 rc = TSS_TPM2B_NONCE_Marshalu(&source->nonce, written, buffer, size);
4304 }
4305 if (rc == 0) {
4306 rc = TSS_TPMA_SESSION_Marshalu(&source->sessionAttributes, written, buffer, size);
4307 }
4308 if (rc == 0) {
4309 rc = TSS_TPM2B_AUTH_Marshalu(&source->hmac, written, buffer, size);
4310 }
4311 return rc;
4312 }
4313
4314 /* Table 124 - Definition of {AES} (TPM_KEY_BITS) TPMI_!ALG.S_KEY_BITS Type */
4315
4316 TPM_RC
TSS_TPMI_AES_KEY_BITS_Marshalu(const TPMI_AES_KEY_BITS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4317 TSS_TPMI_AES_KEY_BITS_Marshalu(const TPMI_AES_KEY_BITS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4318 {
4319 TPM_RC rc = 0;
4320 if (rc == 0) {
4321 rc = TSS_TPM_KEY_BITS_Marshalu(source, written, buffer, size);
4322 }
4323 return rc;
4324 }
4325
4326 /* Table 125 - Definition of TPMU_SYM_KEY_BITS Union */
4327
4328 TPM_RC
TSS_TPMU_SYM_KEY_BITS_Marshalu(const TPMU_SYM_KEY_BITS * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4329 TSS_TPMU_SYM_KEY_BITS_Marshalu(const TPMU_SYM_KEY_BITS *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4330 {
4331 TPM_RC rc = 0;
4332 switch(selector) {
4333 #ifdef TPM_ALG_AES
4334 case TPM_ALG_AES:
4335 if (rc == 0) {
4336 rc = TSS_TPMI_AES_KEY_BITS_Marshalu(&source->aes, written, buffer, size);
4337 }
4338 break;
4339 #endif
4340 #ifdef TPM_ALG_SM4
4341 case TPM_ALG_SM4:
4342 if (rc == 0) {
4343 rc = TSS_TPMI_SM4_KEY_BITS_Marshalu(&source->sm4, written, buffer, size);
4344 }
4345 break;
4346 #endif
4347 #ifdef TPM_ALG_CAMELLIA
4348 case TPM_ALG_CAMELLIA:
4349 if (rc == 0) {
4350 rc = TSS_TPMI_CAMELLIA_KEY_BITS_Marshalu(&source->camellia, written, buffer, size);
4351 }
4352 break;
4353 #endif
4354 #ifdef TPM_ALG_XOR
4355 case TPM_ALG_XOR:
4356 if (rc == 0) {
4357 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->xorr, written, buffer, size);
4358 }
4359 break;
4360 #endif
4361 case TPM_ALG_NULL:
4362 break;
4363 default:
4364 return rc;
4365 }
4366 return rc;
4367 }
4368
4369 /* Table 126 - Definition of TPMU_SYM_MODE Union */
4370
4371 TPM_RC
TSS_TPMU_SYM_MODE_Marshalu(const TPMU_SYM_MODE * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4372 TSS_TPMU_SYM_MODE_Marshalu(const TPMU_SYM_MODE *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4373 {
4374 TPM_RC rc = 0;
4375 switch (selector) {
4376 #ifdef TPM_ALG_AES
4377 case TPM_ALG_AES:
4378 if (rc == 0) {
4379 rc = TSS_TPMI_ALG_SYM_MODE_Marshalu(&source->aes, written, buffer, size);
4380 }
4381 break;
4382 #endif
4383 #ifdef TPM_ALG_SM4
4384 case TPM_ALG_SM4:
4385 if (rc == 0) {
4386 rc = TSS_TPMI_ALG_SYM_MODE_Marshalu(&source->sm4, written, buffer, size);
4387 }
4388 break;
4389 #endif
4390 #ifdef TPM_ALG_CAMELLIA
4391 case TPM_ALG_CAMELLIA:
4392 if (rc == 0) {
4393 rc = TSS_TPMI_ALG_SYM_MODE_Marshalu(&source->camellia, written, buffer, size);
4394 }
4395 break;
4396 #endif
4397 #ifdef TPM_ALG_XOR
4398 case TPM_ALG_XOR:
4399 #endif
4400 case TPM_ALG_NULL:
4401 break;
4402 default:
4403 rc = TPM_RC_SELECTOR;
4404 }
4405 return rc;
4406 }
4407
4408 /* Table 128 - Definition of TPMT_SYM_DEF Structure */
4409
4410 TPM_RC
TSS_TPMT_SYM_DEF_Marshalu(const TPMT_SYM_DEF * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4411 TSS_TPMT_SYM_DEF_Marshalu(const TPMT_SYM_DEF *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4412 {
4413 TPM_RC rc = 0;
4414 if (rc == 0) {
4415 rc = TSS_TPMI_ALG_SYM_Marshalu(&source->algorithm, written, buffer, size);
4416 }
4417 if (rc == 0) {
4418 rc = TSS_TPMU_SYM_KEY_BITS_Marshalu(&source->keyBits, written, buffer, size, source->algorithm);
4419 }
4420 if (rc == 0) {
4421 rc = TSS_TPMU_SYM_MODE_Marshalu(&source->mode, written, buffer, size, source->algorithm);
4422 }
4423 return rc;
4424 }
4425
4426 /* Table 129 - Definition of TPMT_SYM_DEF_OBJECT Structure */
4427
4428 TPM_RC
TSS_TPMT_SYM_DEF_OBJECT_Marshalu(const TPMT_SYM_DEF_OBJECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4429 TSS_TPMT_SYM_DEF_OBJECT_Marshalu(const TPMT_SYM_DEF_OBJECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4430 {
4431 TPM_RC rc = 0;
4432 if (rc == 0) {
4433 rc = TSS_TPMI_ALG_SYM_OBJECT_Marshalu(&source->algorithm, written, buffer, size);
4434 }
4435 if (rc == 0) {
4436 rc = TSS_TPMU_SYM_KEY_BITS_Marshalu(&source->keyBits, written, buffer, size, source->algorithm);
4437 }
4438 if (rc == 0) {
4439 rc = TSS_TPMU_SYM_MODE_Marshalu(&source->mode, written, buffer, size, source->algorithm);
4440 }
4441 return rc;
4442 }
4443
4444 /* Table 130 - Definition of TPM2B_SYM_KEY Structure */
4445
4446 TPM_RC
TSS_TPM2B_SYM_KEY_Marshalu(const TPM2B_SYM_KEY * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4447 TSS_TPM2B_SYM_KEY_Marshalu(const TPM2B_SYM_KEY *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4448 {
4449 TPM_RC rc = 0;
4450 if (rc == 0) {
4451 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
4452 }
4453 return rc;
4454 }
4455
4456 /* Table 134 - Definition of TPM2B_LABEL Structure */
4457
4458 TPM_RC
TSS_TPM2B_LABEL_Marshalu(const TPM2B_LABEL * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4459 TSS_TPM2B_LABEL_Marshalu(const TPM2B_LABEL *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4460 {
4461 TPM_RC rc = 0;
4462 if (rc == 0) {
4463 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
4464 }
4465 return rc;
4466 }
4467
4468 /* Table 139 - Definition of TPMS_DERIVE Structure */
4469
4470 TPM_RC
TSS_TPMS_DERIVE_Marshalu(const TPMS_DERIVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4471 TSS_TPMS_DERIVE_Marshalu(const TPMS_DERIVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4472 {
4473 TPM_RC rc = 0;
4474 if (rc == 0) {
4475 rc = TSS_TPM2B_LABEL_Marshalu(&source->label, written, buffer, size);
4476 }
4477 if (rc == 0) {
4478 rc = TSS_TPM2B_LABEL_Marshalu(&source->context, written, buffer, size);
4479 }
4480 return rc;
4481 }
4482
4483 /* Table 131 - Definition of TPMS_SYMCIPHER_PARMS Structure */
4484
4485 TPM_RC
TSS_TPMS_SYMCIPHER_PARMS_Marshalu(const TPMS_SYMCIPHER_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4486 TSS_TPMS_SYMCIPHER_PARMS_Marshalu(const TPMS_SYMCIPHER_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4487 {
4488 TPM_RC rc = 0;
4489 if (rc == 0) {
4490 rc = TSS_TPMT_SYM_DEF_OBJECT_Marshalu(&source->sym, written, buffer, size);
4491 }
4492 return rc;
4493 }
4494
4495 /* Table 132 - Definition of TPM2B_SENSITIVE_DATA Structure */
4496
4497 TPM_RC
TSS_TPM2B_SENSITIVE_DATA_Marshalu(const TPM2B_SENSITIVE_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4498 TSS_TPM2B_SENSITIVE_DATA_Marshalu(const TPM2B_SENSITIVE_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4499 {
4500 TPM_RC rc = 0;
4501 if (rc == 0) {
4502 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
4503 }
4504 return rc;
4505 }
4506
4507 /* Table 133 - Definition of TPMS_SENSITIVE_CREATE Structure <IN> */
4508
4509 TPM_RC
TSS_TPMS_SENSITIVE_CREATE_Marshalu(const TPMS_SENSITIVE_CREATE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4510 TSS_TPMS_SENSITIVE_CREATE_Marshalu(const TPMS_SENSITIVE_CREATE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4511 {
4512 TPM_RC rc = 0;
4513 if (rc == 0) {
4514 rc = TSS_TPM2B_AUTH_Marshalu(&source->userAuth, written, buffer, size);
4515 }
4516 if (rc == 0) {
4517 rc = TSS_TPM2B_SENSITIVE_DATA_Marshalu(&source->data, written, buffer, size);
4518 }
4519 return rc;
4520 }
4521
4522 /* Table 134 - Definition of TPM2B_SENSITIVE_CREATE Structure <IN, S> */
4523
4524 TPM_RC
TSS_TPM2B_SENSITIVE_CREATE_Marshalu(const TPM2B_SENSITIVE_CREATE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4525 TSS_TPM2B_SENSITIVE_CREATE_Marshalu(const TPM2B_SENSITIVE_CREATE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4526 {
4527 TPM_RC rc = 0;
4528 uint16_t sizeWritten = 0; /* of structure */
4529 BYTE *sizePtr;
4530
4531 if (buffer != NULL) {
4532 sizePtr = *buffer;
4533 *buffer += sizeof(uint16_t);
4534 }
4535 if (rc == 0) {
4536 rc = TSS_TPMS_SENSITIVE_CREATE_Marshalu(&source->sensitive, &sizeWritten, buffer, size);
4537 }
4538 if (rc == 0) {
4539 *written += sizeWritten;
4540 if (buffer != NULL) {
4541 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size); /* backfill 2B size */
4542 }
4543 else {
4544 *written += sizeof(uint16_t);
4545 }
4546 }
4547 return rc;
4548 }
4549
4550 /* Table 135 - Definition of TPMS_SCHEME_HASH Structure */
4551
4552 TPM_RC
TSS_TPMS_SCHEME_HASH_Marshalu(const TPMS_SCHEME_HASH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4553 TSS_TPMS_SCHEME_HASH_Marshalu(const TPMS_SCHEME_HASH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4554 {
4555 TPM_RC rc = 0;
4556 if (rc == 0) {
4557 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
4558 }
4559 return rc;
4560 }
4561
4562 /* Table 136 - Definition of {ECC} TPMS_SCHEME_ECDAA Structure */
4563
4564 TPM_RC
TSS_TPMS_SCHEME_ECDAA_Marshalu(const TPMS_SCHEME_ECDAA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4565 TSS_TPMS_SCHEME_ECDAA_Marshalu(const TPMS_SCHEME_ECDAA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4566 {
4567 TPM_RC rc = 0;
4568 if (rc == 0) {
4569 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
4570 }
4571 if (rc == 0) {
4572 rc = TSS_UINT16_Marshalu(&source->count, written, buffer, size);
4573 }
4574 return rc;
4575 }
4576
4577 /* Table 137 - Definition of (TPM_ALG_ID) TPMI_ALG_KEYEDHASH_SCHEME Type */
4578
4579 TPM_RC
TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshalu(const TPMI_ALG_KEYEDHASH_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4580 TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshalu(const TPMI_ALG_KEYEDHASH_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4581 {
4582 TPM_RC rc = 0;
4583 if (rc == 0) {
4584 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
4585 }
4586 return rc;
4587 }
4588
4589 /* Table 138 - Definition of Types for HMAC_SIG_SCHEME */
4590
4591 TPM_RC
TSS_TPMS_SCHEME_HMAC_Marshalu(const TPMS_SCHEME_HMAC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4592 TSS_TPMS_SCHEME_HMAC_Marshalu(const TPMS_SCHEME_HMAC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4593 {
4594 TPM_RC rc = 0;
4595 if (rc == 0) {
4596 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4597 }
4598 return rc;
4599 }
4600
4601 /* Table 139 - Definition of TPMS_SCHEME_XOR Structure */
4602
4603 TPM_RC
TSS_TPMS_SCHEME_XOR_Marshalu(const TPMS_SCHEME_XOR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4604 TSS_TPMS_SCHEME_XOR_Marshalu(const TPMS_SCHEME_XOR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4605 {
4606 TPM_RC rc = 0;
4607 if (rc == 0) {
4608 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hashAlg, written, buffer, size);
4609 }
4610 if (rc == 0) {
4611 rc = TSS_TPMI_ALG_KDF_Marshalu(&source->kdf, written, buffer, size);
4612 }
4613 return rc;
4614 }
4615
4616 /* Table 140 - Definition of TPMU_SCHEME_KEYEDHASH Union <IN/OUT, S> */
4617
4618 TPM_RC
TSS_TPMU_SCHEME_KEYEDHASH_Marshalu(const TPMU_SCHEME_KEYEDHASH * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4619 TSS_TPMU_SCHEME_KEYEDHASH_Marshalu(const TPMU_SCHEME_KEYEDHASH *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4620 {
4621 TPM_RC rc = 0;
4622 switch (selector) {
4623 #ifdef TPM_ALG_HMAC
4624 case TPM_ALG_HMAC:
4625 if (rc == 0) {
4626 rc = TSS_TPMS_SCHEME_HMAC_Marshalu(&source->hmac, written, buffer, size);
4627 }
4628 break;
4629 #endif
4630 #ifdef TPM_ALG_XOR
4631 case TPM_ALG_XOR:
4632 if (rc == 0) {
4633 rc = TSS_TPMS_SCHEME_XOR_Marshalu(&source->xorr, written, buffer, size);
4634 }
4635 break;
4636 #endif
4637 case TPM_ALG_NULL:
4638 break;
4639 default:
4640 rc = TPM_RC_SELECTOR;
4641 }
4642 return rc;
4643 }
4644
4645 /* Table 141 - Definition of TPMT_KEYEDHASH_SCHEME Structure */
4646
4647 TPM_RC
TSS_TPMT_KEYEDHASH_SCHEME_Marshalu(const TPMT_KEYEDHASH_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4648 TSS_TPMT_KEYEDHASH_SCHEME_Marshalu(const TPMT_KEYEDHASH_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4649 {
4650 TPM_RC rc = 0;
4651 if (rc == 0) {
4652 rc = TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshalu(&source->scheme, written, buffer, size);
4653 }
4654 if (rc == 0) {
4655 rc = TSS_TPMU_SCHEME_KEYEDHASH_Marshalu(&source->details, written, buffer, size, source->scheme);
4656 }
4657 return rc;
4658 }
4659
4660 /* Table 142 - Definition of {RSA} Types for RSA Signature Schemes */
4661
4662 TPM_RC
TSS_TPMS_SIG_SCHEME_RSASSA_Marshalu(const TPMS_SIG_SCHEME_RSASSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4663 TSS_TPMS_SIG_SCHEME_RSASSA_Marshalu(const TPMS_SIG_SCHEME_RSASSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4664 {
4665 TPM_RC rc = 0;
4666 if (rc == 0) {
4667 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4668 }
4669 return rc;
4670 }
4671
4672 TPM_RC
TSS_TPMS_SIG_SCHEME_RSAPSS_Marshalu(const TPMS_SIG_SCHEME_RSAPSS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4673 TSS_TPMS_SIG_SCHEME_RSAPSS_Marshalu(const TPMS_SIG_SCHEME_RSAPSS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4674 {
4675 TPM_RC rc = 0;
4676 if (rc == 0) {
4677 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4678 }
4679 return rc;
4680 }
4681
4682 /* Table 143 - Definition of {ECC} Types for ECC Signature Schemes */
4683
4684 TPM_RC
TSS_TPMS_SIG_SCHEME_ECDSA_Marshalu(const TPMS_SIG_SCHEME_ECDSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4685 TSS_TPMS_SIG_SCHEME_ECDSA_Marshalu(const TPMS_SIG_SCHEME_ECDSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4686 {
4687 TPM_RC rc = 0;
4688 if (rc == 0) {
4689 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4690 }
4691 return rc;
4692 }
4693 TPM_RC
TSS_TPMS_SIG_SCHEME_SM2_Marshalu(const TPMS_SIG_SCHEME_SM2 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4694 TSS_TPMS_SIG_SCHEME_SM2_Marshalu(const TPMS_SIG_SCHEME_SM2 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4695 {
4696 TPM_RC rc = 0;
4697 if (rc == 0) {
4698 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4699 }
4700 return rc;
4701 }
4702 TPM_RC
TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshalu(const TPMS_SIG_SCHEME_ECSCHNORR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4703 TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshalu(const TPMS_SIG_SCHEME_ECSCHNORR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4704 {
4705 TPM_RC rc = 0;
4706 if (rc == 0) {
4707 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4708 }
4709 return rc;
4710 }
4711
4712 /* Table 143 - Definition of {ECC} Types for ECC Signature Schemes */
4713
4714 TPM_RC
TSS_TPMS_SIG_SCHEME_ECDAA_Marshalu(const TPMS_SIG_SCHEME_ECDAA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4715 TSS_TPMS_SIG_SCHEME_ECDAA_Marshalu(const TPMS_SIG_SCHEME_ECDAA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4716 {
4717 TPM_RC rc = 0;
4718 if (rc == 0) {
4719 rc = TSS_TPMS_SCHEME_ECDAA_Marshalu(source, written, buffer, size);
4720 }
4721 return rc;
4722 }
4723
4724 /* Table 144 - Definition of TPMU_SIG_SCHEME Union <IN/OUT, S> */
4725
4726 TPM_RC
TSS_TPMU_SIG_SCHEME_Marshalu(const TPMU_SIG_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4727 TSS_TPMU_SIG_SCHEME_Marshalu(const TPMU_SIG_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4728 {
4729 TPM_RC rc = 0;
4730 switch (selector) {
4731 #ifdef TPM_ALG_RSASSA
4732 case TPM_ALG_RSASSA:
4733 if (rc == 0) {
4734 rc = TSS_TPMS_SIG_SCHEME_RSASSA_Marshalu(&source->rsassa, written, buffer, size);
4735 }
4736 break;
4737 #endif
4738 #ifdef TPM_ALG_RSAPSS
4739 case TPM_ALG_RSAPSS:
4740 if (rc == 0) {
4741 rc = TSS_TPMS_SIG_SCHEME_RSAPSS_Marshalu(&source->rsapss, written, buffer, size);
4742 }
4743 break;
4744 #endif
4745 #ifdef TPM_ALG_ECDSA
4746 case TPM_ALG_ECDSA:
4747 if (rc == 0) {
4748 rc = TSS_TPMS_SIG_SCHEME_ECDSA_Marshalu(&source->ecdsa, written, buffer, size);
4749 }
4750 break;
4751 #endif
4752 #ifdef TPM_ALG_ECDAA
4753 case TPM_ALG_ECDAA:
4754 if (rc == 0) {
4755 rc = TSS_TPMS_SIG_SCHEME_ECDAA_Marshalu(&source->ecdaa, written, buffer, size);
4756 }
4757 break;
4758 #endif
4759 #ifdef TPM_ALG_SM2
4760 case TPM_ALG_SM2:
4761 if (rc == 0) {
4762 rc = TSS_TPMS_SIG_SCHEME_SM2_Marshalu(&source->sm2, written, buffer, size);
4763 }
4764 break;
4765 #endif
4766 #ifdef TPM_ALG_ECSCHNORR
4767 case TPM_ALG_ECSCHNORR:
4768 if (rc == 0) {
4769 rc = TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshalu(&source->ecSchnorr, written, buffer, size);
4770 }
4771 break;
4772 #endif
4773 #ifdef TPM_ALG_HMAC
4774 case TPM_ALG_HMAC:
4775 if (rc == 0) {
4776 rc = TSS_TPMS_SCHEME_HMAC_Marshalu(&source->hmac, written, buffer, size);
4777 }
4778 break;
4779 #endif
4780 case TPM_ALG_NULL:
4781 break;
4782 default:
4783 rc = TPM_RC_SELECTOR;
4784 }
4785 return rc;
4786 }
4787
4788 /* Table 145 - Definition of TPMT_SIG_SCHEME Structure */
4789
4790 TPM_RC
TSS_TPMT_SIG_SCHEME_Marshalu(const TPMT_SIG_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4791 TSS_TPMT_SIG_SCHEME_Marshalu(const TPMT_SIG_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4792 {
4793 TPM_RC rc = 0;
4794 if (rc == 0) {
4795 rc = TSS_TPMI_ALG_SIG_SCHEME_Marshalu(&source->scheme, written, buffer, size);
4796 }
4797 if (rc == 0) {
4798 rc = TSS_TPMU_SIG_SCHEME_Marshalu(&source->details, written, buffer, size,source->scheme);
4799 }
4800 return rc;
4801 }
4802
4803 /* Table 146 - Definition of Types for {RSA} Encryption Schemes */
4804
4805 /* NOTE: Marked as const function in header */
4806
4807 TPM_RC
TSS_TPMS_ENC_SCHEME_OAEP_Marshalu(const TPMS_ENC_SCHEME_OAEP * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4808 TSS_TPMS_ENC_SCHEME_OAEP_Marshalu(const TPMS_ENC_SCHEME_OAEP *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4809 {
4810 TPM_RC rc = 0;
4811 if (rc == 0) {
4812 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4813 }
4814 return rc;
4815 }
4816
4817 /* Table 146 - Definition of Types for {RSA} Encryption Schemes */
4818
4819 /* NOTE: Marked as const function in header */
4820
4821 TPM_RC
TSS_TPMS_ENC_SCHEME_RSAES_Marshalu(const TPMS_ENC_SCHEME_RSAES * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4822 TSS_TPMS_ENC_SCHEME_RSAES_Marshalu(const TPMS_ENC_SCHEME_RSAES *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4823 {
4824 source = source;
4825 written = written;
4826 buffer = buffer;
4827 size = size;
4828 return 0;
4829 }
4830
4831 /* Table 147 - Definition of Types for {ECC} ECC Key Exchange */
4832
4833 TPM_RC
TSS_TPMS_KEY_SCHEME_ECDH_Marshalu(const TPMS_KEY_SCHEME_ECDH * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4834 TSS_TPMS_KEY_SCHEME_ECDH_Marshalu(const TPMS_KEY_SCHEME_ECDH *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4835 {
4836 TPM_RC rc = 0;
4837 if (rc == 0) {
4838 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4839 }
4840 return rc;
4841 }
4842 TPM_RC
TSS_TPMS_KEY_SCHEME_ECMQV_Marshalu(const TPMS_KEY_SCHEME_ECMQV * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4843 TSS_TPMS_KEY_SCHEME_ECMQV_Marshalu(const TPMS_KEY_SCHEME_ECMQV *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4844 {
4845 TPM_RC rc = 0;
4846 if (rc == 0) {
4847 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4848 }
4849 return rc;
4850 }
4851
4852 /* Table 148 - Definition of Types for KDF Schemes, hash-based key- or mask-generation functions */
4853
4854 TPM_RC
TSS_TPMS_SCHEME_MGF1_Marshalu(const TPMS_SCHEME_MGF1 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4855 TSS_TPMS_SCHEME_MGF1_Marshalu(const TPMS_SCHEME_MGF1 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4856 {
4857 TPM_RC rc = 0;
4858 if (rc == 0) {
4859 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4860 }
4861 return rc;
4862 }
4863 TPM_RC
TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshalu(const TPMS_SCHEME_KDF1_SP800_56A * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4864 TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshalu(const TPMS_SCHEME_KDF1_SP800_56A *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4865 {
4866 TPM_RC rc = 0;
4867 if (rc == 0) {
4868 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4869 }
4870 return rc;
4871 }
4872 TPM_RC
TSS_TPMS_SCHEME_KDF2_Marshalu(const TPMS_SCHEME_KDF2 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4873 TSS_TPMS_SCHEME_KDF2_Marshalu(const TPMS_SCHEME_KDF2 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4874 {
4875 TPM_RC rc = 0;
4876 if (rc == 0) {
4877 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4878 }
4879 return rc;
4880 }
4881 TPM_RC
TSS_TPMS_SCHEME_KDF1_SP800_108_Marshalu(const TPMS_SCHEME_KDF1_SP800_108 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4882 TSS_TPMS_SCHEME_KDF1_SP800_108_Marshalu(const TPMS_SCHEME_KDF1_SP800_108 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4883 {
4884 TPM_RC rc = 0;
4885 if (rc == 0) {
4886 rc = TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, size);
4887 }
4888 return rc;
4889 }
4890
4891 /* Table 149 - Definition of TPMU_KDF_SCHEME Union <IN/OUT, S> */
4892
4893 TPM_RC
TSS_TPMU_KDF_SCHEME_Marshalu(const TPMU_KDF_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4894 TSS_TPMU_KDF_SCHEME_Marshalu(const TPMU_KDF_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4895 {
4896 TPM_RC rc = 0;
4897 switch (selector) {
4898 #ifdef TPM_ALG_MGF1
4899 case TPM_ALG_MGF1:
4900 if (rc == 0) {
4901 rc = TSS_TPMS_SCHEME_MGF1_Marshalu(&source->mgf1, written, buffer, size);
4902 }
4903 break;
4904 #endif
4905 #ifdef TPM_ALG_KDF1_SP800_56A
4906 case TPM_ALG_KDF1_SP800_56A:
4907 if (rc == 0) {
4908 rc = TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshalu(&source->kdf1_SP800_56a, written, buffer, size);
4909 }
4910 break;
4911 #endif
4912 #ifdef TPM_ALG_KDF2
4913 case TPM_ALG_KDF2:
4914 if (rc == 0) {
4915 rc = TSS_TPMS_SCHEME_KDF2_Marshalu(&source->kdf2, written, buffer, size);
4916 }
4917 break;
4918 #endif
4919 #ifdef TPM_ALG_KDF1_SP800_108
4920 case TPM_ALG_KDF1_SP800_108:
4921 if (rc == 0) {
4922 rc = TSS_TPMS_SCHEME_KDF1_SP800_108_Marshalu(&source->kdf1_sp800_108, written, buffer, size);
4923 }
4924 break;
4925 #endif
4926 case TPM_ALG_NULL:
4927 break;
4928 default:
4929 rc = TPM_RC_SELECTOR;
4930 }
4931 return rc;
4932 }
4933 /* Table 150 - Definition of TPMT_KDF_SCHEME Structure */
4934
4935 TPM_RC
TSS_TPMT_KDF_SCHEME_Marshalu(const TPMT_KDF_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)4936 TSS_TPMT_KDF_SCHEME_Marshalu(const TPMT_KDF_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
4937 {
4938 TPM_RC rc = 0;
4939 if (rc == 0) {
4940 rc = TSS_TPMI_ALG_KDF_Marshalu(&source->scheme, written, buffer, size);
4941 }
4942 if (rc == 0) {
4943 rc = TSS_TPMU_KDF_SCHEME_Marshalu(&source->details, written, buffer, size, source->scheme);
4944 }
4945 return rc;
4946 }
4947
4948 /* Table 152 - Definition of TPMU_ASYM_SCHEME Union */
4949
4950 TPM_RC
TSS_TPMU_ASYM_SCHEME_Marshalu(const TPMU_ASYM_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)4951 TSS_TPMU_ASYM_SCHEME_Marshalu(const TPMU_ASYM_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
4952 {
4953 TPM_RC rc = 0;
4954 switch (selector) {
4955 #ifdef TPM_ALG_ECDH
4956 case TPM_ALG_ECDH:
4957 if (rc == 0) {
4958 rc = TSS_TPMS_KEY_SCHEME_ECDH_Marshalu(&source->ecdh, written, buffer, size);
4959 }
4960 break;
4961 #endif
4962 #ifdef TPM_ALG_ECMQV
4963 case TPM_ALG_ECMQV:
4964 if (rc == 0) {
4965 rc = TSS_TPMS_KEY_SCHEME_ECMQV_Marshalu(&source->ecmqvh, written, buffer, size);
4966 }
4967 break;
4968 #endif
4969 #ifdef TPM_ALG_RSASSA
4970 case TPM_ALG_RSASSA:
4971 if (rc == 0) {
4972 rc = TSS_TPMS_SIG_SCHEME_RSASSA_Marshalu(&source->rsassa, written, buffer, size);
4973 }
4974 break;
4975 #endif
4976 #ifdef TPM_ALG_RSAPSS
4977 case TPM_ALG_RSAPSS:
4978 if (rc == 0) {
4979 rc = TSS_TPMS_SIG_SCHEME_RSAPSS_Marshalu(&source->rsapss, written, buffer, size);
4980 }
4981 break;
4982 #endif
4983 #ifdef TPM_ALG_ECDSA
4984 case TPM_ALG_ECDSA:
4985 if (rc == 0) {
4986 rc = TSS_TPMS_SIG_SCHEME_ECDSA_Marshalu(&source->ecdsa, written, buffer, size);
4987 }
4988 break;
4989 #endif
4990 #ifdef TPM_ALG_ECDAA
4991 case TPM_ALG_ECDAA:
4992 if (rc == 0) {
4993 rc = TSS_TPMS_SIG_SCHEME_ECDAA_Marshalu(&source->ecdaa, written, buffer, size);
4994 }
4995 break;
4996 #endif
4997 #ifdef TPM_ALG_SM2
4998 case TPM_ALG_SM2:
4999 if (rc == 0) {
5000 rc = TSS_TPMS_SIG_SCHEME_SM2_Marshalu(&source->sm2, written, buffer, size);
5001 }
5002 break;
5003 #endif
5004 #ifdef TPM_ALG_ECSCHNORR
5005 case TPM_ALG_ECSCHNORR:
5006 if (rc == 0) {
5007 rc = TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshalu(&source->ecSchnorr, written, buffer, size);
5008 }
5009 break;
5010 #endif
5011 #ifdef TPM_ALG_RSAES
5012 case TPM_ALG_RSAES:
5013 if (rc == 0) {
5014 rc = TSS_TPMS_ENC_SCHEME_RSAES_Marshalu(&source->rsaes, written, buffer, size);
5015 }
5016 break;
5017 #endif
5018 #ifdef TPM_ALG_OAEP
5019 case TPM_ALG_OAEP:
5020 if (rc == 0) {
5021 rc = TSS_TPMS_ENC_SCHEME_OAEP_Marshalu(&source->oaep, written, buffer, size);
5022 }
5023 break;
5024 #endif
5025 case TPM_ALG_NULL:
5026 break;
5027 default:
5028 rc = TPM_RC_SELECTOR;
5029 }
5030 return rc;
5031 }
5032
5033 /* Table 154 - Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_SCHEME Type */
5034
5035 TPM_RC
TSS_TPMI_ALG_RSA_SCHEME_Marshalu(const TPMI_ALG_RSA_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5036 TSS_TPMI_ALG_RSA_SCHEME_Marshalu(const TPMI_ALG_RSA_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5037 {
5038 TPM_RC rc = 0;
5039 if (rc == 0) {
5040 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
5041 }
5042 return rc;
5043 }
5044
5045 /* Table 155 - Definition of {RSA} TPMT_RSA_SCHEME Structure */
5046
5047 TPM_RC
TSS_TPMT_RSA_SCHEME_Marshalu(const TPMT_RSA_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5048 TSS_TPMT_RSA_SCHEME_Marshalu(const TPMT_RSA_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5049 {
5050 TPM_RC rc = 0;
5051 if (rc == 0) {
5052 rc = TSS_TPMI_ALG_RSA_SCHEME_Marshalu(&source->scheme, written, buffer, size);
5053 }
5054 if (rc == 0) {
5055 rc = TSS_TPMU_ASYM_SCHEME_Marshalu(&source->details, written, buffer, size, source->scheme);
5056 }
5057 return rc;
5058 }
5059
5060 /* Table 156 - Definition of (TPM_ALG_ID) {RSA} TPMI_ALG_RSA_DECRYPT Type */
5061
5062 TPM_RC
TSS_TPMI_ALG_RSA_DECRYPT_Marshalu(const TPMI_ALG_RSA_DECRYPT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5063 TSS_TPMI_ALG_RSA_DECRYPT_Marshalu(const TPMI_ALG_RSA_DECRYPT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5064 {
5065 TPM_RC rc = 0;
5066 if (rc == 0) {
5067 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
5068 }
5069 return rc;
5070 }
5071
5072 /* Table 157 - Definition of {RSA} TPMT_RSA_DECRYPT Structure */
5073
5074 TPM_RC
TSS_TPMT_RSA_DECRYPT_Marshalu(const TPMT_RSA_DECRYPT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5075 TSS_TPMT_RSA_DECRYPT_Marshalu(const TPMT_RSA_DECRYPT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5076 {
5077 TPM_RC rc = 0;
5078 if (rc == 0) {
5079 rc = TSS_TPMI_ALG_RSA_DECRYPT_Marshalu(&source->scheme, written, buffer, size);
5080 }
5081 if (rc == 0) {
5082 rc = TSS_TPMU_ASYM_SCHEME_Marshalu(&source->details, written, buffer, size, source->scheme);
5083 }
5084 return rc;
5085 }
5086
5087 /* Table 158 - Definition of {RSA} TPM2B_PUBLIC_KEY_RSA Structure */
5088
5089 TPM_RC
TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(const TPM2B_PUBLIC_KEY_RSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5090 TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(const TPM2B_PUBLIC_KEY_RSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5091 {
5092 TPM_RC rc = 0;
5093 if (rc == 0) {
5094 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5095 }
5096 return rc;
5097 }
5098
5099 /* Table 159 - Definition of {RSA} (TPM_KEY_BITS) TPMI_RSA_KEY_BITS Type */
5100
5101 TPM_RC
TSS_TPMI_RSA_KEY_BITS_Marshalu(const TPMI_RSA_KEY_BITS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5102 TSS_TPMI_RSA_KEY_BITS_Marshalu(const TPMI_RSA_KEY_BITS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5103 {
5104 TPM_RC rc = 0;
5105 if (rc == 0) {
5106 rc = TSS_TPM_KEY_BITS_Marshalu(source, written, buffer, size);
5107 }
5108 return rc;
5109 }
5110
5111 /* Table 160 - Definition of {RSA} TPM2B_PRIVATE_KEY_RSA Structure */
5112
5113 TPM_RC
TSS_TPM2B_PRIVATE_KEY_RSA_Marshalu(const TPM2B_PRIVATE_KEY_RSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5114 TSS_TPM2B_PRIVATE_KEY_RSA_Marshalu(const TPM2B_PRIVATE_KEY_RSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5115 {
5116 TPM_RC rc = 0;
5117 if (rc == 0) {
5118 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5119 }
5120 return rc;
5121 }
5122
5123 /* Table 161 - Definition of {ECC} TPM2B_ECC_PARAMETER Structure */
5124
5125 TPM_RC
TSS_TPM2B_ECC_PARAMETER_Marshalu(const TPM2B_ECC_PARAMETER * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5126 TSS_TPM2B_ECC_PARAMETER_Marshalu(const TPM2B_ECC_PARAMETER *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5127 {
5128 TPM_RC rc = 0;
5129 if (rc == 0) {
5130 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5131 }
5132 return rc;
5133 }
5134
5135 /* Table 162 - Definition of {ECC} TPMS_ECC_POINT Structure */
5136
5137 TPM_RC
TSS_TPMS_ECC_POINT_Marshalu(const TPMS_ECC_POINT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5138 TSS_TPMS_ECC_POINT_Marshalu(const TPMS_ECC_POINT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5139 {
5140 TPM_RC rc = 0;
5141 if (rc == 0) {
5142 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->x, written, buffer, size);
5143 }
5144 if (rc == 0) {
5145 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->y, written, buffer, size);
5146 }
5147 return rc;
5148 }
5149
5150 /* Table 163 - Definition of {ECC} TPM2B_ECC_POINT Structure */
5151
5152 TPM_RC
TSS_TPM2B_ECC_POINT_Marshalu(const TPM2B_ECC_POINT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5153 TSS_TPM2B_ECC_POINT_Marshalu(const TPM2B_ECC_POINT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5154 {
5155 TPM_RC rc = 0;
5156 uint16_t sizeWritten = 0; /* of structure */
5157 BYTE *sizePtr;
5158
5159 if (buffer != NULL) {
5160 sizePtr = *buffer;
5161 *buffer += sizeof(uint16_t);
5162 }
5163 if (rc == 0) {
5164 rc = TSS_TPMS_ECC_POINT_Marshalu(&source->point, &sizeWritten, buffer, size);
5165 }
5166 if (rc == 0) {
5167 *written += sizeWritten;
5168 if (buffer != NULL) {
5169 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size);
5170 }
5171 else {
5172 *written += sizeof(uint16_t);
5173 }
5174 }
5175 return rc;
5176 }
5177
5178 /* Table 164 - Definition of (TPM_ALG_ID) {ECC} TPMI_ALG_ECC_SCHEME Type */
5179
5180 TPM_RC
TSS_TPMI_ALG_ECC_SCHEME_Marshalu(const TPMI_ALG_ECC_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5181 TSS_TPMI_ALG_ECC_SCHEME_Marshalu(const TPMI_ALG_ECC_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5182 {
5183 TPM_RC rc = 0;
5184 if (rc == 0) {
5185 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
5186 }
5187 return rc;
5188 }
5189
5190 /* Table 165 - Definition of {ECC} (TPM_ECC_CURVE) TPMI_ECC_CURVE Type */
5191
5192 TPM_RC
TSS_TPMI_ECC_CURVE_Marshalu(const TPMI_ECC_CURVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5193 TSS_TPMI_ECC_CURVE_Marshalu(const TPMI_ECC_CURVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5194 {
5195 TPM_RC rc = 0;
5196 if (rc == 0) {
5197 rc = TSS_TPM_ECC_CURVE_Marshalu(source, written, buffer, size);
5198 }
5199 return rc;
5200 }
5201
5202 /* Table 166 - Definition of (TPMT_SIG_SCHEME) {ECC} TPMT_ECC_SCHEME Structure */
5203
5204 TPM_RC
TSS_TPMT_ECC_SCHEME_Marshalu(const TPMT_ECC_SCHEME * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5205 TSS_TPMT_ECC_SCHEME_Marshalu(const TPMT_ECC_SCHEME *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5206 {
5207 TPM_RC rc = 0;
5208 if (rc == 0) {
5209 rc = TSS_TPMI_ALG_ECC_SCHEME_Marshalu(&source->scheme, written, buffer, size);
5210 }
5211 if (rc == 0) {
5212 rc = TSS_TPMU_ASYM_SCHEME_Marshalu(&source->details, written, buffer, size, source->scheme);
5213 }
5214 return rc;
5215 }
5216
5217 /* Table 167 - Definition of {ECC} TPMS_ALGORITHM_DETAIL_ECC Structure <OUT> */
5218
5219 TPM_RC
TSS_TPMS_ALGORITHM_DETAIL_ECC_Marshalu(const TPMS_ALGORITHM_DETAIL_ECC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5220 TSS_TPMS_ALGORITHM_DETAIL_ECC_Marshalu(const TPMS_ALGORITHM_DETAIL_ECC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5221 {
5222 TPM_RC rc = 0;
5223 if (rc == 0) {
5224 rc = TSS_TPM_ECC_CURVE_Marshalu(&source->curveID, written, buffer, size);
5225 }
5226 if (rc == 0) {
5227 rc = TSS_UINT16_Marshalu(&source->keySize, written, buffer, size);
5228 }
5229 if (rc == 0) {
5230 rc = TSS_TPMT_KDF_SCHEME_Marshalu(&source->kdf, written, buffer, size);
5231 }
5232 if (rc == 0) {
5233 rc = TSS_TPMT_ECC_SCHEME_Marshalu(&source->sign, written, buffer, size);
5234 }
5235 if (rc == 0) {
5236 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->p, written, buffer, size);
5237 }
5238 if (rc == 0) {
5239 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->a, written, buffer, size);
5240 }
5241 if (rc == 0) {
5242 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->b, written, buffer, size);
5243 }
5244 if (rc == 0) {
5245 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->gX, written, buffer, size);
5246 }
5247 if (rc == 0) {
5248 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->gY, written, buffer, size);
5249 }
5250 if (rc == 0) {
5251 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->n, written, buffer, size);
5252 }
5253 if (rc == 0) {
5254 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->h, written, buffer, size);
5255 }
5256 return rc;
5257 }
5258
5259 /* Table 168 - Definition of {RSA} TPMS_SIGNATURE_RSA Structure */
5260
5261 TPM_RC
TSS_TPMS_SIGNATURE_RSA_Marshalu(const TPMS_SIGNATURE_RSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5262 TSS_TPMS_SIGNATURE_RSA_Marshalu(const TPMS_SIGNATURE_RSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5263 {
5264 TPM_RC rc = 0;
5265 if (rc == 0) {
5266 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hash, written, buffer, size);
5267 }
5268 if (rc == 0) {
5269 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(&source->sig, written, buffer, size);
5270 }
5271 return rc;
5272 }
5273
5274 /* Table 169 - Definition of Types for {RSA} Signature */
5275
5276 TPM_RC
TSS_TPMS_SIGNATURE_RSASSA_Marshalu(const TPMS_SIGNATURE_RSASSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5277 TSS_TPMS_SIGNATURE_RSASSA_Marshalu(const TPMS_SIGNATURE_RSASSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5278 {
5279 TPM_RC rc = 0;
5280 if (rc == 0) {
5281 rc = TSS_TPMS_SIGNATURE_RSA_Marshalu(source, written, buffer, size);
5282 }
5283 return rc;
5284 }
5285 TPM_RC
TSS_TPMS_SIGNATURE_RSAPSS_Marshalu(const TPMS_SIGNATURE_RSAPSS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5286 TSS_TPMS_SIGNATURE_RSAPSS_Marshalu(const TPMS_SIGNATURE_RSAPSS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5287 {
5288 TPM_RC rc = 0;
5289 if (rc == 0) {
5290 rc = TSS_TPMS_SIGNATURE_RSA_Marshalu(source, written, buffer, size);
5291 }
5292 return rc;
5293 }
5294
5295 /* Table 170 - Definition of {ECC} TPMS_SIGNATURE_ECC Structure */
5296
5297 TPM_RC
TSS_TPMS_SIGNATURE_ECC_Marshalu(const TPMS_SIGNATURE_ECC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5298 TSS_TPMS_SIGNATURE_ECC_Marshalu(const TPMS_SIGNATURE_ECC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5299 {
5300 TPM_RC rc = 0;
5301 if (rc == 0) {
5302 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->hash, written, buffer, size);
5303 }
5304 if (rc == 0) {
5305 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->signatureR, written, buffer, size);
5306 }
5307 if (rc == 0) {
5308 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->signatureS, written, buffer, size);
5309 }
5310 return rc;
5311 }
5312
5313 /* Table 171 - Definition of Types for {ECC} TPMS_SIGNATURE_ECC */
5314
5315 TPM_RC
TSS_TPMS_SIGNATURE_ECDSA_Marshalu(const TPMS_SIGNATURE_ECDSA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5316 TSS_TPMS_SIGNATURE_ECDSA_Marshalu(const TPMS_SIGNATURE_ECDSA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5317 {
5318 TPM_RC rc = 0;
5319 if (rc == 0) {
5320 rc = TSS_TPMS_SIGNATURE_ECC_Marshalu(source, written, buffer, size);
5321 }
5322 return rc;
5323 }
5324
5325 TPM_RC
TSS_TPMS_SIGNATURE_ECDAA_Marshalu(const TPMS_SIGNATURE_ECDAA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5326 TSS_TPMS_SIGNATURE_ECDAA_Marshalu(const TPMS_SIGNATURE_ECDAA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5327 {
5328 TPM_RC rc = 0;
5329 if (rc == 0) {
5330 rc = TSS_TPMS_SIGNATURE_ECC_Marshalu(source, written, buffer, size);
5331 }
5332 return rc;
5333 }
5334
5335 TPM_RC
TSS_TPMS_SIGNATURE_SM2_Marshalu(const TPMS_SIGNATURE_SM2 * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5336 TSS_TPMS_SIGNATURE_SM2_Marshalu(const TPMS_SIGNATURE_SM2 *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5337 {
5338 TPM_RC rc = 0;
5339 if (rc == 0) {
5340 rc = TSS_TPMS_SIGNATURE_ECC_Marshalu(source, written, buffer, size);
5341 }
5342 return rc;
5343 }
5344
5345 TPM_RC
TSS_TPMS_SIGNATURE_ECSCHNORR_Marshalu(const TPMS_SIGNATURE_ECSCHNORR * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5346 TSS_TPMS_SIGNATURE_ECSCHNORR_Marshalu(const TPMS_SIGNATURE_ECSCHNORR *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5347 {
5348 TPM_RC rc = 0;
5349 if (rc == 0) {
5350 rc = TSS_TPMS_SIGNATURE_ECC_Marshalu(source, written, buffer, size);
5351 }
5352 return rc;
5353 }
5354
5355 /* Table 172 - Definition of TPMU_SIGNATURE Union <IN/OUT, S> */
5356
5357 TPM_RC
TSS_TPMU_SIGNATURE_Marshalu(const TPMU_SIGNATURE * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)5358 TSS_TPMU_SIGNATURE_Marshalu(const TPMU_SIGNATURE *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
5359 {
5360 TPM_RC rc = 0;
5361 switch (selector) {
5362 #ifdef TPM_ALG_RSASSA
5363 case TPM_ALG_RSASSA:
5364 if (rc == 0) {
5365 rc = TSS_TPMS_SIGNATURE_RSASSA_Marshalu(&source->rsassa, written, buffer, size);
5366 }
5367 break;
5368 #endif
5369 #ifdef TPM_ALG_RSAPSS
5370 case TPM_ALG_RSAPSS:
5371 if (rc == 0) {
5372 rc = TSS_TPMS_SIGNATURE_RSAPSS_Marshalu(&source->rsapss, written, buffer, size);
5373 }
5374 break;
5375 #endif
5376 #ifdef TPM_ALG_ECDSA
5377 case TPM_ALG_ECDSA:
5378 if (rc == 0) {
5379 rc = TSS_TPMS_SIGNATURE_ECDSA_Marshalu(&source->ecdsa, written, buffer, size);
5380 }
5381 break;
5382 #endif
5383 #ifdef TPM_ALG_ECDAA
5384 case TPM_ALG_ECDAA:
5385 if (rc == 0) {
5386 rc = TSS_TPMS_SIGNATURE_ECDSA_Marshalu(&source->ecdaa, written, buffer, size);
5387 }
5388 break;
5389 #endif
5390 #ifdef TPM_ALG_SM2
5391 case TPM_ALG_SM2:
5392 if (rc == 0) {
5393 rc = TSS_TPMS_SIGNATURE_ECDSA_Marshalu(&source->sm2, written, buffer, size);
5394 }
5395 break;
5396 #endif
5397 #ifdef TPM_ALG_ECSCHNORR
5398 case TPM_ALG_ECSCHNORR:
5399 if (rc == 0) {
5400 rc = TSS_TPMS_SIGNATURE_ECDSA_Marshalu(&source->ecschnorr, written, buffer, size);
5401 }
5402 break;
5403 #endif
5404 #ifdef TPM_ALG_HMAC
5405 case TPM_ALG_HMAC:
5406 if (rc == 0) {
5407 rc = TSS_TPMT_HA_Marshalu(&source->hmac, written, buffer, size);
5408 }
5409 break;
5410 #endif
5411 case TPM_ALG_NULL:
5412 break;
5413 default:
5414 rc = TPM_RC_SELECTOR;
5415 }
5416 return rc;
5417 }
5418
5419 /* Table 173 - Definition of TPMT_SIGNATURE Structure */
5420
5421 TPM_RC
TSS_TPMT_SIGNATURE_Marshalu(const TPMT_SIGNATURE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5422 TSS_TPMT_SIGNATURE_Marshalu(const TPMT_SIGNATURE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5423 {
5424 TPM_RC rc = 0;
5425 if (rc == 0) {
5426 rc = TSS_TPMI_ALG_SIG_SCHEME_Marshalu(&source->sigAlg, written, buffer, size);
5427 }
5428 if (rc == 0) {
5429 rc = TSS_TPMU_SIGNATURE_Marshalu(&source->signature, written, buffer, size, source->sigAlg);
5430 }
5431 return rc;
5432 }
5433
5434 /* Table 175 - Definition of TPM2B_ENCRYPTED_SECRET Structure */
5435
5436 TPM_RC
TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(const TPM2B_ENCRYPTED_SECRET * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5437 TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(const TPM2B_ENCRYPTED_SECRET *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5438 {
5439 TPM_RC rc = 0;
5440 if (rc == 0) {
5441 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5442 }
5443 return rc;
5444 }
5445
5446 /* Table 176 - Definition of (TPM_ALG_ID) TPMI_ALG_PUBLIC Type */
5447
5448 TPM_RC
TSS_TPMI_ALG_PUBLIC_Marshalu(const TPMI_ALG_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5449 TSS_TPMI_ALG_PUBLIC_Marshalu(const TPMI_ALG_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5450 {
5451 TPM_RC rc = 0;
5452 if (rc == 0) {
5453 rc = TSS_TPM_ALG_ID_Marshalu(source, written, buffer, size);
5454 }
5455 return rc;
5456 }
5457
5458 /* Table 177 - Definition of TPMU_PUBLIC_ID Union <IN/OUT, S> */
5459
5460 TPM_RC
TSS_TPMU_PUBLIC_ID_Marshalu(const TPMU_PUBLIC_ID * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)5461 TSS_TPMU_PUBLIC_ID_Marshalu(const TPMU_PUBLIC_ID *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
5462 {
5463 TPM_RC rc = 0;
5464 switch (selector) {
5465 #ifdef TPM_ALG_KEYEDHASH
5466 case TPM_ALG_KEYEDHASH:
5467 if (rc == 0) {
5468 rc = TSS_TPM2B_DIGEST_Marshalu(&source->keyedHash, written, buffer, size);
5469 }
5470 break;
5471 #endif
5472 #ifdef TPM_ALG_SYMCIPHER
5473 case TPM_ALG_SYMCIPHER:
5474 if (rc == 0) {
5475 rc = TSS_TPM2B_DIGEST_Marshalu(&source->sym, written, buffer, size);
5476 }
5477 break;
5478 #endif
5479 #ifdef TPM_ALG_RSA
5480 case TPM_ALG_RSA:
5481 if (rc == 0) {
5482 rc = TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(&source->rsa, written, buffer, size);
5483 }
5484 break;
5485 #endif
5486 #ifdef TPM_ALG_ECC
5487 case TPM_ALG_ECC:
5488 if (rc == 0) {
5489 rc = TSS_TPMS_ECC_POINT_Marshalu(&source->ecc, written, buffer, size);
5490 }
5491 break;
5492 #endif
5493 default:
5494 rc = TPM_RC_SELECTOR;
5495 }
5496 return rc;
5497 }
5498
5499 /* Table 178 - Definition of TPMS_KEYEDHASH_PARMS Structure */
5500
5501 TPM_RC
TSS_TPMS_KEYEDHASH_PARMS_Marshalu(const TPMS_KEYEDHASH_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5502 TSS_TPMS_KEYEDHASH_PARMS_Marshalu(const TPMS_KEYEDHASH_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5503 {
5504 TPM_RC rc = 0;
5505 if (rc == 0) {
5506 rc = TSS_TPMT_KEYEDHASH_SCHEME_Marshalu(&source->scheme, written, buffer, size);
5507 }
5508 return rc;
5509 }
5510
5511 /* Table 180 - Definition of {RSA} TPMS_RSA_PARMS Structure */
5512
5513 TPM_RC
TSS_TPMS_RSA_PARMS_Marshalu(const TPMS_RSA_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5514 TSS_TPMS_RSA_PARMS_Marshalu(const TPMS_RSA_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5515 {
5516 TPM_RC rc = 0;
5517 if (rc == 0) {
5518 rc = TSS_TPMT_SYM_DEF_OBJECT_Marshalu(&source->symmetric, written, buffer, size);
5519 }
5520 if (rc == 0) {
5521 rc = TSS_TPMT_RSA_SCHEME_Marshalu(&source->scheme, written, buffer, size);
5522 }
5523 if (rc == 0) {
5524 rc = TSS_TPMI_RSA_KEY_BITS_Marshalu(&source->keyBits, written, buffer, size);
5525 }
5526 if (rc == 0) {
5527 rc = TSS_UINT32_Marshalu(&source->exponent, written, buffer, size);
5528 }
5529 return rc;
5530 }
5531 /* Table 181 - Definition of {ECC} TPMS_ECC_PARMS Structure */
5532
5533 TPM_RC
TSS_TPMS_ECC_PARMS_Marshalu(const TPMS_ECC_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5534 TSS_TPMS_ECC_PARMS_Marshalu(const TPMS_ECC_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5535 {
5536 TPM_RC rc = 0;
5537 if (rc == 0) {
5538 rc = TSS_TPMT_SYM_DEF_OBJECT_Marshalu(&source->symmetric, written, buffer, size);
5539 }
5540 if (rc == 0) {
5541 rc = TSS_TPMT_ECC_SCHEME_Marshalu(&source->scheme, written, buffer, size);
5542 }
5543 if (rc == 0) {
5544 rc = TSS_TPMI_ECC_CURVE_Marshalu(&source->curveID, written, buffer, size);
5545 }
5546 if (rc == 0) {
5547 rc = TSS_TPMT_KDF_SCHEME_Marshalu(&source->kdf, written, buffer, size);
5548 }
5549 return rc;
5550 }
5551
5552 /* Table 182 - Definition of TPMU_PUBLIC_PARMS Union <IN/OUT, S> */
5553
5554 TPM_RC
TSS_TPMU_PUBLIC_PARMS_Marshalu(const TPMU_PUBLIC_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)5555 TSS_TPMU_PUBLIC_PARMS_Marshalu(const TPMU_PUBLIC_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
5556 {
5557 TPM_RC rc = 0;
5558 switch (selector) {
5559 #ifdef TPM_ALG_KEYEDHASH
5560 case TPM_ALG_KEYEDHASH:
5561 if (rc == 0) {
5562 rc = TSS_TPMS_KEYEDHASH_PARMS_Marshalu(&source->keyedHashDetail, written, buffer, size);
5563 }
5564 break;
5565 #endif
5566 #ifdef TPM_ALG_SYMCIPHER
5567 case TPM_ALG_SYMCIPHER:
5568 if (rc == 0) {
5569 rc = TSS_TPMS_SYMCIPHER_PARMS_Marshalu(&source->symDetail, written, buffer, size);
5570 }
5571 break;
5572 #endif
5573 #ifdef TPM_ALG_RSA
5574 case TPM_ALG_RSA:
5575 if (rc == 0) {
5576 rc = TSS_TPMS_RSA_PARMS_Marshalu(&source->rsaDetail, written, buffer, size);
5577 }
5578 break;
5579 #endif
5580 #ifdef TPM_ALG_ECC
5581 case TPM_ALG_ECC:
5582 if (rc == 0) {
5583 rc = TSS_TPMS_ECC_PARMS_Marshalu(&source->eccDetail, written, buffer, size);
5584 }
5585 break;
5586 #endif
5587 default:
5588 rc = TPM_RC_SELECTOR;
5589 }
5590 return rc;
5591 }
5592
5593 /* Table 183 - Definition of TPMT_PUBLIC_PARMS Structure */
5594
5595 TPM_RC
TSS_TPMT_PUBLIC_PARMS_Marshalu(const TPMT_PUBLIC_PARMS * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5596 TSS_TPMT_PUBLIC_PARMS_Marshalu(const TPMT_PUBLIC_PARMS *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5597 {
5598 TPM_RC rc = 0;
5599 if (rc == 0) {
5600 rc = TSS_TPMI_ALG_PUBLIC_Marshalu(&source->type, written, buffer, size);
5601 }
5602 if (rc == 0) {
5603 rc = TSS_TPMU_PUBLIC_PARMS_Marshalu(&source->parameters, written, buffer, size, source->type);
5604 }
5605 return rc;
5606 }
5607
5608 /* Table 184 - Definition of TPMT_PUBLIC Structure */
5609
5610 TPM_RC
TSS_TPMT_PUBLIC_Marshalu(const TPMT_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5611 TSS_TPMT_PUBLIC_Marshalu(const TPMT_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5612 {
5613 TPM_RC rc = 0;
5614 if (rc == 0) {
5615 rc = TSS_TPMI_ALG_PUBLIC_Marshalu(&source->type, written, buffer, size);
5616 }
5617 if (rc == 0) {
5618 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->nameAlg, written, buffer, size);
5619 }
5620 if (rc == 0) {
5621 rc = TSS_TPMA_OBJECT_Marshalu(&source->objectAttributes, written, buffer, size);
5622 }
5623 if (rc == 0) {
5624 rc = TSS_TPM2B_DIGEST_Marshalu(&source->authPolicy, written, buffer, size);
5625 }
5626 if (rc == 0) {
5627 rc = TSS_TPMU_PUBLIC_PARMS_Marshalu(&source->parameters, written, buffer, size, source->type);
5628 }
5629 if (rc == 0) {
5630 rc = TSS_TPMU_PUBLIC_ID_Marshalu(&source->unique, written, buffer, size, source->type);
5631 }
5632 return rc;
5633 }
5634
5635 /* Table 184 - Definition of TPMT_PUBLIC Structure - special marshaling for derived object template */
5636
5637 TPM_RC
TSS_TPMT_PUBLIC_D_Marshalu(const TPMT_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5638 TSS_TPMT_PUBLIC_D_Marshalu(const TPMT_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5639 {
5640 TPM_RC rc = 0;
5641 if (rc == 0) {
5642 rc = TSS_TPMI_ALG_PUBLIC_Marshalu(&source->type, written, buffer, size);
5643 }
5644 if (rc == 0) {
5645 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->nameAlg, written, buffer, size);
5646 }
5647 if (rc == 0) {
5648 rc = TSS_TPMA_OBJECT_Marshalu(&source->objectAttributes, written, buffer, size);
5649 }
5650 if (rc == 0) {
5651 rc = TSS_TPM2B_DIGEST_Marshalu(&source->authPolicy, written, buffer, size);
5652 }
5653 if (rc == 0) {
5654 rc = TSS_TPMU_PUBLIC_PARMS_Marshalu(&source->parameters, written, buffer, size, source->type);
5655 }
5656 /* if derived from a derivation parent, marshal a TPMS_DERIVE structure */
5657 if (rc == 0) {
5658 rc = TSS_TPMS_DERIVE_Marshalu(&source->unique.derive, written, buffer, size);
5659 }
5660 return rc;
5661 }
5662
5663 /* Table 185 - Definition of TPM2B_PUBLIC Structure */
5664
5665 TPM_RC
TSS_TPM2B_PUBLIC_Marshalu(const TPM2B_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5666 TSS_TPM2B_PUBLIC_Marshalu(const TPM2B_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5667 {
5668 TPM_RC rc = 0;
5669 uint16_t sizeWritten = 0; /* of structure */
5670 BYTE *sizePtr;
5671
5672 if (buffer != NULL) {
5673 sizePtr = *buffer;
5674 *buffer += sizeof(uint16_t);
5675 }
5676 if (rc == 0) {
5677 rc = TSS_TPMT_PUBLIC_Marshalu(&source->publicArea, &sizeWritten, buffer, size);
5678 }
5679 if (rc == 0) {
5680 *written += sizeWritten;
5681 if (buffer != NULL) {
5682 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size);
5683 }
5684 else {
5685 *written += sizeof(uint16_t);
5686 }
5687 }
5688 return rc;
5689 }
5690
5691 TPM_RC
TSS_TPM2B_TEMPLATE_Marshalu(const TPM2B_TEMPLATE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5692 TSS_TPM2B_TEMPLATE_Marshalu(const TPM2B_TEMPLATE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5693 {
5694 TPM_RC rc = 0;
5695 if (rc == 0) {
5696 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5697 }
5698 return rc;
5699 }
5700
5701 /* Table 187 - Definition of TPMU_SENSITIVE_COMPOSITE Union <IN/OUT, S> */
5702
5703 TPM_RC
TSS_TPMU_SENSITIVE_COMPOSITE_Marshalu(const TPMU_SENSITIVE_COMPOSITE * source,uint16_t * written,BYTE ** buffer,uint32_t * size,uint32_t selector)5704 TSS_TPMU_SENSITIVE_COMPOSITE_Marshalu(const TPMU_SENSITIVE_COMPOSITE *source, uint16_t *written, BYTE **buffer, uint32_t *size, uint32_t selector)
5705 {
5706 TPM_RC rc = 0;
5707 switch (selector) {
5708 #ifdef TPM_ALG_RSA
5709 case TPM_ALG_RSA:
5710 if (rc == 0) {
5711 rc = TSS_TPM2B_PRIVATE_KEY_RSA_Marshalu(&source->rsa, written, buffer, size);
5712 }
5713 break;
5714 #endif
5715 #ifdef TPM_ALG_ECC
5716 case TPM_ALG_ECC:
5717 if (rc == 0) {
5718 rc = TSS_TPM2B_ECC_PARAMETER_Marshalu(&source->ecc, written, buffer, size);
5719 }
5720 break;
5721 #endif
5722 #ifdef TPM_ALG_KEYEDHASH
5723 case TPM_ALG_KEYEDHASH:
5724 if (rc == 0) {
5725 rc = TSS_TPM2B_SENSITIVE_DATA_Marshalu(&source->bits, written, buffer, size);
5726 }
5727 break;
5728 #endif
5729 #ifdef TPM_ALG_SYMCIPHER
5730 case TPM_ALG_SYMCIPHER:
5731 if (rc == 0) {
5732 rc = TSS_TPM2B_SYM_KEY_Marshalu(&source->sym, written, buffer, size);
5733 }
5734 break;
5735 #endif
5736 default:
5737 rc = TPM_RC_SELECTOR;
5738 }
5739 return rc;
5740 }
5741
5742 /* Table 188 - Definition of TPMT_SENSITIVE Structure */
5743
5744 TPM_RC
TSS_TPMT_SENSITIVE_Marshalu(const TPMT_SENSITIVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5745 TSS_TPMT_SENSITIVE_Marshalu(const TPMT_SENSITIVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5746 {
5747 TPM_RC rc = 0;
5748 if (rc == 0) {
5749 rc = TSS_TPMI_ALG_PUBLIC_Marshalu(&source->sensitiveType, written, buffer, size);
5750 }
5751 if (rc == 0) {
5752 rc = TSS_TPM2B_AUTH_Marshalu(&source->authValue, written, buffer, size);
5753 }
5754 if (rc == 0) {
5755 rc = TSS_TPM2B_DIGEST_Marshalu(&source->seedValue, written, buffer, size);
5756 }
5757 if (rc == 0) {
5758 rc = TSS_TPMU_SENSITIVE_COMPOSITE_Marshalu(&source->sensitive, written, buffer, size, source->sensitiveType);
5759 }
5760 return rc;
5761 }
5762
5763 /* Table 189 - Definition of TPM2B_SENSITIVE Structure <IN/OUT> */
5764
5765 TPM_RC
TSS_TPM2B_SENSITIVE_Marshalu(const TPM2B_SENSITIVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5766 TSS_TPM2B_SENSITIVE_Marshalu(const TPM2B_SENSITIVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5767 {
5768 TPM_RC rc = 0;
5769 uint16_t sizeWritten = 0; /* of structure */
5770 BYTE *sizePtr;
5771
5772 if (buffer != NULL) {
5773 sizePtr = *buffer;
5774 *buffer += sizeof(uint16_t);
5775 }
5776 if (rc == 0) {
5777 rc = TSS_TPMT_SENSITIVE_Marshalu(&source->t.sensitiveArea, &sizeWritten, buffer, size);
5778 }
5779 if (rc == 0) {
5780 *written += sizeWritten;
5781 if (buffer != NULL) {
5782 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size);
5783 }
5784 else {
5785 *written += sizeof(uint16_t);
5786 }
5787 }
5788 return rc;
5789 }
5790
5791 /* Table 191 - Definition of TPM2B_PRIVATE Structure <IN/OUT, S> */
5792
5793 TPM_RC
TSS_TPM2B_PRIVATE_Marshalu(const TPM2B_PRIVATE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5794 TSS_TPM2B_PRIVATE_Marshalu(const TPM2B_PRIVATE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5795 {
5796 TPM_RC rc = 0;
5797 if (rc == 0) {
5798 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5799 }
5800 return rc;
5801 }
5802
5803 /* Table 193 - Definition of TPM2B_ID_OBJECT Structure <IN/OUT> */
5804
5805 TPM_RC
TSS_TPM2B_ID_OBJECT_Marshalu(const TPM2B_ID_OBJECT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5806 TSS_TPM2B_ID_OBJECT_Marshalu(const TPM2B_ID_OBJECT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5807 {
5808 TPM_RC rc = 0;
5809 if (rc == 0) {
5810 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5811 }
5812 return rc;
5813 }
5814
5815 /* Table 196 - Definition of (UINT32) TPMA_NV Bits */
5816
5817 TPM_RC
TSS_TPMA_NV_Marshalu(const TPMA_NV * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5818 TSS_TPMA_NV_Marshalu(const TPMA_NV *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5819 {
5820 TPM_RC rc = 0;
5821 if (rc == 0) {
5822 rc = TSS_UINT32_Marshalu(&source->val, written, buffer, size);
5823 }
5824 return rc;
5825 }
5826
5827 /* Table 197 - Definition of TPMS_NV_PUBLIC Structure */
5828
5829 TPM_RC
TSS_TPMS_NV_PUBLIC_Marshalu(const TPMS_NV_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5830 TSS_TPMS_NV_PUBLIC_Marshalu(const TPMS_NV_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5831 {
5832 TPM_RC rc = 0;
5833 if (rc == 0) {
5834 rc = TSS_TPMI_RH_NV_INDEX_Marshalu(&source->nvIndex, written, buffer, size);
5835 }
5836 if (rc == 0) {
5837 rc = TSS_TPMI_ALG_HASH_Marshalu(&source->nameAlg, written, buffer, size);
5838 }
5839 if (rc == 0) {
5840 rc = TSS_TPMA_NV_Marshalu(&source->attributes, written, buffer, size);
5841 }
5842 if (rc == 0) {
5843 rc = TSS_TPM2B_DIGEST_Marshalu(&source->authPolicy, written, buffer, size);
5844 }
5845 if (rc == 0) {
5846 rc = TSS_UINT16_Marshalu(&source->dataSize, written, buffer, size);
5847 }
5848 return rc;
5849 }
5850
5851 /* Table 198 - Definition of TPM2B_NV_PUBLIC Structure */
5852
5853 TPM_RC
TSS_TPM2B_NV_PUBLIC_Marshalu(const TPM2B_NV_PUBLIC * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5854 TSS_TPM2B_NV_PUBLIC_Marshalu(const TPM2B_NV_PUBLIC *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5855 {
5856 TPM_RC rc = 0;
5857 uint16_t sizeWritten = 0; /* of structure */
5858 BYTE *sizePtr;
5859
5860 if (buffer != NULL) {
5861 sizePtr = *buffer;
5862 *buffer += sizeof(uint16_t);
5863 }
5864 if (rc == 0) {
5865 rc = TSS_TPMS_NV_PUBLIC_Marshalu(&source->nvPublic, &sizeWritten, buffer, size);
5866 }
5867 if (rc == 0) {
5868 *written += sizeWritten;
5869 if (buffer != NULL) {
5870 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size);
5871 }
5872 else {
5873 *written += sizeof(uint16_t);
5874 }
5875 }
5876 return rc;
5877 }
5878
5879 /* Table 199 - Definition of TPM2B_CONTEXT_SENSITIVE Structure <IN/OUT> */
5880
5881 TPM_RC
TSS_TPM2B_CONTEXT_SENSITIVE_Marshalu(const TPM2B_CONTEXT_SENSITIVE * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5882 TSS_TPM2B_CONTEXT_SENSITIVE_Marshalu(const TPM2B_CONTEXT_SENSITIVE *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5883 {
5884 TPM_RC rc = 0;
5885 if (rc == 0) {
5886 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5887 }
5888 return rc;
5889 }
5890
5891 /* Table 201 - Definition of TPM2B_CONTEXT_DATA Structure <IN/OUT> */
5892
5893 TPM_RC
TSS_TPM2B_CONTEXT_DATA_Marshalu(const TPM2B_CONTEXT_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5894 TSS_TPM2B_CONTEXT_DATA_Marshalu(const TPM2B_CONTEXT_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5895 {
5896 TPM_RC rc = 0;
5897 if (rc == 0) {
5898 rc = TSS_TPM2B_Marshalu(&source->b, written, buffer, size);
5899 }
5900 return rc;
5901 }
5902
5903 /* Table 202 - Definition of TPMS_CONTEXT Structure */
5904
5905 TPM_RC
TSS_TPMS_CONTEXT_Marshalu(const TPMS_CONTEXT * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5906 TSS_TPMS_CONTEXT_Marshalu(const TPMS_CONTEXT *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5907 {
5908 TPM_RC rc = 0;
5909 if (rc == 0) {
5910 rc = TSS_UINT64_Marshalu(&source->sequence, written, buffer, size);
5911 }
5912 if (rc == 0) {
5913 rc = TSS_TPMI_DH_SAVED_Marshalu(&source->savedHandle, written, buffer, size);
5914 }
5915 if (rc == 0) {
5916 rc = TSS_TPMI_RH_HIERARCHY_Marshalu(&source->hierarchy, written, buffer, size);
5917 }
5918 if (rc == 0) {
5919 rc = TSS_TPM2B_CONTEXT_DATA_Marshalu(&source->contextBlob, written, buffer, size);
5920 }
5921 return rc;
5922 }
5923
5924 /* Table 204 - Definition of TPMS_CREATION_DATA Structure <OUT> */
5925
5926 TPM_RC
TSS_TPMS_CREATION_DATA_Marshalu(const TPMS_CREATION_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5927 TSS_TPMS_CREATION_DATA_Marshalu(const TPMS_CREATION_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5928 {
5929 TPM_RC rc = 0;
5930 if (rc == 0) {
5931 rc = TSS_TPML_PCR_SELECTION_Marshalu(&source->pcrSelect, written, buffer, size);
5932 }
5933 if (rc == 0) {
5934 rc = TSS_TPM2B_DIGEST_Marshalu(&source->pcrDigest, written, buffer, size);
5935 }
5936 if (rc == 0) {
5937 rc = TSS_TPMA_LOCALITY_Marshalu(&source->locality, written, buffer, size);
5938 }
5939 if (rc == 0) {
5940 rc = TSS_TPM_ALG_ID_Marshalu(&source->parentNameAlg, written, buffer, size);
5941 }
5942 if (rc == 0) {
5943 rc = TSS_TPM2B_NAME_Marshalu(&source->parentName, written, buffer, size);
5944 }
5945 if (rc == 0) {
5946 rc = TSS_TPM2B_NAME_Marshalu(&source->parentQualifiedName, written, buffer, size);
5947 }
5948 if (rc == 0) {
5949 rc = TSS_TPM2B_DATA_Marshalu(&source->outsideInfo, written, buffer, size);
5950 }
5951 return rc;
5952 }
5953
5954 /* Table 205 - Definition of TPM2B_CREATION_DATA Structure <OUT> */
5955
5956 TPM_RC
TSS_TPM2B_CREATION_DATA_Marshalu(const TPM2B_CREATION_DATA * source,uint16_t * written,BYTE ** buffer,uint32_t * size)5957 TSS_TPM2B_CREATION_DATA_Marshalu(const TPM2B_CREATION_DATA *source, uint16_t *written, BYTE **buffer, uint32_t *size)
5958 {
5959 TPM_RC rc = 0;
5960 uint16_t sizeWritten = 0; /* of structure */
5961 BYTE *sizePtr;
5962
5963 if (buffer != NULL) {
5964 sizePtr = *buffer;
5965 *buffer += sizeof(uint16_t);
5966 }
5967 if (rc == 0) {
5968 rc = TSS_TPMS_CREATION_DATA_Marshalu(&source->creationData, &sizeWritten, buffer, size);
5969 }
5970 if (rc == 0) {
5971 *written += sizeWritten;
5972 if (buffer != NULL) {
5973 rc = TSS_UINT16_Marshalu(&sizeWritten, written, &sizePtr, size);
5974 }
5975 else {
5976 *written += sizeof(uint16_t);
5977 }
5978 }
5979 return rc;
5980 }
5981
5982 #ifndef TPM_TSS_NODEPRECATED
5983
5984 /* Deprecated functions that use a sized value for the size parameter. The recommended functions
5985 use an unsigned value.
5986
5987 */
5988
5989 TPM_RC
TSS_UINT8_Marshal(const UINT8 * source,uint16_t * written,BYTE ** buffer,int32_t * size)5990 TSS_UINT8_Marshal(const UINT8 *source, uint16_t *written, BYTE **buffer, int32_t *size)
5991 {
5992 return TSS_UINT8_Marshalu(source, written, buffer, (uint32_t *)size);
5993 }
5994 TPM_RC
TSS_INT8_Marshal(const INT8 * source,uint16_t * written,BYTE ** buffer,int32_t * size)5995 TSS_INT8_Marshal(const INT8 *source, uint16_t *written, BYTE **buffer, int32_t *size)
5996 {
5997 return TSS_INT8_Marshalu(source, written, buffer, (uint32_t *)size);
5998 }
5999 TPM_RC
TSS_UINT16_Marshal(const UINT16 * source,uint16_t * written,BYTE ** buffer,int32_t * size)6000 TSS_UINT16_Marshal(const UINT16 *source, uint16_t *written, BYTE **buffer, int32_t *size)
6001 {
6002 return TSS_UINT16_Marshalu(source, written, buffer, (uint32_t *)size);
6003 }
6004 TPM_RC
TSS_UINT32_Marshal(const UINT32 * source,uint16_t * written,BYTE ** buffer,int32_t * size)6005 TSS_UINT32_Marshal(const UINT32 *source, uint16_t *written, BYTE **buffer, int32_t *size)
6006 {
6007 return TSS_UINT32_Marshalu(source, written, buffer, (uint32_t *)size);
6008 }
6009 TPM_RC
TSS_INT32_Marshal(const INT32 * source,uint16_t * written,BYTE ** buffer,int32_t * size)6010 TSS_INT32_Marshal(const INT32 *source, uint16_t *written, BYTE **buffer, int32_t *size)
6011 {
6012 return TSS_INT32_Marshalu(source, written, buffer, (uint32_t *)size);
6013 }
6014 TPM_RC
TSS_UINT64_Marshal(const UINT64 * source,uint16_t * written,BYTE ** buffer,int32_t * size)6015 TSS_UINT64_Marshal(const UINT64 *source, uint16_t *written, BYTE **buffer, int32_t *size)
6016 {
6017 return TSS_UINT64_Marshalu(source, written, buffer, (uint32_t *)size);
6018 }
6019 TPM_RC
TSS_Array_Marshal(const BYTE * source,uint16_t sourceSize,uint16_t * written,BYTE ** buffer,int32_t * size)6020 TSS_Array_Marshal(const BYTE *source, uint16_t sourceSize, uint16_t *written, BYTE **buffer, int32_t *size)
6021 {
6022 return TSS_Array_Marshalu(source, sourceSize, written, buffer, (uint32_t *)size);
6023 }
6024 TPM_RC
TSS_TPM2B_Marshal(const TPM2B * source,UINT16 * written,BYTE ** buffer,INT32 * size)6025 TSS_TPM2B_Marshal(const TPM2B *source, UINT16 *written, BYTE **buffer, INT32 *size)
6026 {
6027 return TSS_TPM2B_Marshalu(source, written, buffer, (uint32_t *)size);
6028 }
6029 TPM_RC
TSS_TPM_KEY_BITS_Marshal(const TPM_KEY_BITS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6030 TSS_TPM_KEY_BITS_Marshal(const TPM_KEY_BITS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6031 {
6032 return TSS_TPM_KEY_BITS_Marshalu(source, written, buffer, (uint32_t *)size);
6033 }
6034 TPM_RC
TSS_TPM_GENERATED_Marshal(const TPM_GENERATED * source,UINT16 * written,BYTE ** buffer,INT32 * size)6035 TSS_TPM_GENERATED_Marshal(const TPM_GENERATED *source, UINT16 *written, BYTE **buffer, INT32 *size)
6036 {
6037 return TSS_TPM_GENERATED_Marshalu(source, written, buffer, (uint32_t *)size);
6038 }
6039 TPM_RC
TSS_TPM_ALG_ID_Marshal(const TPM_ALG_ID * source,UINT16 * written,BYTE ** buffer,INT32 * size)6040 TSS_TPM_ALG_ID_Marshal(const TPM_ALG_ID *source, UINT16 *written, BYTE **buffer, INT32 *size)
6041 {
6042 return TSS_TPM_ALG_ID_Marshalu(source, written, buffer, (uint32_t *)size);
6043 }
6044 TPM_RC
TSS_TPM_ECC_CURVE_Marshal(const TPM_ECC_CURVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6045 TSS_TPM_ECC_CURVE_Marshal(const TPM_ECC_CURVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6046 {
6047 return TSS_TPM_ECC_CURVE_Marshalu(source, written, buffer, (uint32_t *)size);
6048 }
6049 TPM_RC
TSS_TPM_RC_Marshal(const TPM_RC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6050 TSS_TPM_RC_Marshal(const TPM_RC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6051 {
6052 return TSS_TPM_RC_Marshalu(source, written, buffer, (uint32_t *)size);
6053 }
6054 TPM_RC
TSS_TPM_CLOCK_ADJUST_Marshal(const TPM_CLOCK_ADJUST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6055 TSS_TPM_CLOCK_ADJUST_Marshal(const TPM_CLOCK_ADJUST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6056 {
6057 return TSS_TPM_CLOCK_ADJUST_Marshalu(source, written, buffer, (uint32_t *)size);
6058 }
6059 TPM_RC
TSS_TPM_EO_Marshal(const TPM_EO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6060 TSS_TPM_EO_Marshal(const TPM_EO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6061 {
6062 return TSS_TPM_EO_Marshalu(source, written, buffer, (uint32_t *)size);
6063 }
6064 TPM_RC
TSS_TPM_ST_Marshal(const TPM_ST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6065 TSS_TPM_ST_Marshal(const TPM_ST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6066 {
6067 return TSS_TPM_ST_Marshalu(source, written, buffer, (uint32_t *)size);
6068 }
6069 TPM_RC
TSS_TPM_SU_Marshal(const TPM_ST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6070 TSS_TPM_SU_Marshal(const TPM_ST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6071 {
6072 return TSS_TPM_SU_Marshalu(source, written, buffer, (uint32_t *)size);
6073 }
6074 TPM_RC
TSS_TPM_SE_Marshal(const TPM_SE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6075 TSS_TPM_SE_Marshal(const TPM_SE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6076 {
6077 return TSS_TPM_SE_Marshalu(source, written, buffer, (uint32_t *)size);
6078 }
6079 TPM_RC
TSS_TPM_CAP_Marshal(const TPM_CAP * source,UINT16 * written,BYTE ** buffer,INT32 * size)6080 TSS_TPM_CAP_Marshal(const TPM_CAP *source, UINT16 *written, BYTE **buffer, INT32 *size)
6081 {
6082 return TSS_TPM_CAP_Marshalu(source, written, buffer, (uint32_t *)size);
6083 }
6084 TPM_RC
TSS_TPM_PT_Marshal(const TPM_PT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6085 TSS_TPM_PT_Marshal(const TPM_PT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6086 {
6087 return TSS_TPM_PT_Marshalu(source, written, buffer, (uint32_t *)size);
6088 }
6089 TPM_RC
TSS_TPM_PT_PCR_Marshal(const TPM_PT_PCR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6090 TSS_TPM_PT_PCR_Marshal(const TPM_PT_PCR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6091 {
6092 return TSS_TPM_PT_PCR_Marshalu(source, written, buffer, (uint32_t *)size);
6093 }
6094 TPM_RC
TSS_TPM_HANDLE_Marshal(const TPM_HANDLE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6095 TSS_TPM_HANDLE_Marshal(const TPM_HANDLE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6096 {
6097 return TSS_TPM_HANDLE_Marshalu(source, written, buffer, (uint32_t *)size);
6098 }
6099 TPM_RC
TSS_TPMA_ALGORITHM_Marshal(const TPMA_ALGORITHM * source,UINT16 * written,BYTE ** buffer,INT32 * size)6100 TSS_TPMA_ALGORITHM_Marshal(const TPMA_ALGORITHM *source, UINT16 *written, BYTE **buffer, INT32 *size)
6101 {
6102 return TSS_TPMA_ALGORITHM_Marshalu(source, written, buffer, (uint32_t *)size);
6103 }
6104 TPM_RC
TSS_TPMA_OBJECT_Marshal(const TPMA_OBJECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6105 TSS_TPMA_OBJECT_Marshal(const TPMA_OBJECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6106 {
6107 return TSS_TPMA_OBJECT_Marshalu(source, written, buffer, (uint32_t *)size);
6108 }
6109 TPM_RC
TSS_TPMA_SESSION_Marshal(const TPMA_SESSION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6110 TSS_TPMA_SESSION_Marshal(const TPMA_SESSION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6111 {
6112 return TSS_TPMA_SESSION_Marshalu(source, written, buffer, (uint32_t *)size);
6113 }
6114 TPM_RC
TSS_TPMA_LOCALITY_Marshal(const TPMA_LOCALITY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6115 TSS_TPMA_LOCALITY_Marshal(const TPMA_LOCALITY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6116 {
6117 return TSS_TPMA_LOCALITY_Marshalu(source, written, buffer, (uint32_t *)size);
6118 }
6119 TPM_RC
TSS_TPM_CC_Marshal(const TPM_CC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6120 TSS_TPM_CC_Marshal(const TPM_CC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6121 {
6122 return TSS_TPM_CC_Marshalu(source, written, buffer, (uint32_t *)size);
6123 }
6124 TPM_RC
TSS_TPMA_CC_Marshal(const TPMA_CC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6125 TSS_TPMA_CC_Marshal(const TPMA_CC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6126 {
6127 return TSS_TPMA_CC_Marshalu(source, written, buffer, (uint32_t *)size);
6128 }
6129 TPM_RC
TSS_TPMI_YES_NO_Marshal(const TPMI_YES_NO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6130 TSS_TPMI_YES_NO_Marshal(const TPMI_YES_NO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6131 {
6132 return TSS_TPMI_YES_NO_Marshalu(source, written, buffer, (uint32_t *)size);
6133 }
6134 TPM_RC
TSS_TPMI_DH_OBJECT_Marshal(const TPMI_DH_OBJECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6135 TSS_TPMI_DH_OBJECT_Marshal(const TPMI_DH_OBJECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6136 {
6137 return TSS_TPMI_DH_OBJECT_Marshalu(source, written, buffer, (uint32_t *)size);
6138 }
6139 TPM_RC
TSS_TPMI_DH_PERSISTENT_Marshal(const TPMI_DH_PERSISTENT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6140 TSS_TPMI_DH_PERSISTENT_Marshal(const TPMI_DH_PERSISTENT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6141 {
6142 return TSS_TPMI_DH_PERSISTENT_Marshalu(source, written, buffer, (uint32_t *)size);
6143 }
6144 TPM_RC
TSS_TPMI_DH_ENTITY_Marshal(const TPMI_DH_ENTITY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6145 TSS_TPMI_DH_ENTITY_Marshal(const TPMI_DH_ENTITY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6146 {
6147 return TSS_TPMI_DH_ENTITY_Marshalu(source, written, buffer, (uint32_t *)size);
6148 }
6149 TPM_RC
TSS_TPMI_DH_PCR_Marshal(const TPMI_DH_PCR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6150 TSS_TPMI_DH_PCR_Marshal(const TPMI_DH_PCR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6151 {
6152 return TSS_TPMI_DH_PCR_Marshalu(source, written, buffer, (uint32_t *)size);
6153 }
6154 TPM_RC
TSS_TPMI_SH_AUTH_SESSION_Marshal(const TPMI_SH_AUTH_SESSION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6155 TSS_TPMI_SH_AUTH_SESSION_Marshal(const TPMI_SH_AUTH_SESSION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6156 {
6157 return TSS_TPMI_SH_AUTH_SESSION_Marshalu(source, written, buffer, (uint32_t *)size);
6158 }
6159 TPM_RC
TSS_TPMI_SH_HMAC_Marshal(const TPMI_SH_HMAC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6160 TSS_TPMI_SH_HMAC_Marshal(const TPMI_SH_HMAC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6161 {
6162 return TSS_TPMI_SH_HMAC_Marshalu(source, written, buffer, (uint32_t *)size);
6163 }
6164 TPM_RC
TSS_TPMI_SH_POLICY_Marshal(const TPMI_SH_POLICY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6165 TSS_TPMI_SH_POLICY_Marshal(const TPMI_SH_POLICY*source, UINT16 *written, BYTE **buffer, INT32 *size)
6166 {
6167 return TSS_TPMI_SH_POLICY_Marshalu(source, written, buffer, (uint32_t *)size);
6168 }
6169 TPM_RC
TSS_TPMI_DH_CONTEXT_Marshal(const TPMI_DH_CONTEXT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6170 TSS_TPMI_DH_CONTEXT_Marshal(const TPMI_DH_CONTEXT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6171 {
6172 return TSS_TPMI_DH_CONTEXT_Marshalu(source, written, buffer, (uint32_t *)size);
6173 }
6174 TPM_RC
TSS_TPMI_RH_HIERARCHY_Marshal(const TPMI_RH_HIERARCHY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6175 TSS_TPMI_RH_HIERARCHY_Marshal(const TPMI_RH_HIERARCHY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6176 {
6177 return TSS_TPMI_RH_HIERARCHY_Marshalu(source, written, buffer, (uint32_t *)size);
6178 }
6179 TPM_RC
TSS_TPMI_RH_ENABLES_Marshal(const TPMI_RH_ENABLES * source,UINT16 * written,BYTE ** buffer,INT32 * size)6180 TSS_TPMI_RH_ENABLES_Marshal(const TPMI_RH_ENABLES *source, UINT16 *written, BYTE **buffer, INT32 *size)
6181 {
6182 return TSS_TPMI_RH_ENABLES_Marshalu(source, written, buffer, (uint32_t *)size);
6183 }
6184 TPM_RC
TSS_TPMI_RH_HIERARCHY_AUTH_Marshal(const TPMI_RH_HIERARCHY_AUTH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6185 TSS_TPMI_RH_HIERARCHY_AUTH_Marshal(const TPMI_RH_HIERARCHY_AUTH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6186 {
6187 return TSS_TPMI_RH_HIERARCHY_AUTH_Marshalu(source, written, buffer, (uint32_t *)size);
6188 }
6189 TPM_RC
TSS_TPMI_RH_PLATFORM_Marshal(const TPMI_RH_PLATFORM * source,UINT16 * written,BYTE ** buffer,INT32 * size)6190 TSS_TPMI_RH_PLATFORM_Marshal(const TPMI_RH_PLATFORM *source, UINT16 *written, BYTE **buffer, INT32 *size)
6191 {
6192 return TSS_TPMI_RH_PLATFORM_Marshalu(source, written, buffer, (uint32_t *)size);
6193 }
6194 TPM_RC
TSS_TPMI_RH_ENDORSEMENT_Marshal(const TPMI_RH_ENDORSEMENT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6195 TSS_TPMI_RH_ENDORSEMENT_Marshal(const TPMI_RH_ENDORSEMENT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6196 {
6197 return TSS_TPMI_RH_ENDORSEMENT_Marshalu(source, written, buffer, (uint32_t *)size);
6198 }
6199 TPM_RC
TSS_TPMI_RH_PROVISION_Marshal(const TPMI_RH_PROVISION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6200 TSS_TPMI_RH_PROVISION_Marshal(const TPMI_RH_PROVISION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6201 {
6202 return TSS_TPMI_RH_PROVISION_Marshalu(source, written, buffer, (uint32_t *)size);
6203 }
6204 TPM_RC
TSS_TPMI_RH_CLEAR_Marshal(const TPMI_RH_CLEAR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6205 TSS_TPMI_RH_CLEAR_Marshal(const TPMI_RH_CLEAR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6206 {
6207 return TSS_TPMI_RH_CLEAR_Marshalu(source, written, buffer, (uint32_t *)size);
6208 }
6209 TPM_RC
TSS_TPMI_RH_NV_AUTH_Marshal(const TPMI_RH_NV_AUTH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6210 TSS_TPMI_RH_NV_AUTH_Marshal(const TPMI_RH_NV_AUTH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6211 {
6212 return TSS_TPMI_RH_NV_AUTH_Marshalu(source, written, buffer, (uint32_t *)size);
6213 }
6214 TPM_RC
TSS_TPMI_RH_LOCKOUT_Marshal(const TPMI_RH_LOCKOUT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6215 TSS_TPMI_RH_LOCKOUT_Marshal(const TPMI_RH_LOCKOUT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6216 {
6217 return TSS_TPMI_RH_LOCKOUT_Marshalu(source, written, buffer, (uint32_t *)size);
6218 }
6219 TPM_RC
TSS_TPMI_RH_NV_INDEX_Marshal(const TPMI_RH_NV_INDEX * source,UINT16 * written,BYTE ** buffer,INT32 * size)6220 TSS_TPMI_RH_NV_INDEX_Marshal(const TPMI_RH_NV_INDEX *source, UINT16 *written, BYTE **buffer, INT32 *size)
6221 {
6222 return TSS_TPMI_RH_NV_INDEX_Marshalu(source, written, buffer, (uint32_t *)size);
6223 }
6224 TPM_RC
TSS_TPMI_ALG_HASH_Marshal(const TPMI_ALG_HASH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6225 TSS_TPMI_ALG_HASH_Marshal(const TPMI_ALG_HASH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6226 {
6227 return TSS_TPMI_ALG_HASH_Marshalu(source, written, buffer, (uint32_t *)size);
6228 }
6229 TPM_RC
TSS_TPMI_ALG_SYM_Marshal(const TPMI_ALG_SYM * source,UINT16 * written,BYTE ** buffer,INT32 * size)6230 TSS_TPMI_ALG_SYM_Marshal(const TPMI_ALG_SYM *source, UINT16 *written, BYTE **buffer, INT32 *size)
6231 {
6232 return TSS_TPMI_ALG_SYM_Marshalu(source, written, buffer, (uint32_t *)size);
6233 }
6234 TPM_RC
TSS_TPMI_ALG_SYM_OBJECT_Marshal(const TPMI_ALG_SYM_OBJECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6235 TSS_TPMI_ALG_SYM_OBJECT_Marshal(const TPMI_ALG_SYM_OBJECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6236 {
6237 return TSS_TPMI_ALG_SYM_OBJECT_Marshalu(source, written, buffer, (uint32_t *)size);
6238 }
6239 TPM_RC
TSS_TPMI_ALG_SYM_MODE_Marshal(const TPMI_ALG_SYM_MODE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6240 TSS_TPMI_ALG_SYM_MODE_Marshal(const TPMI_ALG_SYM_MODE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6241 {
6242 return TSS_TPMI_ALG_SYM_MODE_Marshalu(source, written, buffer, (uint32_t *)size);
6243 }
6244 TPM_RC
TSS_TPMI_ALG_KDF_Marshal(const TPMI_ALG_KDF * source,UINT16 * written,BYTE ** buffer,INT32 * size)6245 TSS_TPMI_ALG_KDF_Marshal(const TPMI_ALG_KDF *source, UINT16 *written, BYTE **buffer, INT32 *size)
6246 {
6247 return TSS_TPMI_ALG_KDF_Marshalu(source, written, buffer, (uint32_t *)size);
6248 }
6249 TPM_RC
TSS_TPMI_ALG_SIG_SCHEME_Marshal(const TPMI_ALG_SIG_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6250 TSS_TPMI_ALG_SIG_SCHEME_Marshal(const TPMI_ALG_SIG_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6251 {
6252 return TSS_TPMI_ALG_SIG_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6253 }
6254 TPM_RC
TSS_TPMI_ECC_KEY_EXCHANGE_Marshal(const TPMI_ECC_KEY_EXCHANGE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6255 TSS_TPMI_ECC_KEY_EXCHANGE_Marshal(const TPMI_ECC_KEY_EXCHANGE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6256 {
6257 return TSS_TPMI_ECC_KEY_EXCHANGE_Marshalu(source, written, buffer, (uint32_t *)size);
6258 }
6259 TPM_RC
TSS_TPMI_ST_COMMAND_TAG_Marshal(const TPMI_ST_COMMAND_TAG * source,UINT16 * written,BYTE ** buffer,INT32 * size)6260 TSS_TPMI_ST_COMMAND_TAG_Marshal(const TPMI_ST_COMMAND_TAG *source, UINT16 *written, BYTE **buffer, INT32 *size)
6261 {
6262 return TSS_TPMI_ST_COMMAND_TAG_Marshalu(source, written, buffer, (uint32_t *)size);
6263 }
6264 TPM_RC
TSS_TPMI_ALG_MAC_SCHEME_Marshal(const TPMI_ALG_MAC_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6265 TSS_TPMI_ALG_MAC_SCHEME_Marshal(const TPMI_ALG_MAC_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6266 {
6267 return TSS_TPMI_ALG_MAC_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6268 }
6269 TPM_RC
TSS_TPMI_ALG_CIPHER_MODE_Marshal(const TPMI_ALG_CIPHER_MODE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6270 TSS_TPMI_ALG_CIPHER_MODE_Marshal(const TPMI_ALG_CIPHER_MODE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6271 {
6272 return TSS_TPMI_ALG_CIPHER_MODE_Marshalu(source, written, buffer, (uint32_t *)size);
6273 }
6274 TPM_RC
TSS_TPMU_HA_Marshal(const TPMU_HA * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6275 TSS_TPMU_HA_Marshal(const TPMU_HA *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6276 {
6277 return TSS_TPMU_HA_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6278 }
6279 TPM_RC
TSS_TPMT_HA_Marshal(const TPMT_HA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6280 TSS_TPMT_HA_Marshal(const TPMT_HA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6281 {
6282 return TSS_TPMT_HA_Marshalu(source, written, buffer, (uint32_t *)size);
6283 }
6284 TPM_RC
TSS_TPM2B_DIGEST_Marshal(const TPM2B_DIGEST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6285 TSS_TPM2B_DIGEST_Marshal(const TPM2B_DIGEST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6286 {
6287 return TSS_TPM2B_DIGEST_Marshalu(source, written, buffer, (uint32_t *)size);
6288 }
6289 TPM_RC
TSS_TPM2B_DATA_Marshal(const TPM2B_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6290 TSS_TPM2B_DATA_Marshal(const TPM2B_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6291 {
6292 return TSS_TPM2B_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6293 }
6294 TPM_RC
TSS_TPM2B_NONCE_Marshal(const TPM2B_NONCE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6295 TSS_TPM2B_NONCE_Marshal(const TPM2B_NONCE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6296 {
6297 return TSS_TPM2B_NONCE_Marshalu(source, written, buffer, (uint32_t *)size);
6298 }
6299 TPM_RC
TSS_TPM2B_AUTH_Marshal(const TPM2B_AUTH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6300 TSS_TPM2B_AUTH_Marshal(const TPM2B_AUTH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6301 {
6302 return TSS_TPM2B_AUTH_Marshalu(source, written, buffer, (uint32_t *)size);
6303 }
6304 TPM_RC
TSS_TPM2B_OPERAND_Marshal(const TPM2B_OPERAND * source,UINT16 * written,BYTE ** buffer,INT32 * size)6305 TSS_TPM2B_OPERAND_Marshal(const TPM2B_OPERAND *source, UINT16 *written, BYTE **buffer, INT32 *size)
6306 {
6307 return TSS_TPM2B_OPERAND_Marshalu(source, written, buffer, (uint32_t *)size);
6308 }
6309 TPM_RC
TSS_TPM2B_EVENT_Marshal(const TPM2B_EVENT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6310 TSS_TPM2B_EVENT_Marshal(const TPM2B_EVENT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6311 {
6312 return TSS_TPM2B_EVENT_Marshalu(source, written, buffer, (uint32_t *)size);
6313 }
6314 TPM_RC
TSS_TPM2B_MAX_BUFFER_Marshal(const TPM2B_MAX_BUFFER * source,UINT16 * written,BYTE ** buffer,INT32 * size)6315 TSS_TPM2B_MAX_BUFFER_Marshal(const TPM2B_MAX_BUFFER *source, UINT16 *written, BYTE **buffer, INT32 *size)
6316 {
6317 return TSS_TPM2B_MAX_BUFFER_Marshalu(source, written, buffer, (uint32_t *)size);
6318 }
6319 TPM_RC
TSS_TPM2B_MAX_NV_BUFFER_Marshal(const TPM2B_MAX_NV_BUFFER * source,UINT16 * written,BYTE ** buffer,INT32 * size)6320 TSS_TPM2B_MAX_NV_BUFFER_Marshal(const TPM2B_MAX_NV_BUFFER *source, UINT16 *written, BYTE **buffer, INT32 *size)
6321 {
6322 return TSS_TPM2B_MAX_NV_BUFFER_Marshalu(source, written, buffer, (uint32_t *)size);
6323 }
6324 TPM_RC
TSS_TPM2B_TIMEOUT_Marshal(const TPM2B_TIMEOUT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6325 TSS_TPM2B_TIMEOUT_Marshal(const TPM2B_TIMEOUT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6326 {
6327 return TSS_TPM2B_TIMEOUT_Marshalu(source, written, buffer, (uint32_t *)size);
6328 }
6329 TPM_RC
TSS_TPM2B_IV_Marshal(const TPM2B_IV * source,UINT16 * written,BYTE ** buffer,INT32 * size)6330 TSS_TPM2B_IV_Marshal(const TPM2B_IV *source, UINT16 *written, BYTE **buffer, INT32 *size)
6331 {
6332 return TSS_TPM2B_IV_Marshalu(source, written, buffer, (uint32_t *)size);
6333 }
6334 TPM_RC
TSS_TPM2B_NAME_Marshal(const TPM2B_NAME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6335 TSS_TPM2B_NAME_Marshal(const TPM2B_NAME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6336 {
6337 return TSS_TPM2B_NAME_Marshalu(source, written, buffer, (uint32_t *)size);
6338 }
6339 TPM_RC
TSS_TPMS_PCR_SELECTION_Marshal(const TPMS_PCR_SELECTION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6340 TSS_TPMS_PCR_SELECTION_Marshal(const TPMS_PCR_SELECTION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6341 {
6342 return TSS_TPMS_PCR_SELECTION_Marshalu(source, written, buffer, (uint32_t *)size);
6343 }
6344 TPM_RC
TSS_TPMT_TK_CREATION_Marshal(const TPMT_TK_CREATION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6345 TSS_TPMT_TK_CREATION_Marshal(const TPMT_TK_CREATION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6346 {
6347 return TSS_TPMT_TK_CREATION_Marshalu(source, written, buffer, (uint32_t *)size);
6348 }
6349 TPM_RC
TSS_TPMT_TK_VERIFIED_Marshal(const TPMT_TK_VERIFIED * source,UINT16 * written,BYTE ** buffer,INT32 * size)6350 TSS_TPMT_TK_VERIFIED_Marshal(const TPMT_TK_VERIFIED *source, UINT16 *written, BYTE **buffer, INT32 *size)
6351 {
6352 return TSS_TPMT_TK_VERIFIED_Marshalu(source, written, buffer, (uint32_t *)size);
6353 }
6354 TPM_RC
TSS_TPMT_TK_AUTH_Marshal(const TPMT_TK_AUTH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6355 TSS_TPMT_TK_AUTH_Marshal(const TPMT_TK_AUTH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6356 {
6357 return TSS_TPMT_TK_AUTH_Marshalu(source, written, buffer, (uint32_t *)size);
6358 }
6359 TPM_RC
TSS_TPMT_TK_HASHCHECK_Marshal(const TPMT_TK_HASHCHECK * source,UINT16 * written,BYTE ** buffer,INT32 * size)6360 TSS_TPMT_TK_HASHCHECK_Marshal(const TPMT_TK_HASHCHECK *source, UINT16 *written, BYTE **buffer, INT32 *size)
6361 {
6362 return TSS_TPMT_TK_HASHCHECK_Marshalu(source, written, buffer, (uint32_t *)size);
6363 }
6364 TPM_RC
TSS_TPMS_ALG_PROPERTY_Marshal(const TPMS_ALG_PROPERTY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6365 TSS_TPMS_ALG_PROPERTY_Marshal(const TPMS_ALG_PROPERTY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6366 {
6367 return TSS_TPMS_ALG_PROPERTY_Marshalu(source, written, buffer, (uint32_t *)size);
6368 }
6369 TPM_RC
TSS_TPMS_TAGGED_PROPERTY_Marshal(const TPMS_TAGGED_PROPERTY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6370 TSS_TPMS_TAGGED_PROPERTY_Marshal(const TPMS_TAGGED_PROPERTY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6371 {
6372 return TSS_TPMS_TAGGED_PROPERTY_Marshalu(source, written, buffer, (uint32_t *)size);
6373 }
6374 TPM_RC
TSS_TPMS_TAGGED_PCR_SELECT_Marshal(const TPMS_TAGGED_PCR_SELECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6375 TSS_TPMS_TAGGED_PCR_SELECT_Marshal(const TPMS_TAGGED_PCR_SELECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6376 {
6377 return TSS_TPMS_TAGGED_PCR_SELECT_Marshalu(source, written, buffer, (uint32_t *)size);
6378 }
6379 TPM_RC
TSS_TPML_CC_Marshal(const TPML_CC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6380 TSS_TPML_CC_Marshal(const TPML_CC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6381 {
6382 return TSS_TPML_CC_Marshalu(source, written, buffer, (uint32_t *)size);
6383 }
6384 TPM_RC
TSS_TPML_CCA_Marshal(const TPML_CCA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6385 TSS_TPML_CCA_Marshal(const TPML_CCA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6386 {
6387 return TSS_TPML_CCA_Marshalu(source, written, buffer, (uint32_t *)size);
6388 }
6389 TPM_RC
TSS_TPML_ALG_Marshal(const TPML_ALG * source,UINT16 * written,BYTE ** buffer,INT32 * size)6390 TSS_TPML_ALG_Marshal(const TPML_ALG *source, UINT16 *written, BYTE **buffer, INT32 *size)
6391 {
6392 return TSS_TPML_ALG_Marshalu(source, written, buffer, (uint32_t *)size);
6393 }
6394 TPM_RC
TSS_TPML_HANDLE_Marshal(const TPML_HANDLE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6395 TSS_TPML_HANDLE_Marshal(const TPML_HANDLE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6396 {
6397 return TSS_TPML_HANDLE_Marshalu(source, written, buffer, (uint32_t *)size);
6398 }
6399 TPM_RC
TSS_TPML_DIGEST_Marshal(const TPML_DIGEST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6400 TSS_TPML_DIGEST_Marshal(const TPML_DIGEST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6401 {
6402 return TSS_TPML_DIGEST_Marshalu(source, written, buffer, (uint32_t *)size);
6403 }
6404 TPM_RC
TSS_TPML_DIGEST_VALUES_Marshal(const TPML_DIGEST_VALUES * source,UINT16 * written,BYTE ** buffer,INT32 * size)6405 TSS_TPML_DIGEST_VALUES_Marshal(const TPML_DIGEST_VALUES *source, UINT16 *written, BYTE **buffer, INT32 *size)
6406 {
6407 return TSS_TPML_DIGEST_VALUES_Marshalu(source, written, buffer, (uint32_t *)size);
6408 }
6409 TPM_RC
TSS_TPML_PCR_SELECTION_Marshal(const TPML_PCR_SELECTION * source,UINT16 * written,BYTE ** buffer,INT32 * size)6410 TSS_TPML_PCR_SELECTION_Marshal(const TPML_PCR_SELECTION *source, UINT16 *written, BYTE **buffer, INT32 *size)
6411 {
6412 return TSS_TPML_PCR_SELECTION_Marshalu(source, written, buffer, (uint32_t *)size);
6413 }
6414 TPM_RC
TSS_TPML_ALG_PROPERTY_Marshal(const TPML_ALG_PROPERTY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6415 TSS_TPML_ALG_PROPERTY_Marshal(const TPML_ALG_PROPERTY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6416 {
6417 return TSS_TPML_ALG_PROPERTY_Marshalu(source, written, buffer, (uint32_t *)size);
6418 }
6419 TPM_RC
TSS_TPML_TAGGED_TPM_PROPERTY_Marshal(const TPML_TAGGED_TPM_PROPERTY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6420 TSS_TPML_TAGGED_TPM_PROPERTY_Marshal(const TPML_TAGGED_TPM_PROPERTY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6421 {
6422 return TSS_TPML_TAGGED_TPM_PROPERTY_Marshalu(source, written, buffer, (uint32_t *)size);
6423 }
6424 TPM_RC
TSS_TPML_TAGGED_PCR_PROPERTY_Marshal(const TPML_TAGGED_PCR_PROPERTY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6425 TSS_TPML_TAGGED_PCR_PROPERTY_Marshal(const TPML_TAGGED_PCR_PROPERTY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6426 {
6427 return TSS_TPML_TAGGED_PCR_PROPERTY_Marshalu(source, written, buffer, (uint32_t *)size);
6428 }
6429 TPM_RC
TSS_TPML_ECC_CURVE_Marshal(const TPML_ECC_CURVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6430 TSS_TPML_ECC_CURVE_Marshal(const TPML_ECC_CURVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6431 {
6432 return TSS_TPML_ECC_CURVE_Marshalu(source, written, buffer, (uint32_t *)size);
6433 }
6434 TPM_RC
TSS_TPMU_CAPABILITIES_Marshal(const TPMU_CAPABILITIES * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6435 TSS_TPMU_CAPABILITIES_Marshal(const TPMU_CAPABILITIES *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6436 {
6437 return TSS_TPMU_CAPABILITIES_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6438 }
6439 TPM_RC
TSS_TPMS_CAPABILITY_DATA_Marshal(const TPMS_CAPABILITY_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6440 TSS_TPMS_CAPABILITY_DATA_Marshal(const TPMS_CAPABILITY_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6441 {
6442 return TSS_TPMS_CAPABILITY_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6443 }
6444 TPM_RC
TSS_TPMS_CLOCK_INFO_Marshal(const TPMS_CLOCK_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6445 TSS_TPMS_CLOCK_INFO_Marshal(const TPMS_CLOCK_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6446 {
6447 return TSS_TPMS_CLOCK_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6448 }
6449 TPM_RC
TSS_TPMS_TIME_INFO_Marshal(const TPMS_TIME_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6450 TSS_TPMS_TIME_INFO_Marshal(const TPMS_TIME_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6451 {
6452 return TSS_TPMS_TIME_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6453 }
6454 TPM_RC
TSS_TPMS_TIME_ATTEST_INFO_Marshal(const TPMS_TIME_ATTEST_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6455 TSS_TPMS_TIME_ATTEST_INFO_Marshal(const TPMS_TIME_ATTEST_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6456 {
6457 return TSS_TPMS_TIME_ATTEST_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6458 }
6459 TPM_RC
TSS_TPMS_CERTIFY_INFO_Marshal(const TPMS_CERTIFY_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6460 TSS_TPMS_CERTIFY_INFO_Marshal(const TPMS_CERTIFY_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6461 {
6462 return TSS_TPMS_CERTIFY_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6463 }
6464 TPM_RC
TSS_TPMS_QUOTE_INFO_Marshal(const TPMS_QUOTE_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6465 TSS_TPMS_QUOTE_INFO_Marshal(const TPMS_QUOTE_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6466 {
6467 return TSS_TPMS_QUOTE_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6468 }
6469 TPM_RC
TSS_TPMS_COMMAND_AUDIT_INFO_Marshal(const TPMS_COMMAND_AUDIT_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6470 TSS_TPMS_COMMAND_AUDIT_INFO_Marshal(const TPMS_COMMAND_AUDIT_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6471 {
6472 return TSS_TPMS_COMMAND_AUDIT_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6473 }
6474 TPM_RC
TSS_TPMS_SESSION_AUDIT_INFO_Marshal(const TPMS_SESSION_AUDIT_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6475 TSS_TPMS_SESSION_AUDIT_INFO_Marshal(const TPMS_SESSION_AUDIT_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6476 {
6477 return TSS_TPMS_SESSION_AUDIT_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6478 }
6479 TPM_RC
TSS_TPMS_CREATION_INFO_Marshal(const TPMS_CREATION_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6480 TSS_TPMS_CREATION_INFO_Marshal(const TPMS_CREATION_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6481 {
6482 return TSS_TPMS_CREATION_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6483 }
6484 TPM_RC
TSS_TPMS_NV_CERTIFY_INFO_Marshal(const TPMS_NV_CERTIFY_INFO * source,UINT16 * written,BYTE ** buffer,INT32 * size)6485 TSS_TPMS_NV_CERTIFY_INFO_Marshal(const TPMS_NV_CERTIFY_INFO *source, UINT16 *written, BYTE **buffer, INT32 *size)
6486 {
6487 return TSS_TPMS_NV_CERTIFY_INFO_Marshalu(source, written, buffer, (uint32_t *)size);
6488 }
6489 TPM_RC
TSS_TPMI_ST_ATTEST_Marshal(const TPMI_ST_ATTEST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6490 TSS_TPMI_ST_ATTEST_Marshal(const TPMI_ST_ATTEST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6491 {
6492 return TSS_TPMI_ST_ATTEST_Marshalu(source, written, buffer, (uint32_t *)size);
6493 }
6494 TPM_RC
TSS_TPMU_ATTEST_Marshal(const TPMU_ATTEST * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6495 TSS_TPMU_ATTEST_Marshal(const TPMU_ATTEST *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6496 {
6497 return TSS_TPMU_ATTEST_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6498 }
6499 TPM_RC
TSS_TPMS_ATTEST_Marshal(const TPMS_ATTEST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6500 TSS_TPMS_ATTEST_Marshal(const TPMS_ATTEST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6501 {
6502 return TSS_TPMS_ATTEST_Marshalu(source, written, buffer, (uint32_t *)size);
6503 }
6504 TPM_RC
TSS_TPM2B_ATTEST_Marshal(const TPM2B_ATTEST * source,UINT16 * written,BYTE ** buffer,INT32 * size)6505 TSS_TPM2B_ATTEST_Marshal(const TPM2B_ATTEST *source, UINT16 *written, BYTE **buffer, INT32 *size)
6506 {
6507 return TSS_TPM2B_ATTEST_Marshalu(source, written, buffer, (uint32_t *)size);
6508 }
6509 TPM_RC
TSS_TPMS_AUTH_COMMAND_Marshal(const TPMS_AUTH_COMMAND * source,UINT16 * written,BYTE ** buffer,INT32 * size)6510 TSS_TPMS_AUTH_COMMAND_Marshal(const TPMS_AUTH_COMMAND *source, UINT16 *written, BYTE **buffer, INT32 *size)
6511 {
6512 return TSS_TPMS_AUTH_COMMAND_Marshalu(source, written, buffer, (uint32_t *)size);
6513 }
6514 TPM_RC
TSS_TPMI_AES_KEY_BITS_Marshal(const TPMI_AES_KEY_BITS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6515 TSS_TPMI_AES_KEY_BITS_Marshal(const TPMI_AES_KEY_BITS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6516 {
6517 return TSS_TPMI_AES_KEY_BITS_Marshalu(source, written, buffer, (uint32_t *)size);
6518 }
6519 TPM_RC
TSS_TPMU_SYM_KEY_BITS_Marshal(const TPMU_SYM_KEY_BITS * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6520 TSS_TPMU_SYM_KEY_BITS_Marshal(const TPMU_SYM_KEY_BITS *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6521 {
6522 return TSS_TPMU_SYM_KEY_BITS_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6523 }
6524 TPM_RC
TSS_TPMU_SYM_MODE_Marshal(const TPMU_SYM_MODE * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6525 TSS_TPMU_SYM_MODE_Marshal(const TPMU_SYM_MODE *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6526 {
6527 return TSS_TPMU_SYM_MODE_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6528 }
6529 TPM_RC
TSS_TPMT_SYM_DEF_Marshal(const TPMT_SYM_DEF * source,UINT16 * written,BYTE ** buffer,INT32 * size)6530 TSS_TPMT_SYM_DEF_Marshal(const TPMT_SYM_DEF *source, UINT16 *written, BYTE **buffer, INT32 *size)
6531 {
6532 return TSS_TPMT_SYM_DEF_Marshalu(source, written, buffer, (uint32_t *)size);
6533 }
6534 TPM_RC
TSS_TPMT_SYM_DEF_OBJECT_Marshal(const TPMT_SYM_DEF_OBJECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6535 TSS_TPMT_SYM_DEF_OBJECT_Marshal(const TPMT_SYM_DEF_OBJECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6536 {
6537 return TSS_TPMT_SYM_DEF_OBJECT_Marshalu(source, written, buffer, (uint32_t *)size);
6538 }
6539 TPM_RC
TSS_TPM2B_SYM_KEY_Marshal(const TPM2B_SYM_KEY * source,UINT16 * written,BYTE ** buffer,INT32 * size)6540 TSS_TPM2B_SYM_KEY_Marshal(const TPM2B_SYM_KEY *source, UINT16 *written, BYTE **buffer, INT32 *size)
6541 {
6542 return TSS_TPM2B_SYM_KEY_Marshalu(source, written, buffer, (uint32_t *)size);
6543 }
6544 TPM_RC
TSS_TPM2B_LABEL_Marshal(const TPM2B_LABEL * source,UINT16 * written,BYTE ** buffer,INT32 * size)6545 TSS_TPM2B_LABEL_Marshal(const TPM2B_LABEL *source, UINT16 *written, BYTE **buffer, INT32 *size)
6546 {
6547 return TSS_TPM2B_LABEL_Marshalu(source, written, buffer, (uint32_t *)size);
6548 }
6549 TPM_RC
TSS_TPMS_DERIVE_Marshal(const TPMS_DERIVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6550 TSS_TPMS_DERIVE_Marshal(const TPMS_DERIVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6551 {
6552 return TSS_TPMS_DERIVE_Marshalu(source, written, buffer, (uint32_t *)size);
6553 }
6554 TPM_RC
TSS_TPMS_SYMCIPHER_PARMS_Marshal(const TPMS_SYMCIPHER_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6555 TSS_TPMS_SYMCIPHER_PARMS_Marshal(const TPMS_SYMCIPHER_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6556 {
6557 return TSS_TPMS_SYMCIPHER_PARMS_Marshalu(source, written, buffer, (uint32_t *)size);
6558 }
6559 TPM_RC
TSS_TPM2B_SENSITIVE_DATA_Marshal(const TPM2B_SENSITIVE_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6560 TSS_TPM2B_SENSITIVE_DATA_Marshal(const TPM2B_SENSITIVE_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6561 {
6562 return TSS_TPM2B_SENSITIVE_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6563 }
6564 TPM_RC
TSS_TPMS_SENSITIVE_CREATE_Marshal(const TPMS_SENSITIVE_CREATE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6565 TSS_TPMS_SENSITIVE_CREATE_Marshal(const TPMS_SENSITIVE_CREATE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6566 {
6567 return TSS_TPMS_SENSITIVE_CREATE_Marshalu(source, written, buffer, (uint32_t *)size);
6568 }
6569 TPM_RC
TSS_TPM2B_SENSITIVE_CREATE_Marshal(const TPM2B_SENSITIVE_CREATE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6570 TSS_TPM2B_SENSITIVE_CREATE_Marshal(const TPM2B_SENSITIVE_CREATE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6571 {
6572 return TSS_TPM2B_SENSITIVE_CREATE_Marshalu(source, written, buffer, (uint32_t *)size);
6573 }
6574 TPM_RC
TSS_TPMS_SCHEME_HASH_Marshal(const TPMS_SCHEME_HASH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6575 TSS_TPMS_SCHEME_HASH_Marshal(const TPMS_SCHEME_HASH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6576 {
6577 return TSS_TPMS_SCHEME_HASH_Marshalu(source, written, buffer, (uint32_t *)size);
6578 }
6579 TPM_RC
TSS_TPMS_SCHEME_ECDAA_Marshal(const TPMS_SCHEME_ECDAA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6580 TSS_TPMS_SCHEME_ECDAA_Marshal(const TPMS_SCHEME_ECDAA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6581 {
6582 return TSS_TPMS_SCHEME_ECDAA_Marshalu(source, written, buffer, (uint32_t *)size);
6583 }
6584 TPM_RC
TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshal(const TPMI_ALG_KEYEDHASH_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6585 TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshal(const TPMI_ALG_KEYEDHASH_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6586 {
6587 return TSS_TPMI_ALG_KEYEDHASH_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6588 }
6589 TPM_RC
TSS_TPMS_SCHEME_HMAC_Marshal(const TPMS_SCHEME_HMAC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6590 TSS_TPMS_SCHEME_HMAC_Marshal(const TPMS_SCHEME_HMAC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6591 {
6592 return TSS_TPMS_SCHEME_HMAC_Marshalu(source, written, buffer, (uint32_t *)size);
6593 }
6594 TPM_RC
TSS_TPMS_SCHEME_XOR_Marshal(const TPMS_SCHEME_XOR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6595 TSS_TPMS_SCHEME_XOR_Marshal(const TPMS_SCHEME_XOR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6596 {
6597 return TSS_TPMS_SCHEME_XOR_Marshalu(source, written, buffer, (uint32_t *)size);
6598 }
6599 TPM_RC
TSS_TPMU_SCHEME_KEYEDHASH_Marshal(const TPMU_SCHEME_KEYEDHASH * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6600 TSS_TPMU_SCHEME_KEYEDHASH_Marshal(const TPMU_SCHEME_KEYEDHASH *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6601 {
6602 return TSS_TPMU_SCHEME_KEYEDHASH_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6603 }
6604 TPM_RC
TSS_TPMT_KEYEDHASH_SCHEME_Marshal(const TPMT_KEYEDHASH_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6605 TSS_TPMT_KEYEDHASH_SCHEME_Marshal(const TPMT_KEYEDHASH_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6606 {
6607 return TSS_TPMT_KEYEDHASH_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6608 }
6609 TPM_RC
TSS_TPMS_SIG_SCHEME_RSASSA_Marshal(const TPMS_SIG_SCHEME_RSASSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6610 TSS_TPMS_SIG_SCHEME_RSASSA_Marshal(const TPMS_SIG_SCHEME_RSASSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6611 {
6612 return TSS_TPMS_SIG_SCHEME_RSASSA_Marshalu(source, written, buffer, (uint32_t *)size);
6613 }
6614 TPM_RC
TSS_TPMS_SIG_SCHEME_RSAPSS_Marshal(const TPMS_SIG_SCHEME_RSAPSS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6615 TSS_TPMS_SIG_SCHEME_RSAPSS_Marshal(const TPMS_SIG_SCHEME_RSAPSS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6616 {
6617 return TSS_TPMS_SIG_SCHEME_RSAPSS_Marshalu(source, written, buffer, (uint32_t *)size);
6618 }
6619 TPM_RC
TSS_TPMS_SIG_SCHEME_ECDSA_Marshal(const TPMS_SIG_SCHEME_ECDSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6620 TSS_TPMS_SIG_SCHEME_ECDSA_Marshal(const TPMS_SIG_SCHEME_ECDSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6621 {
6622 return TSS_TPMS_SIG_SCHEME_ECDSA_Marshalu(source, written, buffer, (uint32_t *)size);
6623 }
6624 TPM_RC
TSS_TPMS_SIG_SCHEME_SM2_Marshal(const TPMS_SIG_SCHEME_SM2 * source,UINT16 * written,BYTE ** buffer,INT32 * size)6625 TSS_TPMS_SIG_SCHEME_SM2_Marshal(const TPMS_SIG_SCHEME_SM2 *source, UINT16 *written, BYTE **buffer, INT32 *size)
6626 {
6627 return TSS_TPMS_SIG_SCHEME_SM2_Marshalu(source, written, buffer, (uint32_t *)size);
6628 }
6629 TPM_RC
TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshal(const TPMS_SIG_SCHEME_ECSCHNORR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6630 TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshal(const TPMS_SIG_SCHEME_ECSCHNORR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6631 {
6632 return TSS_TPMS_SIG_SCHEME_ECSCHNORR_Marshalu(source, written, buffer, (uint32_t *)size);
6633 }
6634 TPM_RC
TSS_TPMS_SIG_SCHEME_ECDAA_Marshal(const TPMS_SIG_SCHEME_ECDAA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6635 TSS_TPMS_SIG_SCHEME_ECDAA_Marshal(const TPMS_SIG_SCHEME_ECDAA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6636 {
6637 return TSS_TPMS_SIG_SCHEME_ECDAA_Marshalu(source, written, buffer, (uint32_t *)size);
6638 }
6639 TPM_RC
TSS_TPMU_SIG_SCHEME_Marshal(const TPMU_SIG_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6640 TSS_TPMU_SIG_SCHEME_Marshal(const TPMU_SIG_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6641 {
6642 return TSS_TPMU_SIG_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6643 }
6644 TPM_RC
TSS_TPMT_SIG_SCHEME_Marshal(const TPMT_SIG_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6645 TSS_TPMT_SIG_SCHEME_Marshal(const TPMT_SIG_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6646 {
6647 return TSS_TPMT_SIG_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6648 }
6649
6650 /* NOTE: Marked as const function in header */
6651
6652 TPM_RC
TSS_TPMS_ENC_SCHEME_OAEP_Marshal(const TPMS_ENC_SCHEME_OAEP * source,UINT16 * written,BYTE ** buffer,INT32 * size)6653 TSS_TPMS_ENC_SCHEME_OAEP_Marshal(const TPMS_ENC_SCHEME_OAEP *source, UINT16 *written, BYTE **buffer, INT32 *size)
6654 {
6655 return TSS_TPMS_ENC_SCHEME_OAEP_Marshalu(source, written, buffer, (uint32_t *)size);
6656 }
6657
6658 /* NOTE: Marked as const function in header */
6659
6660 TPM_RC
TSS_TPMS_ENC_SCHEME_RSAES_Marshal(const TPMS_ENC_SCHEME_RSAES * source,UINT16 * written,BYTE ** buffer,INT32 * size)6661 TSS_TPMS_ENC_SCHEME_RSAES_Marshal(const TPMS_ENC_SCHEME_RSAES *source, UINT16 *written, BYTE **buffer, INT32 *size)
6662 {
6663 return TSS_TPMS_ENC_SCHEME_RSAES_Marshalu(source, written, buffer, (uint32_t *)size);
6664 }
6665 TPM_RC
TSS_TPMS_KEY_SCHEME_ECDH_Marshal(const TPMS_KEY_SCHEME_ECDH * source,UINT16 * written,BYTE ** buffer,INT32 * size)6666 TSS_TPMS_KEY_SCHEME_ECDH_Marshal(const TPMS_KEY_SCHEME_ECDH *source, UINT16 *written, BYTE **buffer, INT32 *size)
6667 {
6668 return TSS_TPMS_KEY_SCHEME_ECDH_Marshalu(source, written, buffer, (uint32_t *)size);
6669 }
6670 TPM_RC
TSS_TPMS_KEY_SCHEME_ECMQV_Marshal(const TPMS_KEY_SCHEME_ECMQV * source,UINT16 * written,BYTE ** buffer,INT32 * size)6671 TSS_TPMS_KEY_SCHEME_ECMQV_Marshal(const TPMS_KEY_SCHEME_ECMQV *source, UINT16 *written, BYTE **buffer, INT32 *size)
6672 {
6673 return TSS_TPMS_KEY_SCHEME_ECMQV_Marshalu(source, written, buffer, (uint32_t *)size);
6674 }
6675 TPM_RC
TSS_TPMS_SCHEME_MGF1_Marshal(const TPMS_SCHEME_MGF1 * source,UINT16 * written,BYTE ** buffer,INT32 * size)6676 TSS_TPMS_SCHEME_MGF1_Marshal(const TPMS_SCHEME_MGF1 *source, UINT16 *written, BYTE **buffer, INT32 *size)
6677 {
6678 return TSS_TPMS_SCHEME_MGF1_Marshalu(source, written, buffer, (uint32_t *)size);
6679 }
6680 TPM_RC
TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshal(const TPMS_SCHEME_KDF1_SP800_56A * source,UINT16 * written,BYTE ** buffer,INT32 * size)6681 TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshal(const TPMS_SCHEME_KDF1_SP800_56A *source, UINT16 *written, BYTE **buffer, INT32 *size)
6682 {
6683 return TSS_TPMS_SCHEME_KDF1_SP800_56A_Marshalu(source, written, buffer, (uint32_t *)size);
6684 }
6685 TPM_RC
TSS_TPMS_SCHEME_KDF2_Marshal(const TPMS_SCHEME_KDF2 * source,UINT16 * written,BYTE ** buffer,INT32 * size)6686 TSS_TPMS_SCHEME_KDF2_Marshal(const TPMS_SCHEME_KDF2 *source, UINT16 *written, BYTE **buffer, INT32 *size)
6687 {
6688 return TSS_TPMS_SCHEME_KDF2_Marshalu(source, written, buffer, (uint32_t *)size);
6689 }
6690 TPM_RC
TSS_TPMS_SCHEME_KDF1_SP800_108_Marshal(const TPMS_SCHEME_KDF1_SP800_108 * source,UINT16 * written,BYTE ** buffer,INT32 * size)6691 TSS_TPMS_SCHEME_KDF1_SP800_108_Marshal(const TPMS_SCHEME_KDF1_SP800_108 *source, UINT16 *written, BYTE **buffer, INT32 *size)
6692 {
6693 return TSS_TPMS_SCHEME_KDF1_SP800_108_Marshalu(source, written, buffer, (uint32_t *)size);
6694 }
6695 TPM_RC
TSS_TPMU_KDF_SCHEME_Marshal(const TPMU_KDF_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6696 TSS_TPMU_KDF_SCHEME_Marshal(const TPMU_KDF_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6697 {
6698 return TSS_TPMU_KDF_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6699 }
6700 TPM_RC
TSS_TPMT_KDF_SCHEME_Marshal(const TPMT_KDF_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6701 TSS_TPMT_KDF_SCHEME_Marshal(const TPMT_KDF_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6702 {
6703 return TSS_TPMT_KDF_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6704 }
6705 TPM_RC
TSS_TPMU_ASYM_SCHEME_Marshal(const TPMU_ASYM_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6706 TSS_TPMU_ASYM_SCHEME_Marshal(const TPMU_ASYM_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6707 {
6708 return TSS_TPMU_ASYM_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6709 }
6710 TPM_RC
TSS_TPMI_ALG_RSA_SCHEME_Marshal(const TPMI_ALG_RSA_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6711 TSS_TPMI_ALG_RSA_SCHEME_Marshal(const TPMI_ALG_RSA_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6712 {
6713 return TSS_TPMI_ALG_RSA_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6714 }
6715 TPM_RC
TSS_TPMT_RSA_SCHEME_Marshal(const TPMT_RSA_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6716 TSS_TPMT_RSA_SCHEME_Marshal(const TPMT_RSA_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6717 {
6718 return TSS_TPMT_RSA_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6719 }
6720 TPM_RC
TSS_TPMI_ALG_RSA_DECRYPT_Marshal(const TPMI_ALG_RSA_DECRYPT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6721 TSS_TPMI_ALG_RSA_DECRYPT_Marshal(const TPMI_ALG_RSA_DECRYPT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6722 {
6723 return TSS_TPMI_ALG_RSA_DECRYPT_Marshalu(source, written, buffer, (uint32_t *)size);
6724 }
6725 TPM_RC
TSS_TPMT_RSA_DECRYPT_Marshal(const TPMT_RSA_DECRYPT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6726 TSS_TPMT_RSA_DECRYPT_Marshal(const TPMT_RSA_DECRYPT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6727 {
6728 return TSS_TPMT_RSA_DECRYPT_Marshalu(source, written, buffer, (uint32_t *)size);
6729 }
6730 TPM_RC
TSS_TPM2B_PUBLIC_KEY_RSA_Marshal(const TPM2B_PUBLIC_KEY_RSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6731 TSS_TPM2B_PUBLIC_KEY_RSA_Marshal(const TPM2B_PUBLIC_KEY_RSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6732 {
6733 return TSS_TPM2B_PUBLIC_KEY_RSA_Marshalu(source, written, buffer, (uint32_t *)size);
6734 }
6735 TPM_RC
TSS_TPMI_RSA_KEY_BITS_Marshal(const TPMI_RSA_KEY_BITS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6736 TSS_TPMI_RSA_KEY_BITS_Marshal(const TPMI_RSA_KEY_BITS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6737 {
6738 return TSS_TPMI_RSA_KEY_BITS_Marshalu(source, written, buffer, (uint32_t *)size);
6739 }
6740 TPM_RC
TSS_TPM2B_PRIVATE_KEY_RSA_Marshal(const TPM2B_PRIVATE_KEY_RSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6741 TSS_TPM2B_PRIVATE_KEY_RSA_Marshal(const TPM2B_PRIVATE_KEY_RSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6742 {
6743 return TSS_TPM2B_PRIVATE_KEY_RSA_Marshalu(source, written, buffer, (uint32_t *)size);
6744 }
6745 TPM_RC
TSS_TPM2B_ECC_PARAMETER_Marshal(const TPM2B_ECC_PARAMETER * source,UINT16 * written,BYTE ** buffer,INT32 * size)6746 TSS_TPM2B_ECC_PARAMETER_Marshal(const TPM2B_ECC_PARAMETER *source, UINT16 *written, BYTE **buffer, INT32 *size)
6747 {
6748 return TSS_TPM2B_ECC_PARAMETER_Marshalu(source, written, buffer, (uint32_t *)size);
6749 }
6750 TPM_RC
TSS_TPMS_ECC_POINT_Marshal(const TPMS_ECC_POINT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6751 TSS_TPMS_ECC_POINT_Marshal(const TPMS_ECC_POINT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6752 {
6753 return TSS_TPMS_ECC_POINT_Marshalu(source, written, buffer, (uint32_t *)size);
6754 }
6755 TPM_RC
TSS_TPM2B_ECC_POINT_Marshal(const TPM2B_ECC_POINT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6756 TSS_TPM2B_ECC_POINT_Marshal(const TPM2B_ECC_POINT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6757 {
6758 return TSS_TPM2B_ECC_POINT_Marshalu(source, written, buffer, (uint32_t *)size);
6759 }
6760 TPM_RC
TSS_TPMI_ALG_ECC_SCHEME_Marshal(const TPMI_ALG_ECC_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6761 TSS_TPMI_ALG_ECC_SCHEME_Marshal(const TPMI_ALG_ECC_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6762 {
6763 return TSS_TPMI_ALG_ECC_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6764 }
6765 TPM_RC
TSS_TPMI_ECC_CURVE_Marshal(const TPMI_ECC_CURVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6766 TSS_TPMI_ECC_CURVE_Marshal(const TPMI_ECC_CURVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6767 {
6768 return TSS_TPMI_ECC_CURVE_Marshalu(source, written, buffer, (uint32_t *)size);
6769 }
6770 TPM_RC
TSS_TPMT_ECC_SCHEME_Marshal(const TPMT_ECC_SCHEME * source,UINT16 * written,BYTE ** buffer,INT32 * size)6771 TSS_TPMT_ECC_SCHEME_Marshal(const TPMT_ECC_SCHEME *source, UINT16 *written, BYTE **buffer, INT32 *size)
6772 {
6773 return TSS_TPMT_ECC_SCHEME_Marshalu(source, written, buffer, (uint32_t *)size);
6774 }
6775 TPM_RC
TSS_TPMS_ALGORITHM_DETAIL_ECC_Marshal(const TPMS_ALGORITHM_DETAIL_ECC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6776 TSS_TPMS_ALGORITHM_DETAIL_ECC_Marshal(const TPMS_ALGORITHM_DETAIL_ECC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6777 {
6778 return TSS_TPMS_ALGORITHM_DETAIL_ECC_Marshalu(source, written, buffer, (uint32_t *)size);
6779 }
6780 TPM_RC
TSS_TPMS_SIGNATURE_RSA_Marshal(const TPMS_SIGNATURE_RSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6781 TSS_TPMS_SIGNATURE_RSA_Marshal(const TPMS_SIGNATURE_RSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6782 {
6783 return TSS_TPMS_SIGNATURE_RSA_Marshalu(source, written, buffer, (uint32_t *)size);
6784 }
6785 TPM_RC
TSS_TPMS_SIGNATURE_RSASSA_Marshal(const TPMS_SIGNATURE_RSASSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6786 TSS_TPMS_SIGNATURE_RSASSA_Marshal(const TPMS_SIGNATURE_RSASSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6787 {
6788 return TSS_TPMS_SIGNATURE_RSASSA_Marshalu(source, written, buffer, (uint32_t *)size);
6789 }
6790 TPM_RC
TSS_TPMS_SIGNATURE_RSAPSS_Marshal(const TPMS_SIGNATURE_RSAPSS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6791 TSS_TPMS_SIGNATURE_RSAPSS_Marshal(const TPMS_SIGNATURE_RSAPSS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6792 {
6793 return TSS_TPMS_SIGNATURE_RSAPSS_Marshalu(source, written, buffer, (uint32_t *)size);
6794 }
6795 TPM_RC
TSS_TPMS_SIGNATURE_ECC_Marshal(const TPMS_SIGNATURE_ECC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6796 TSS_TPMS_SIGNATURE_ECC_Marshal(const TPMS_SIGNATURE_ECC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6797 {
6798 return TSS_TPMS_SIGNATURE_ECC_Marshalu(source, written, buffer, (uint32_t *)size);
6799 }
6800 TPM_RC
TSS_TPMS_SIGNATURE_ECDSA_Marshal(const TPMS_SIGNATURE_ECDSA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6801 TSS_TPMS_SIGNATURE_ECDSA_Marshal(const TPMS_SIGNATURE_ECDSA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6802 {
6803 return TSS_TPMS_SIGNATURE_ECDSA_Marshalu(source, written, buffer, (uint32_t *)size);
6804 }
6805 TPM_RC
TSS_TPMS_SIGNATURE_ECDAA_Marshal(const TPMS_SIGNATURE_ECDAA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6806 TSS_TPMS_SIGNATURE_ECDAA_Marshal(const TPMS_SIGNATURE_ECDAA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6807 {
6808 return TSS_TPMS_SIGNATURE_ECDAA_Marshalu(source, written, buffer, (uint32_t *)size);
6809 }
6810 TPM_RC
TSS_TPMS_SIGNATURE_SM2_Marshal(const TPMS_SIGNATURE_SM2 * source,UINT16 * written,BYTE ** buffer,INT32 * size)6811 TSS_TPMS_SIGNATURE_SM2_Marshal(const TPMS_SIGNATURE_SM2 *source, UINT16 *written, BYTE **buffer, INT32 *size)
6812 {
6813 return TSS_TPMS_SIGNATURE_SM2_Marshalu(source, written, buffer, (uint32_t *)size);
6814 }
6815 TPM_RC
TSS_TPMS_SIGNATURE_ECSCHNORR_Marshal(const TPMS_SIGNATURE_ECSCHNORR * source,UINT16 * written,BYTE ** buffer,INT32 * size)6816 TSS_TPMS_SIGNATURE_ECSCHNORR_Marshal(const TPMS_SIGNATURE_ECSCHNORR *source, UINT16 *written, BYTE **buffer, INT32 *size)
6817 {
6818 return TSS_TPMS_SIGNATURE_ECSCHNORR_Marshalu(source, written, buffer, (uint32_t *)size);
6819 }
6820 TPM_RC
TSS_TPMU_SIGNATURE_Marshal(const TPMU_SIGNATURE * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6821 TSS_TPMU_SIGNATURE_Marshal(const TPMU_SIGNATURE *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6822 {
6823 return TSS_TPMU_SIGNATURE_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6824 }
6825 TPM_RC
TSS_TPMT_SIGNATURE_Marshal(const TPMT_SIGNATURE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6826 TSS_TPMT_SIGNATURE_Marshal(const TPMT_SIGNATURE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6827 {
6828 return TSS_TPMT_SIGNATURE_Marshalu(source, written, buffer, (uint32_t *)size);
6829 }
6830 TPM_RC
TSS_TPM2B_ENCRYPTED_SECRET_Marshal(const TPM2B_ENCRYPTED_SECRET * source,UINT16 * written,BYTE ** buffer,INT32 * size)6831 TSS_TPM2B_ENCRYPTED_SECRET_Marshal(const TPM2B_ENCRYPTED_SECRET *source, UINT16 *written, BYTE **buffer, INT32 *size)
6832 {
6833 return TSS_TPM2B_ENCRYPTED_SECRET_Marshalu(source, written, buffer, (uint32_t *)size);
6834 }
6835 TPM_RC
TSS_TPMI_ALG_PUBLIC_Marshal(const TPMI_ALG_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6836 TSS_TPMI_ALG_PUBLIC_Marshal(const TPMI_ALG_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6837 {
6838 return TSS_TPMI_ALG_PUBLIC_Marshalu(source, written, buffer, (uint32_t *)size);
6839 }
6840 TPM_RC
TSS_TPMU_PUBLIC_ID_Marshal(const TPMU_PUBLIC_ID * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6841 TSS_TPMU_PUBLIC_ID_Marshal(const TPMU_PUBLIC_ID *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6842 {
6843 return TSS_TPMU_PUBLIC_ID_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6844 }
6845 TPM_RC
TSS_TPMS_KEYEDHASH_PARMS_Marshal(const TPMS_KEYEDHASH_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6846 TSS_TPMS_KEYEDHASH_PARMS_Marshal(const TPMS_KEYEDHASH_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6847 {
6848 return TSS_TPMS_KEYEDHASH_PARMS_Marshalu(source, written, buffer, (uint32_t *)size);
6849 }
6850 TPM_RC
TSS_TPMS_RSA_PARMS_Marshal(const TPMS_RSA_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6851 TSS_TPMS_RSA_PARMS_Marshal(const TPMS_RSA_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6852 {
6853 return TSS_TPMS_RSA_PARMS_Marshalu(source, written, buffer, (uint32_t *)size);
6854 }
6855 TPM_RC
TSS_TPMS_ECC_PARMS_Marshal(const TPMS_ECC_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6856 TSS_TPMS_ECC_PARMS_Marshal(const TPMS_ECC_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6857 {
6858 return TSS_TPMS_ECC_PARMS_Marshalu(source, written, buffer, (uint32_t *)size);
6859 }
6860 TPM_RC
TSS_TPMU_PUBLIC_PARMS_Marshal(const TPMU_PUBLIC_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6861 TSS_TPMU_PUBLIC_PARMS_Marshal(const TPMU_PUBLIC_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6862 {
6863 return TSS_TPMU_PUBLIC_PARMS_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6864 }
6865 TPM_RC
TSS_TPMT_PUBLIC_PARMS_Marshal(const TPMT_PUBLIC_PARMS * source,UINT16 * written,BYTE ** buffer,INT32 * size)6866 TSS_TPMT_PUBLIC_PARMS_Marshal(const TPMT_PUBLIC_PARMS *source, UINT16 *written, BYTE **buffer, INT32 *size)
6867 {
6868 return TSS_TPMT_PUBLIC_PARMS_Marshalu(source, written, buffer, (uint32_t *)size);
6869 }
6870 TPM_RC
TSS_TPMT_PUBLIC_Marshal(const TPMT_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6871 TSS_TPMT_PUBLIC_Marshal(const TPMT_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6872 {
6873 return TSS_TPMT_PUBLIC_Marshalu(source, written, buffer, (uint32_t *)size);
6874 }
6875 TPM_RC
TSS_TPMT_PUBLIC_D_Marshal(const TPMT_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6876 TSS_TPMT_PUBLIC_D_Marshal(const TPMT_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6877 {
6878 return TSS_TPMT_PUBLIC_D_Marshalu(source, written, buffer, (uint32_t *)size);
6879 }
6880 TPM_RC
TSS_TPM2B_PUBLIC_Marshal(const TPM2B_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6881 TSS_TPM2B_PUBLIC_Marshal(const TPM2B_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6882 {
6883 return TSS_TPM2B_PUBLIC_Marshalu(source, written, buffer, (uint32_t *)size);
6884 }
6885 TPM_RC
TSS_TPM2B_TEMPLATE_Marshal(const TPM2B_TEMPLATE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6886 TSS_TPM2B_TEMPLATE_Marshal(const TPM2B_TEMPLATE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6887 {
6888 return TSS_TPM2B_TEMPLATE_Marshalu(source, written, buffer, (uint32_t *)size);
6889 }
6890 TPM_RC
TSS_TPMU_SENSITIVE_COMPOSITE_Marshal(const TPMU_SENSITIVE_COMPOSITE * source,UINT16 * written,BYTE ** buffer,INT32 * size,UINT32 selector)6891 TSS_TPMU_SENSITIVE_COMPOSITE_Marshal(const TPMU_SENSITIVE_COMPOSITE *source, UINT16 *written, BYTE **buffer, INT32 *size, UINT32 selector)
6892 {
6893 return TSS_TPMU_SENSITIVE_COMPOSITE_Marshalu(source, written, buffer, (uint32_t *)size, selector);
6894 }
6895 TPM_RC
TSS_TPMT_SENSITIVE_Marshal(const TPMT_SENSITIVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6896 TSS_TPMT_SENSITIVE_Marshal(const TPMT_SENSITIVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6897 {
6898 return TSS_TPMT_SENSITIVE_Marshalu(source, written, buffer, (uint32_t *)size);
6899 }
6900 TPM_RC
TSS_TPM2B_SENSITIVE_Marshal(const TPM2B_SENSITIVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6901 TSS_TPM2B_SENSITIVE_Marshal(const TPM2B_SENSITIVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6902 {
6903 return TSS_TPM2B_SENSITIVE_Marshalu(source, written, buffer, (uint32_t *)size);
6904 }
6905 TPM_RC
TSS_TPM2B_PRIVATE_Marshal(const TPM2B_PRIVATE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6906 TSS_TPM2B_PRIVATE_Marshal(const TPM2B_PRIVATE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6907 {
6908 return TSS_TPM2B_PRIVATE_Marshalu(source, written, buffer, (uint32_t *)size);
6909 }
6910 TPM_RC
TSS_TPM2B_ID_OBJECT_Marshal(const TPM2B_ID_OBJECT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6911 TSS_TPM2B_ID_OBJECT_Marshal(const TPM2B_ID_OBJECT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6912 {
6913 return TSS_TPM2B_ID_OBJECT_Marshalu(source, written, buffer, (uint32_t *)size);
6914 }
6915 TPM_RC
TSS_TPMA_NV_Marshal(const TPMA_NV * source,UINT16 * written,BYTE ** buffer,INT32 * size)6916 TSS_TPMA_NV_Marshal(const TPMA_NV *source, UINT16 *written, BYTE **buffer, INT32 *size)
6917 {
6918 return TSS_TPMA_NV_Marshalu(source, written, buffer, (uint32_t *)size);
6919 }
6920 TPM_RC
TSS_TPMS_NV_PUBLIC_Marshal(const TPMS_NV_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6921 TSS_TPMS_NV_PUBLIC_Marshal(const TPMS_NV_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6922 {
6923 return TSS_TPMS_NV_PUBLIC_Marshalu(source, written, buffer, (uint32_t *)size);
6924 }
6925 TPM_RC
TSS_TPM2B_NV_PUBLIC_Marshal(const TPM2B_NV_PUBLIC * source,UINT16 * written,BYTE ** buffer,INT32 * size)6926 TSS_TPM2B_NV_PUBLIC_Marshal(const TPM2B_NV_PUBLIC *source, UINT16 *written, BYTE **buffer, INT32 *size)
6927 {
6928 return TSS_TPM2B_NV_PUBLIC_Marshalu(source, written, buffer, (uint32_t *)size);
6929 }
6930 TPM_RC
TSS_TPM2B_CONTEXT_SENSITIVE_Marshal(const TPM2B_CONTEXT_SENSITIVE * source,UINT16 * written,BYTE ** buffer,INT32 * size)6931 TSS_TPM2B_CONTEXT_SENSITIVE_Marshal(const TPM2B_CONTEXT_SENSITIVE *source, UINT16 *written, BYTE **buffer, INT32 *size)
6932 {
6933 return TSS_TPM2B_CONTEXT_SENSITIVE_Marshalu(source, written, buffer, (uint32_t *)size);
6934 }
6935 TPM_RC
TSS_TPM2B_CONTEXT_DATA_Marshal(const TPM2B_CONTEXT_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6936 TSS_TPM2B_CONTEXT_DATA_Marshal(const TPM2B_CONTEXT_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6937 {
6938 return TSS_TPM2B_CONTEXT_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6939 }
6940 TPM_RC
TSS_TPMS_CONTEXT_Marshal(const TPMS_CONTEXT * source,UINT16 * written,BYTE ** buffer,INT32 * size)6941 TSS_TPMS_CONTEXT_Marshal(const TPMS_CONTEXT *source, UINT16 *written, BYTE **buffer, INT32 *size)
6942 {
6943 return TSS_TPMS_CONTEXT_Marshalu(source, written, buffer, (uint32_t *)size);
6944 }
6945 TPM_RC
TSS_TPMS_CREATION_DATA_Marshal(const TPMS_CREATION_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6946 TSS_TPMS_CREATION_DATA_Marshal(const TPMS_CREATION_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6947 {
6948 return TSS_TPMS_CREATION_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6949 }
6950 TPM_RC
TSS_TPM2B_CREATION_DATA_Marshal(const TPM2B_CREATION_DATA * source,UINT16 * written,BYTE ** buffer,INT32 * size)6951 TSS_TPM2B_CREATION_DATA_Marshal(const TPM2B_CREATION_DATA *source, UINT16 *written, BYTE **buffer, INT32 *size)
6952 {
6953 return TSS_TPM2B_CREATION_DATA_Marshalu(source, written, buffer, (uint32_t *)size);
6954 }
6955
6956
6957
6958 TPM_RC
TSS_Startup_In_Marshal(const Startup_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6959 TSS_Startup_In_Marshal(const Startup_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6960 {
6961 return TSS_Startup_In_Marshalu(source, written, buffer, (uint32_t *)size);
6962 }
6963 TPM_RC
TSS_Shutdown_In_Marshal(const Shutdown_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6964 TSS_Shutdown_In_Marshal(const Shutdown_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6965 {
6966 return TSS_Shutdown_In_Marshalu(source, written, buffer, (uint32_t *)size);
6967 }
6968 TPM_RC
TSS_SelfTest_In_Marshal(const SelfTest_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6969 TSS_SelfTest_In_Marshal(const SelfTest_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6970 {
6971 return TSS_SelfTest_In_Marshalu(source, written, buffer, (uint32_t *)size);
6972 }
6973 TPM_RC
TSS_IncrementalSelfTest_In_Marshal(const IncrementalSelfTest_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6974 TSS_IncrementalSelfTest_In_Marshal(const IncrementalSelfTest_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6975 {
6976 return TSS_IncrementalSelfTest_In_Marshalu(source, written, buffer, (uint32_t *)size);
6977 }
6978 TPM_RC
TSS_StartAuthSession_In_Marshal(const StartAuthSession_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6979 TSS_StartAuthSession_In_Marshal(const StartAuthSession_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6980 {
6981 return TSS_StartAuthSession_In_Marshalu(source, written, buffer, (uint32_t *)size);
6982 }
6983 TPM_RC
TSS_PolicyRestart_In_Marshal(const PolicyRestart_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6984 TSS_PolicyRestart_In_Marshal(const PolicyRestart_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6985 {
6986 return TSS_PolicyRestart_In_Marshalu(source, written, buffer, (uint32_t *)size);
6987 }
6988 TPM_RC
TSS_Create_In_Marshal(const Create_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6989 TSS_Create_In_Marshal(const Create_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6990 {
6991 return TSS_Create_In_Marshalu(source, written, buffer, (uint32_t *)size);
6992 }
6993 TPM_RC
TSS_Load_In_Marshal(const Load_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6994 TSS_Load_In_Marshal(const Load_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
6995 {
6996 return TSS_Load_In_Marshalu(source, written, buffer, (uint32_t *)size);
6997 }
6998 TPM_RC
TSS_LoadExternal_In_Marshal(const LoadExternal_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)6999 TSS_LoadExternal_In_Marshal(const LoadExternal_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7000 {
7001 return TSS_LoadExternal_In_Marshalu(source, written, buffer, (uint32_t *)size);
7002 }
7003 TPM_RC
TSS_ReadPublic_In_Marshal(const ReadPublic_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7004 TSS_ReadPublic_In_Marshal(const ReadPublic_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7005 {
7006 return TSS_ReadPublic_In_Marshalu(source, written, buffer, (uint32_t *)size);
7007 }
7008 TPM_RC
TSS_ActivateCredential_In_Marshal(const ActivateCredential_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7009 TSS_ActivateCredential_In_Marshal(const ActivateCredential_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7010 {
7011 return TSS_ActivateCredential_In_Marshalu(source, written, buffer, (uint32_t *)size);
7012 }
7013 TPM_RC
TSS_MakeCredential_In_Marshal(const MakeCredential_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7014 TSS_MakeCredential_In_Marshal(const MakeCredential_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7015 {
7016 return TSS_MakeCredential_In_Marshalu(source, written, buffer, (uint32_t *)size);
7017 }
7018 TPM_RC
TSS_Unseal_In_Marshal(const Unseal_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7019 TSS_Unseal_In_Marshal(const Unseal_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7020 {
7021 return TSS_Unseal_In_Marshalu(source, written, buffer, (uint32_t *)size);
7022 }
7023 TPM_RC
TSS_ObjectChangeAuth_In_Marshal(const ObjectChangeAuth_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7024 TSS_ObjectChangeAuth_In_Marshal(const ObjectChangeAuth_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7025 {
7026 return TSS_ObjectChangeAuth_In_Marshalu(source, written, buffer, (uint32_t *)size);
7027 }
7028 TPM_RC
TSS_CreateLoaded_In_Marshal(const CreateLoaded_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7029 TSS_CreateLoaded_In_Marshal(const CreateLoaded_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7030 {
7031 return TSS_CreateLoaded_In_Marshalu(source, written, buffer, (uint32_t *)size);
7032 }
7033 TPM_RC
TSS_Duplicate_In_Marshal(const Duplicate_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7034 TSS_Duplicate_In_Marshal(const Duplicate_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7035 {
7036 return TSS_Duplicate_In_Marshalu(source, written, buffer, (uint32_t *)size);
7037 }
7038 TPM_RC
TSS_Rewrap_In_Marshal(const Rewrap_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7039 TSS_Rewrap_In_Marshal(const Rewrap_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7040 {
7041 return TSS_Rewrap_In_Marshalu(source, written, buffer, (uint32_t *)size);
7042 }
7043 TPM_RC
TSS_Import_In_Marshal(const Import_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7044 TSS_Import_In_Marshal(const Import_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7045 {
7046 return TSS_Import_In_Marshalu(source, written, buffer, (uint32_t *)size);
7047 }
7048 TPM_RC
TSS_RSA_Encrypt_In_Marshal(const RSA_Encrypt_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7049 TSS_RSA_Encrypt_In_Marshal(const RSA_Encrypt_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7050 {
7051 return TSS_RSA_Encrypt_In_Marshalu(source, written, buffer, (uint32_t *)size);
7052 }
7053 TPM_RC
TSS_RSA_Decrypt_In_Marshal(const RSA_Decrypt_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7054 TSS_RSA_Decrypt_In_Marshal(const RSA_Decrypt_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7055 {
7056 return TSS_RSA_Decrypt_In_Marshalu(source, written, buffer, (uint32_t *)size);
7057 }
7058 TPM_RC
TSS_ECDH_KeyGen_In_Marshal(const ECDH_KeyGen_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7059 TSS_ECDH_KeyGen_In_Marshal(const ECDH_KeyGen_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7060 {
7061 return TSS_ECDH_KeyGen_In_Marshalu(source, written, buffer, (uint32_t *)size);
7062 }
7063 TPM_RC
TSS_ECDH_ZGen_In_Marshal(const ECDH_ZGen_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7064 TSS_ECDH_ZGen_In_Marshal(const ECDH_ZGen_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7065 {
7066 return TSS_ECDH_ZGen_In_Marshalu(source, written, buffer, (uint32_t *)size);
7067 }
7068 TPM_RC
TSS_ECC_Parameters_In_Marshal(const ECC_Parameters_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7069 TSS_ECC_Parameters_In_Marshal(const ECC_Parameters_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7070 {
7071 return TSS_ECC_Parameters_In_Marshalu(source, written, buffer, (uint32_t *)size);
7072 }
7073 TPM_RC
TSS_ZGen_2Phase_In_Marshal(const ZGen_2Phase_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7074 TSS_ZGen_2Phase_In_Marshal(const ZGen_2Phase_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7075 {
7076 return TSS_ZGen_2Phase_In_Marshalu(source, written, buffer, (uint32_t *)size);
7077 }
7078 TPM_RC
TSS_EncryptDecrypt_In_Marshal(const EncryptDecrypt_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7079 TSS_EncryptDecrypt_In_Marshal(const EncryptDecrypt_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7080 {
7081 return TSS_EncryptDecrypt_In_Marshalu(source, written, buffer, (uint32_t *)size);
7082 }
7083 TPM_RC
TSS_EncryptDecrypt2_In_Marshal(const EncryptDecrypt2_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7084 TSS_EncryptDecrypt2_In_Marshal(const EncryptDecrypt2_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7085 {
7086 return TSS_EncryptDecrypt2_In_Marshalu(source, written, buffer, (uint32_t *)size);
7087 }
7088 TPM_RC
TSS_Hash_In_Marshal(const Hash_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7089 TSS_Hash_In_Marshal(const Hash_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7090 {
7091 return TSS_Hash_In_Marshalu(source, written, buffer, (uint32_t *)size);
7092 }
7093 TPM_RC
TSS_HMAC_In_Marshal(const HMAC_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7094 TSS_HMAC_In_Marshal(const HMAC_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7095 {
7096 return TSS_HMAC_In_Marshalu(source, written, buffer, (uint32_t *)size);
7097 }
7098 TPM_RC
TSS_GetRandom_In_Marshal(const GetRandom_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7099 TSS_GetRandom_In_Marshal(const GetRandom_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7100 {
7101 return TSS_GetRandom_In_Marshalu(source, written, buffer, (uint32_t *)size);
7102 }
7103 TPM_RC
TSS_StirRandom_In_Marshal(const StirRandom_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7104 TSS_StirRandom_In_Marshal(const StirRandom_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7105 {
7106 return TSS_StirRandom_In_Marshalu(source, written, buffer, (uint32_t *)size);
7107 }
7108 TPM_RC
TSS_HMAC_Start_In_Marshal(const HMAC_Start_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7109 TSS_HMAC_Start_In_Marshal(const HMAC_Start_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7110 {
7111 return TSS_HMAC_Start_In_Marshalu(source, written, buffer, (uint32_t *)size);
7112 }
7113 TPM_RC
TSS_HashSequenceStart_In_Marshal(const HashSequenceStart_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7114 TSS_HashSequenceStart_In_Marshal(const HashSequenceStart_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7115 {
7116 return TSS_HashSequenceStart_In_Marshalu(source, written, buffer, (uint32_t *)size);
7117 }
7118 TPM_RC
TSS_SequenceUpdate_In_Marshal(const SequenceUpdate_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7119 TSS_SequenceUpdate_In_Marshal(const SequenceUpdate_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7120 {
7121 return TSS_SequenceUpdate_In_Marshalu(source, written, buffer, (uint32_t *)size);
7122 }
7123 TPM_RC
TSS_SequenceComplete_In_Marshal(const SequenceComplete_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7124 TSS_SequenceComplete_In_Marshal(const SequenceComplete_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7125 {
7126 return TSS_SequenceComplete_In_Marshalu(source, written, buffer, (uint32_t *)size);
7127 }
7128 TPM_RC
TSS_EventSequenceComplete_In_Marshal(const EventSequenceComplete_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7129 TSS_EventSequenceComplete_In_Marshal(const EventSequenceComplete_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7130 {
7131 return TSS_EventSequenceComplete_In_Marshalu(source, written, buffer, (uint32_t *)size);
7132 }
7133 TPM_RC
TSS_Certify_In_Marshal(const Certify_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7134 TSS_Certify_In_Marshal(const Certify_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7135 {
7136 return TSS_Certify_In_Marshalu(source, written, buffer, (uint32_t *)size);
7137 }
7138 TPM_RC
TSS_CertifyCreation_In_Marshal(const CertifyCreation_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7139 TSS_CertifyCreation_In_Marshal(const CertifyCreation_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7140 {
7141 return TSS_CertifyCreation_In_Marshalu(source, written, buffer, (uint32_t *)size);
7142 }
7143 TPM_RC
TSS_Quote_In_Marshal(const Quote_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7144 TSS_Quote_In_Marshal(const Quote_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7145 {
7146 return TSS_Quote_In_Marshalu(source, written, buffer, (uint32_t *)size);
7147 }
7148 TPM_RC
TSS_GetSessionAuditDigest_In_Marshal(const GetSessionAuditDigest_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7149 TSS_GetSessionAuditDigest_In_Marshal(const GetSessionAuditDigest_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7150 {
7151 return TSS_GetSessionAuditDigest_In_Marshalu(source, written, buffer, (uint32_t *)size);
7152 }
7153 TPM_RC
TSS_GetCommandAuditDigest_In_Marshal(const GetCommandAuditDigest_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7154 TSS_GetCommandAuditDigest_In_Marshal(const GetCommandAuditDigest_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7155 {
7156 return TSS_GetCommandAuditDigest_In_Marshalu(source, written, buffer, (uint32_t *)size);
7157 }
7158 TPM_RC
TSS_GetTime_In_Marshal(const GetTime_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7159 TSS_GetTime_In_Marshal(const GetTime_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7160 {
7161 return TSS_GetTime_In_Marshalu(source, written, buffer, (uint32_t *)size);
7162 }
7163 TPM_RC
TSS_Commit_In_Marshal(const Commit_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7164 TSS_Commit_In_Marshal(const Commit_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7165 {
7166 return TSS_Commit_In_Marshalu(source, written, buffer, (uint32_t *)size);
7167 }
7168 TPM_RC
TSS_EC_Ephemeral_In_Marshal(const EC_Ephemeral_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7169 TSS_EC_Ephemeral_In_Marshal(const EC_Ephemeral_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7170 {
7171 return TSS_EC_Ephemeral_In_Marshalu(source, written, buffer, (uint32_t *)size);
7172 }
7173 TPM_RC
TSS_VerifySignature_In_Marshal(const VerifySignature_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7174 TSS_VerifySignature_In_Marshal(const VerifySignature_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7175 {
7176 return TSS_VerifySignature_In_Marshalu(source, written, buffer, (uint32_t *)size);
7177 }
7178 TPM_RC
TSS_Sign_In_Marshal(const Sign_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7179 TSS_Sign_In_Marshal(const Sign_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7180 {
7181 return TSS_Sign_In_Marshalu(source, written, buffer, (uint32_t *)size);
7182 }
7183 TPM_RC
TSS_SetCommandCodeAuditStatus_In_Marshal(const SetCommandCodeAuditStatus_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7184 TSS_SetCommandCodeAuditStatus_In_Marshal(const SetCommandCodeAuditStatus_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7185 {
7186 return TSS_SetCommandCodeAuditStatus_In_Marshalu(source, written, buffer, (uint32_t *)size);
7187 }
7188 TPM_RC
TSS_PCR_Extend_In_Marshal(const PCR_Extend_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7189 TSS_PCR_Extend_In_Marshal(const PCR_Extend_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7190 {
7191 return TSS_PCR_Extend_In_Marshalu(source, written, buffer, (uint32_t *)size);
7192 }
7193 TPM_RC
TSS_PCR_Event_In_Marshal(const PCR_Event_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7194 TSS_PCR_Event_In_Marshal(const PCR_Event_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7195 {
7196 return TSS_PCR_Event_In_Marshalu(source, written, buffer, (uint32_t *)size);
7197 }
7198 TPM_RC
TSS_PCR_Read_In_Marshal(const PCR_Read_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7199 TSS_PCR_Read_In_Marshal(const PCR_Read_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7200 {
7201 return TSS_PCR_Read_In_Marshalu(source, written, buffer, (uint32_t *)size);
7202 }
7203 TPM_RC
TSS_PCR_Allocate_In_Marshal(const PCR_Allocate_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7204 TSS_PCR_Allocate_In_Marshal(const PCR_Allocate_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7205 {
7206 return TSS_PCR_Allocate_In_Marshalu(source, written, buffer, (uint32_t *)size);
7207 }
7208 TPM_RC
TSS_PCR_SetAuthPolicy_In_Marshal(const PCR_SetAuthPolicy_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7209 TSS_PCR_SetAuthPolicy_In_Marshal(const PCR_SetAuthPolicy_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7210 {
7211 return TSS_PCR_SetAuthPolicy_In_Marshalu(source, written, buffer, (uint32_t *)size);
7212 }
7213 TPM_RC
TSS_PCR_SetAuthValue_In_Marshal(const PCR_SetAuthValue_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7214 TSS_PCR_SetAuthValue_In_Marshal(const PCR_SetAuthValue_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7215 {
7216 return TSS_PCR_SetAuthValue_In_Marshalu(source, written, buffer, (uint32_t *)size);
7217 }
7218 TPM_RC
TSS_PCR_Reset_In_Marshal(const PCR_Reset_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7219 TSS_PCR_Reset_In_Marshal(const PCR_Reset_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7220 {
7221 return TSS_PCR_Reset_In_Marshalu(source, written, buffer, (uint32_t *)size);
7222 }
7223 TPM_RC
TSS_PolicySigned_In_Marshal(const PolicySigned_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7224 TSS_PolicySigned_In_Marshal(const PolicySigned_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7225 {
7226 return TSS_PolicySigned_In_Marshalu(source, written, buffer, (uint32_t *)size);
7227 }
7228 TPM_RC
TSS_PolicySecret_In_Marshal(const PolicySecret_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7229 TSS_PolicySecret_In_Marshal(const PolicySecret_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7230 {
7231 return TSS_PolicySecret_In_Marshalu(source, written, buffer, (uint32_t *)size);
7232 }
7233 TPM_RC
TSS_PolicyTicket_In_Marshal(const PolicyTicket_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7234 TSS_PolicyTicket_In_Marshal(const PolicyTicket_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7235 {
7236 return TSS_PolicyTicket_In_Marshalu(source, written, buffer, (uint32_t *)size);
7237 }
7238 TPM_RC
TSS_PolicyOR_In_Marshal(const PolicyOR_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7239 TSS_PolicyOR_In_Marshal(const PolicyOR_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7240 {
7241 return TSS_PolicyOR_In_Marshalu(source, written, buffer, (uint32_t *)size);
7242 }
7243 TPM_RC
TSS_PolicyPCR_In_Marshal(const PolicyPCR_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7244 TSS_PolicyPCR_In_Marshal(const PolicyPCR_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7245 {
7246 return TSS_PolicyPCR_In_Marshalu(source, written, buffer, (uint32_t *)size);
7247 }
7248 TPM_RC
TSS_PolicyLocality_In_Marshal(const PolicyLocality_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7249 TSS_PolicyLocality_In_Marshal(const PolicyLocality_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7250 {
7251 return TSS_PolicyLocality_In_Marshalu(source, written, buffer, (uint32_t *)size);
7252 }
7253 TPM_RC
TSS_PolicyNV_In_Marshal(const PolicyNV_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7254 TSS_PolicyNV_In_Marshal(const PolicyNV_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7255 {
7256 return TSS_PolicyNV_In_Marshalu(source, written, buffer, (uint32_t *)size);
7257 }
7258 TPM_RC
TSS_PolicyCounterTimer_In_Marshal(const PolicyCounterTimer_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7259 TSS_PolicyCounterTimer_In_Marshal(const PolicyCounterTimer_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7260 {
7261 return TSS_PolicyCounterTimer_In_Marshalu(source, written, buffer, (uint32_t *)size);
7262 }
7263 TPM_RC
TSS_PolicyCommandCode_In_Marshal(const PolicyCommandCode_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7264 TSS_PolicyCommandCode_In_Marshal(const PolicyCommandCode_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7265 {
7266 return TSS_PolicyCommandCode_In_Marshalu(source, written, buffer, (uint32_t *)size);
7267 }
7268 TPM_RC
TSS_PolicyPhysicalPresence_In_Marshal(const PolicyPhysicalPresence_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7269 TSS_PolicyPhysicalPresence_In_Marshal(const PolicyPhysicalPresence_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7270 {
7271 return TSS_PolicyPhysicalPresence_In_Marshalu(source, written, buffer, (uint32_t *)size);
7272 }
7273 TPM_RC
TSS_PolicyCpHash_In_Marshal(const PolicyCpHash_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7274 TSS_PolicyCpHash_In_Marshal(const PolicyCpHash_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7275 {
7276 return TSS_PolicyCpHash_In_Marshalu(source, written, buffer, (uint32_t *)size);
7277 }
7278 TPM_RC
TSS_PolicyNameHash_In_Marshal(const PolicyNameHash_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7279 TSS_PolicyNameHash_In_Marshal(const PolicyNameHash_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7280 {
7281 return TSS_PolicyNameHash_In_Marshalu(source, written, buffer, (uint32_t *)size);
7282 }
7283 TPM_RC
TSS_PolicyDuplicationSelect_In_Marshal(const PolicyDuplicationSelect_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7284 TSS_PolicyDuplicationSelect_In_Marshal(const PolicyDuplicationSelect_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7285 {
7286 return TSS_PolicyDuplicationSelect_In_Marshalu(source, written, buffer, (uint32_t *)size);
7287 }
7288 TPM_RC
TSS_PolicyAuthorize_In_Marshal(const PolicyAuthorize_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7289 TSS_PolicyAuthorize_In_Marshal(const PolicyAuthorize_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7290 {
7291 return TSS_PolicyAuthorize_In_Marshalu(source, written, buffer, (uint32_t *)size);
7292 }
7293 TPM_RC
TSS_PolicyAuthValue_In_Marshal(const PolicyAuthValue_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7294 TSS_PolicyAuthValue_In_Marshal(const PolicyAuthValue_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7295 {
7296 return TSS_PolicyAuthValue_In_Marshalu(source, written, buffer, (uint32_t *)size);
7297 }
7298 TPM_RC
TSS_PolicyPassword_In_Marshal(const PolicyPassword_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7299 TSS_PolicyPassword_In_Marshal(const PolicyPassword_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7300 {
7301 return TSS_PolicyPassword_In_Marshalu(source, written, buffer, (uint32_t *)size);
7302 }
7303 TPM_RC
TSS_PolicyGetDigest_In_Marshal(const PolicyGetDigest_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7304 TSS_PolicyGetDigest_In_Marshal(const PolicyGetDigest_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7305 {
7306 return TSS_PolicyGetDigest_In_Marshalu(source, written, buffer, (uint32_t *)size);
7307 }
7308 TPM_RC
TSS_PolicyNvWritten_In_Marshal(const PolicyNvWritten_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7309 TSS_PolicyNvWritten_In_Marshal(const PolicyNvWritten_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7310 {
7311 return TSS_PolicyNvWritten_In_Marshalu(source, written, buffer, (uint32_t *)size);
7312 }
7313 TPM_RC
TSS_PolicyTemplate_In_Marshal(const PolicyTemplate_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7314 TSS_PolicyTemplate_In_Marshal(const PolicyTemplate_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7315 {
7316 return TSS_PolicyTemplate_In_Marshalu(source, written, buffer, (uint32_t *)size);
7317 }
7318 TPM_RC
TSS_PolicyAuthorizeNV_In_Marshal(const PolicyAuthorizeNV_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7319 TSS_PolicyAuthorizeNV_In_Marshal(const PolicyAuthorizeNV_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7320 {
7321 return TSS_PolicyAuthorizeNV_In_Marshalu(source, written, buffer, (uint32_t *)size);
7322 }
7323 TPM_RC
TSS_CreatePrimary_In_Marshal(const CreatePrimary_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7324 TSS_CreatePrimary_In_Marshal(const CreatePrimary_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7325 {
7326 return TSS_CreatePrimary_In_Marshalu(source, written, buffer, (uint32_t *)size);
7327 }
7328 TPM_RC
TSS_HierarchyControl_In_Marshal(const HierarchyControl_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7329 TSS_HierarchyControl_In_Marshal(const HierarchyControl_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7330 {
7331 return TSS_HierarchyControl_In_Marshalu(source, written, buffer, (uint32_t *)size);
7332 }
7333 TPM_RC
TSS_SetPrimaryPolicy_In_Marshal(const SetPrimaryPolicy_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7334 TSS_SetPrimaryPolicy_In_Marshal(const SetPrimaryPolicy_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7335 {
7336 return TSS_SetPrimaryPolicy_In_Marshalu(source, written, buffer, (uint32_t *)size);
7337 }
7338 TPM_RC
TSS_ChangePPS_In_Marshal(const ChangePPS_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7339 TSS_ChangePPS_In_Marshal(const ChangePPS_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7340 {
7341 return TSS_ChangePPS_In_Marshalu(source, written, buffer, (uint32_t *)size);
7342 }
7343 TPM_RC
TSS_ChangeEPS_In_Marshal(const ChangeEPS_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7344 TSS_ChangeEPS_In_Marshal(const ChangeEPS_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7345 {
7346 return TSS_ChangeEPS_In_Marshalu(source, written, buffer, (uint32_t *)size);
7347 }
7348 TPM_RC
TSS_Clear_In_Marshal(const Clear_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7349 TSS_Clear_In_Marshal(const Clear_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7350 {
7351 return TSS_Clear_In_Marshalu(source, written, buffer, (uint32_t *)size);
7352 }
7353 TPM_RC
TSS_ClearControl_In_Marshal(const ClearControl_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7354 TSS_ClearControl_In_Marshal(const ClearControl_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7355 {
7356 return TSS_ClearControl_In_Marshalu(source, written, buffer, (uint32_t *)size);
7357 }
7358 TPM_RC
TSS_HierarchyChangeAuth_In_Marshal(const HierarchyChangeAuth_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7359 TSS_HierarchyChangeAuth_In_Marshal(const HierarchyChangeAuth_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7360 {
7361 return TSS_HierarchyChangeAuth_In_Marshalu(source, written, buffer, (uint32_t *)size);
7362 }
7363 TPM_RC
TSS_DictionaryAttackLockReset_In_Marshal(const DictionaryAttackLockReset_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7364 TSS_DictionaryAttackLockReset_In_Marshal(const DictionaryAttackLockReset_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7365 {
7366 return TSS_DictionaryAttackLockReset_In_Marshalu(source, written, buffer, (uint32_t *)size);
7367 }
7368 TPM_RC
TSS_DictionaryAttackParameters_In_Marshal(const DictionaryAttackParameters_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7369 TSS_DictionaryAttackParameters_In_Marshal(const DictionaryAttackParameters_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7370 {
7371 return TSS_DictionaryAttackParameters_In_Marshalu(source, written, buffer, (uint32_t *)size);
7372 }
7373 TPM_RC
TSS_PP_Commands_In_Marshal(const PP_Commands_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7374 TSS_PP_Commands_In_Marshal(const PP_Commands_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7375 {
7376 return TSS_PP_Commands_In_Marshalu(source, written, buffer, (uint32_t *)size);
7377 }
7378 TPM_RC
TSS_SetAlgorithmSet_In_Marshal(const SetAlgorithmSet_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7379 TSS_SetAlgorithmSet_In_Marshal(const SetAlgorithmSet_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7380 {
7381 return TSS_SetAlgorithmSet_In_Marshalu(source, written, buffer, (uint32_t *)size);
7382 }
7383 TPM_RC
TSS_ContextSave_In_Marshal(const ContextSave_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7384 TSS_ContextSave_In_Marshal(const ContextSave_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7385 {
7386 return TSS_ContextSave_In_Marshalu(source, written, buffer, (uint32_t *)size);
7387 }
7388 TPM_RC
TSS_ContextLoad_In_Marshal(const ContextLoad_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7389 TSS_ContextLoad_In_Marshal(const ContextLoad_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7390 {
7391 return TSS_ContextLoad_In_Marshalu(source, written, buffer, (uint32_t *)size);
7392 }
7393 TPM_RC
TSS_FlushContext_In_Marshal(const FlushContext_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7394 TSS_FlushContext_In_Marshal(const FlushContext_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7395 {
7396 return TSS_FlushContext_In_Marshalu(source, written, buffer, (uint32_t *)size);
7397 }
7398 TPM_RC
TSS_EvictControl_In_Marshal(const EvictControl_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7399 TSS_EvictControl_In_Marshal(const EvictControl_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7400 {
7401 return TSS_EvictControl_In_Marshalu(source, written, buffer, (uint32_t *)size);
7402 }
7403 TPM_RC
TSS_ClockSet_In_Marshal(const ClockSet_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7404 TSS_ClockSet_In_Marshal(const ClockSet_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7405 {
7406 return TSS_ClockSet_In_Marshalu(source, written, buffer, (uint32_t *)size);
7407 }
7408 TPM_RC
TSS_ClockRateAdjust_In_Marshal(const ClockRateAdjust_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7409 TSS_ClockRateAdjust_In_Marshal(const ClockRateAdjust_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7410 {
7411 return TSS_ClockRateAdjust_In_Marshalu(source, written, buffer, (uint32_t *)size);
7412 }
7413 TPM_RC
TSS_GetCapability_In_Marshal(const GetCapability_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7414 TSS_GetCapability_In_Marshal(const GetCapability_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7415 {
7416 return TSS_GetCapability_In_Marshalu(source, written, buffer, (uint32_t *)size);
7417 }
7418 TPM_RC
TSS_TestParms_In_Marshal(const TestParms_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7419 TSS_TestParms_In_Marshal(const TestParms_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7420 {
7421 return TSS_TestParms_In_Marshalu(source, written, buffer, (uint32_t *)size);
7422 }
7423 TPM_RC
TSS_NV_DefineSpace_In_Marshal(const NV_DefineSpace_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7424 TSS_NV_DefineSpace_In_Marshal(const NV_DefineSpace_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7425 {
7426 return TSS_NV_DefineSpace_In_Marshalu(source, written, buffer, (uint32_t *)size);
7427 }
7428 TPM_RC
TSS_NV_UndefineSpace_In_Marshal(const NV_UndefineSpace_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7429 TSS_NV_UndefineSpace_In_Marshal(const NV_UndefineSpace_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7430 {
7431 return TSS_NV_UndefineSpace_In_Marshalu(source, written, buffer, (uint32_t *)size);
7432 }
7433 TPM_RC
TSS_NV_UndefineSpaceSpecial_In_Marshal(const NV_UndefineSpaceSpecial_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7434 TSS_NV_UndefineSpaceSpecial_In_Marshal(const NV_UndefineSpaceSpecial_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7435 {
7436 return TSS_NV_UndefineSpaceSpecial_In_Marshalu(source, written, buffer, (uint32_t *)size);
7437 }
7438 TPM_RC
TSS_NV_ReadPublic_In_Marshal(const NV_ReadPublic_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7439 TSS_NV_ReadPublic_In_Marshal(const NV_ReadPublic_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7440 {
7441 return TSS_NV_ReadPublic_In_Marshalu(source, written, buffer, (uint32_t *)size);
7442 }
7443 TPM_RC
TSS_NV_Write_In_Marshal(const NV_Write_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7444 TSS_NV_Write_In_Marshal(const NV_Write_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7445 {
7446 return TSS_NV_Write_In_Marshalu(source, written, buffer, (uint32_t *)size);
7447 }
7448 TPM_RC
TSS_NV_Increment_In_Marshal(const NV_Increment_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7449 TSS_NV_Increment_In_Marshal(const NV_Increment_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7450 {
7451 return TSS_NV_Increment_In_Marshalu(source, written, buffer, (uint32_t *)size);
7452 }
7453 TPM_RC
TSS_NV_Extend_In_Marshal(const NV_Extend_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7454 TSS_NV_Extend_In_Marshal(const NV_Extend_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7455 {
7456 return TSS_NV_Extend_In_Marshalu(source, written, buffer, (uint32_t *)size);
7457 }
7458 TPM_RC
TSS_NV_SetBits_In_Marshal(const NV_SetBits_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7459 TSS_NV_SetBits_In_Marshal(const NV_SetBits_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7460 {
7461 return TSS_NV_SetBits_In_Marshalu(source, written, buffer, (uint32_t *)size);
7462 }
7463 TPM_RC
TSS_NV_WriteLock_In_Marshal(const NV_WriteLock_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7464 TSS_NV_WriteLock_In_Marshal(const NV_WriteLock_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7465 {
7466 return TSS_NV_WriteLock_In_Marshalu(source, written, buffer, (uint32_t *)size);
7467 }
7468 TPM_RC
TSS_NV_GlobalWriteLock_In_Marshal(const NV_GlobalWriteLock_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7469 TSS_NV_GlobalWriteLock_In_Marshal(const NV_GlobalWriteLock_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7470 {
7471 return TSS_NV_GlobalWriteLock_In_Marshalu(source, written, buffer, (uint32_t *)size);
7472 }
7473 TPM_RC
TSS_NV_Read_In_Marshal(const NV_Read_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7474 TSS_NV_Read_In_Marshal(const NV_Read_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7475 {
7476 return TSS_NV_Read_In_Marshalu(source, written, buffer, (uint32_t *)size);
7477 }
7478 TPM_RC
TSS_NV_ReadLock_In_Marshal(const NV_ReadLock_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7479 TSS_NV_ReadLock_In_Marshal(const NV_ReadLock_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7480 {
7481 return TSS_NV_ReadLock_In_Marshalu(source, written, buffer, (uint32_t *)size);
7482 }
7483 TPM_RC
TSS_NV_ChangeAuth_In_Marshal(const NV_ChangeAuth_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7484 TSS_NV_ChangeAuth_In_Marshal(const NV_ChangeAuth_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7485 {
7486 return TSS_NV_ChangeAuth_In_Marshalu(source, written, buffer, (uint32_t *)size);
7487 }
7488 TPM_RC
TSS_NV_Certify_In_Marshal(const NV_Certify_In * source,uint16_t * written,BYTE ** buffer,int32_t * size)7489 TSS_NV_Certify_In_Marshal(const NV_Certify_In *source, uint16_t *written, BYTE **buffer, int32_t *size)
7490 {
7491 return TSS_NV_Certify_In_Marshalu(source, written, buffer, (uint32_t *)size);
7492 }
7493
7494
7495
7496 TPM_RC
TSS_IncrementalSelfTest_Out_Unmarshal(IncrementalSelfTest_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7497 TSS_IncrementalSelfTest_Out_Unmarshal(IncrementalSelfTest_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7498 {
7499 return TSS_IncrementalSelfTest_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7500 }
7501 TPM_RC
TSS_GetTestResult_Out_Unmarshal(GetTestResult_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7502 TSS_GetTestResult_Out_Unmarshal(GetTestResult_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7503 {
7504 return TSS_GetTestResult_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7505 }
7506 TPM_RC
TSS_StartAuthSession_Out_Unmarshal(StartAuthSession_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7507 TSS_StartAuthSession_Out_Unmarshal(StartAuthSession_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7508 {
7509 return TSS_StartAuthSession_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7510 }
7511 TPM_RC
TSS_Create_Out_Unmarshal(Create_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7512 TSS_Create_Out_Unmarshal(Create_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7513 {
7514 return TSS_Create_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7515 }
7516 TPM_RC
TSS_Load_Out_Unmarshal(Load_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7517 TSS_Load_Out_Unmarshal(Load_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7518 {
7519 return TSS_Load_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7520 }
7521 TPM_RC
TSS_LoadExternal_Out_Unmarshal(LoadExternal_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7522 TSS_LoadExternal_Out_Unmarshal(LoadExternal_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7523 {
7524 return TSS_LoadExternal_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7525 }
7526 TPM_RC
TSS_ReadPublic_Out_Unmarshal(ReadPublic_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7527 TSS_ReadPublic_Out_Unmarshal(ReadPublic_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7528 {
7529 return TSS_ReadPublic_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7530 }
7531 TPM_RC
TSS_ActivateCredential_Out_Unmarshal(ActivateCredential_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7532 TSS_ActivateCredential_Out_Unmarshal(ActivateCredential_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7533 {
7534 return TSS_ActivateCredential_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7535 }
7536 TPM_RC
TSS_MakeCredential_Out_Unmarshal(MakeCredential_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7537 TSS_MakeCredential_Out_Unmarshal(MakeCredential_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7538 {
7539 return TSS_MakeCredential_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7540 }
7541 TPM_RC
TSS_Unseal_Out_Unmarshal(Unseal_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7542 TSS_Unseal_Out_Unmarshal(Unseal_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7543 {
7544 return TSS_Unseal_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7545 }
7546 TPM_RC
TSS_ObjectChangeAuth_Out_Unmarshal(ObjectChangeAuth_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7547 TSS_ObjectChangeAuth_Out_Unmarshal(ObjectChangeAuth_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7548 {
7549 return TSS_ObjectChangeAuth_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7550 }
7551 TPM_RC
TSS_CreateLoaded_Out_Unmarshal(CreateLoaded_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7552 TSS_CreateLoaded_Out_Unmarshal(CreateLoaded_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7553 {
7554 return TSS_CreateLoaded_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7555 }
7556 TPM_RC
TSS_Duplicate_Out_Unmarshal(Duplicate_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7557 TSS_Duplicate_Out_Unmarshal(Duplicate_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7558 {
7559 return TSS_Duplicate_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7560 }
7561 TPM_RC
TSS_Rewrap_Out_Unmarshal(Rewrap_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7562 TSS_Rewrap_Out_Unmarshal(Rewrap_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7563 {
7564 return TSS_Rewrap_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7565 }
7566 TPM_RC
TSS_Import_Out_Unmarshal(Import_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7567 TSS_Import_Out_Unmarshal(Import_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7568 {
7569 return TSS_Import_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7570 }
7571 TPM_RC
TSS_RSA_Encrypt_Out_Unmarshal(RSA_Encrypt_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7572 TSS_RSA_Encrypt_Out_Unmarshal(RSA_Encrypt_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7573 {
7574 return TSS_RSA_Encrypt_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7575 }
7576 TPM_RC
TSS_RSA_Decrypt_Out_Unmarshal(RSA_Decrypt_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7577 TSS_RSA_Decrypt_Out_Unmarshal(RSA_Decrypt_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7578 {
7579 return TSS_RSA_Decrypt_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7580 }
7581 TPM_RC
TSS_ECDH_KeyGen_Out_Unmarshal(ECDH_KeyGen_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7582 TSS_ECDH_KeyGen_Out_Unmarshal(ECDH_KeyGen_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7583 {
7584 return TSS_ECDH_KeyGen_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7585 }
7586 TPM_RC
TSS_ECDH_ZGen_Out_Unmarshal(ECDH_ZGen_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7587 TSS_ECDH_ZGen_Out_Unmarshal(ECDH_ZGen_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7588 {
7589 return TSS_ECDH_ZGen_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7590 }
7591 TPM_RC
TSS_ECC_Parameters_Out_Unmarshal(ECC_Parameters_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7592 TSS_ECC_Parameters_Out_Unmarshal(ECC_Parameters_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7593 {
7594 return TSS_ECC_Parameters_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7595 }
7596 TPM_RC
TSS_ZGen_2Phase_Out_Unmarshal(ZGen_2Phase_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7597 TSS_ZGen_2Phase_Out_Unmarshal(ZGen_2Phase_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7598 {
7599 return TSS_ZGen_2Phase_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7600 }
7601 TPM_RC
TSS_EncryptDecrypt_Out_Unmarshal(EncryptDecrypt_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7602 TSS_EncryptDecrypt_Out_Unmarshal(EncryptDecrypt_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7603 {
7604 return TSS_EncryptDecrypt_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7605 }
7606 TPM_RC
TSS_EncryptDecrypt2_Out_Unmarshal(EncryptDecrypt2_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7607 TSS_EncryptDecrypt2_Out_Unmarshal(EncryptDecrypt2_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7608 {
7609 return TSS_EncryptDecrypt2_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7610 }
7611 TPM_RC
TSS_Hash_Out_Unmarshal(Hash_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7612 TSS_Hash_Out_Unmarshal(Hash_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7613 {
7614 return TSS_Hash_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7615 }
7616 TPM_RC
TSS_HMAC_Out_Unmarshal(HMAC_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7617 TSS_HMAC_Out_Unmarshal(HMAC_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7618 {
7619 return TSS_HMAC_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7620 }
7621 TPM_RC
TSS_GetRandom_Out_Unmarshal(GetRandom_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7622 TSS_GetRandom_Out_Unmarshal(GetRandom_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7623 {
7624 return TSS_GetRandom_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7625 }
7626 TPM_RC
TSS_HMAC_Start_Out_Unmarshal(HMAC_Start_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7627 TSS_HMAC_Start_Out_Unmarshal(HMAC_Start_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7628 {
7629 return TSS_HMAC_Start_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7630 }
7631 TPM_RC
TSS_HashSequenceStart_Out_Unmarshal(HashSequenceStart_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7632 TSS_HashSequenceStart_Out_Unmarshal(HashSequenceStart_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7633 {
7634 return TSS_HashSequenceStart_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7635 }
7636 TPM_RC
TSS_SequenceComplete_Out_Unmarshal(SequenceComplete_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7637 TSS_SequenceComplete_Out_Unmarshal(SequenceComplete_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7638 {
7639 return TSS_SequenceComplete_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7640 }
7641 TPM_RC
TSS_EventSequenceComplete_Out_Unmarshal(EventSequenceComplete_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7642 TSS_EventSequenceComplete_Out_Unmarshal(EventSequenceComplete_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7643 {
7644 return TSS_EventSequenceComplete_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7645 }
7646 TPM_RC
TSS_Certify_Out_Unmarshal(Certify_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7647 TSS_Certify_Out_Unmarshal(Certify_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7648 {
7649 return TSS_Certify_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7650 }
7651 TPM_RC
TSS_CertifyCreation_Out_Unmarshal(CertifyCreation_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7652 TSS_CertifyCreation_Out_Unmarshal(CertifyCreation_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7653 {
7654 return TSS_CertifyCreation_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7655 }
7656 TPM_RC
TSS_Quote_Out_Unmarshal(Quote_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7657 TSS_Quote_Out_Unmarshal(Quote_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7658 {
7659 return TSS_Quote_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7660 }
7661 TPM_RC
TSS_GetSessionAuditDigest_Out_Unmarshal(GetSessionAuditDigest_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7662 TSS_GetSessionAuditDigest_Out_Unmarshal(GetSessionAuditDigest_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7663 {
7664 return TSS_GetSessionAuditDigest_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7665 }
7666 TPM_RC
TSS_GetCommandAuditDigest_Out_Unmarshal(GetCommandAuditDigest_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7667 TSS_GetCommandAuditDigest_Out_Unmarshal(GetCommandAuditDigest_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7668 {
7669 return TSS_GetCommandAuditDigest_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7670 }
7671 TPM_RC
TSS_GetTime_Out_Unmarshal(GetTime_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7672 TSS_GetTime_Out_Unmarshal(GetTime_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7673 {
7674 return TSS_GetTime_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7675 }
7676 TPM_RC
TSS_Commit_Out_Unmarshal(Commit_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7677 TSS_Commit_Out_Unmarshal(Commit_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7678 {
7679 return TSS_Commit_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7680 }
7681 TPM_RC
TSS_EC_Ephemeral_Out_Unmarshal(EC_Ephemeral_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7682 TSS_EC_Ephemeral_Out_Unmarshal(EC_Ephemeral_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7683 {
7684 return TSS_EC_Ephemeral_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7685 }
7686 TPM_RC
TSS_VerifySignature_Out_Unmarshal(VerifySignature_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7687 TSS_VerifySignature_Out_Unmarshal(VerifySignature_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7688 {
7689 return TSS_VerifySignature_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7690 }
7691 TPM_RC
TSS_Sign_Out_Unmarshal(Sign_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7692 TSS_Sign_Out_Unmarshal(Sign_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7693 {
7694 return TSS_Sign_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7695 }
7696 TPM_RC
TSS_PCR_Event_Out_Unmarshal(PCR_Event_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7697 TSS_PCR_Event_Out_Unmarshal(PCR_Event_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7698 {
7699 return TSS_PCR_Event_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7700 }
7701 TPM_RC
TSS_PCR_Read_Out_Unmarshal(PCR_Read_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7702 TSS_PCR_Read_Out_Unmarshal(PCR_Read_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7703 {
7704 return TSS_PCR_Read_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7705 }
7706 TPM_RC
TSS_PCR_Allocate_Out_Unmarshal(PCR_Allocate_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7707 TSS_PCR_Allocate_Out_Unmarshal(PCR_Allocate_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7708 {
7709 return TSS_PCR_Allocate_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7710 }
7711 TPM_RC
TSS_PolicySigned_Out_Unmarshal(PolicySigned_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7712 TSS_PolicySigned_Out_Unmarshal(PolicySigned_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7713 {
7714 return TSS_PolicySigned_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7715 }
7716 TPM_RC
TSS_PolicySecret_Out_Unmarshal(PolicySecret_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7717 TSS_PolicySecret_Out_Unmarshal(PolicySecret_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7718 {
7719 return TSS_PolicySecret_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7720 }
7721 TPM_RC
TSS_PolicyGetDigest_Out_Unmarshal(PolicyGetDigest_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7722 TSS_PolicyGetDigest_Out_Unmarshal(PolicyGetDigest_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7723 {
7724 return TSS_PolicyGetDigest_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7725 }
7726 TPM_RC
TSS_CreatePrimary_Out_Unmarshal(CreatePrimary_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7727 TSS_CreatePrimary_Out_Unmarshal(CreatePrimary_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7728 {
7729 return TSS_CreatePrimary_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7730 }
7731 TPM_RC
TSS_ContextSave_Out_Unmarshal(ContextSave_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7732 TSS_ContextSave_Out_Unmarshal(ContextSave_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7733 {
7734 return TSS_ContextSave_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7735 }
7736 TPM_RC
TSS_ContextLoad_Out_Unmarshal(ContextLoad_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7737 TSS_ContextLoad_Out_Unmarshal(ContextLoad_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7738 {
7739 return TSS_ContextLoad_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7740 }
7741 TPM_RC
TSS_ReadClock_Out_Unmarshal(ReadClock_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7742 TSS_ReadClock_Out_Unmarshal(ReadClock_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7743 {
7744 return TSS_ReadClock_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7745 }
7746 TPM_RC
TSS_GetCapability_Out_Unmarshal(GetCapability_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7747 TSS_GetCapability_Out_Unmarshal(GetCapability_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7748 {
7749 return TSS_GetCapability_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7750 }
7751 TPM_RC
TSS_NV_ReadPublic_Out_Unmarshal(NV_ReadPublic_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7752 TSS_NV_ReadPublic_Out_Unmarshal(NV_ReadPublic_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7753 {
7754 return TSS_NV_ReadPublic_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7755 }
7756 TPM_RC
TSS_NV_Read_Out_Unmarshal(NV_Read_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7757 TSS_NV_Read_Out_Unmarshal(NV_Read_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7758 {
7759 return TSS_NV_Read_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7760 }
7761 TPM_RC
TSS_NV_Certify_Out_Unmarshal(NV_Certify_Out * target,TPM_ST tag,BYTE ** buffer,int32_t * size)7762 TSS_NV_Certify_Out_Unmarshal(NV_Certify_Out *target, TPM_ST tag, BYTE **buffer, int32_t *size)
7763 {
7764 return TSS_NV_Certify_Out_Unmarshalu(target, tag, buffer, (uint32_t *)size);
7765 }
7766
7767 #endif /* TPM_TSS_NODEPRECATED */
7768 #endif /* TPM 2.0 */
7769