| // This file was extracted from the TCG Published |
| // Trusted Platform Module Library |
| // Part 4: Supporting Routines |
| // Level 00 Revision 01.16 |
| #include "TpmBuildSwitches.h" |
| const char notReallyUnique[] = |
| "This is not really a unique value. A real unique value should" |
| " be generated by the platform."; |
| // This function is used to access the platform-specific unique value. This function places the unique value |
| // in the provided buffer (b) and returns the number of bytes transferred. The function will not copy more |
| // NOTE: If a platform unique value has unequal distribution of uniqueness and bSize is smaller than the size of the |
| // unique value, the bSize portion with the most uniqueness should be returned. |
| uint32_t which, // authorities (0) or details |
| uint32_t bSize, // size of the buffer |
| unsigned char *b // output buffer |
| const char *from = notReallyUnique; |
| if(which == 0) // the authorities value |
| *from != 0 && retVal < bSize; |
| #define uSize sizeof(notReallyUnique) |
| b = &b[((bSize < uSize) ? bSize : uSize) - 1]; |
| *from != 0 && retVal < bSize; |