summaryrefslogtreecommitdiff
path: root/firmware/lib/tpm_lite/include/tlcl_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib/tpm_lite/include/tlcl_internal.h')
-rw-r--r--firmware/lib/tpm_lite/include/tlcl_internal.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/firmware/lib/tpm_lite/include/tlcl_internal.h b/firmware/lib/tpm_lite/include/tlcl_internal.h
index 5db556a8..28eff1d9 100644
--- a/firmware/lib/tpm_lite/include/tlcl_internal.h
+++ b/firmware/lib/tpm_lite/include/tlcl_internal.h
@@ -16,7 +16,7 @@
#define kEncAuthLength 20
#define kPcrDigestLength 20
#define kTpmRequestAuthBlockLength \
- (sizeof(uint32_t) + sizeof(TPM_NONCE) + 1 + TPM_AUTH_DATA_LEN)
+ (sizeof(uint32_t) + sizeof(TPM_NONCE) + 1 + TPM_AUTH_DATA_LEN)
#define kTpmResponseAuthBlockLength (sizeof(TPM_NONCE) + 1 + TPM_AUTH_DATA_LEN)
@@ -28,10 +28,10 @@
*/
__attribute__((unused))
static inline void ToTpmUint32(uint8_t *buffer, uint32_t x) {
- buffer[0] = (uint8_t)(x >> 24);
- buffer[1] = (uint8_t)((x >> 16) & 0xff);
- buffer[2] = (uint8_t)((x >> 8) & 0xff);
- buffer[3] = (uint8_t)(x & 0xff);
+ buffer[0] = (uint8_t)(x >> 24);
+ buffer[1] = (uint8_t)((x >> 16) & 0xff);
+ buffer[2] = (uint8_t)((x >> 8) & 0xff);
+ buffer[3] = (uint8_t)(x & 0xff);
}
/*
@@ -39,10 +39,10 @@ static inline void ToTpmUint32(uint8_t *buffer, uint32_t x) {
*/
__attribute__((unused))
static inline void FromTpmUint32(const uint8_t *buffer, uint32_t *x) {
- *x = ((buffer[0] << 24) |
- (buffer[1] << 16) |
- (buffer[2] << 8) |
- buffer[3]);
+ *x = ((buffer[0] << 24) |
+ (buffer[1] << 16) |
+ (buffer[2] << 8) |
+ buffer[3]);
}
/*
@@ -50,10 +50,10 @@ static inline void FromTpmUint32(const uint8_t *buffer, uint32_t *x) {
*/
__attribute__((unused))
static inline uint32_t ReadTpmUint32(const uint8_t **buffer) {
- uint32_t value;
- FromTpmUint32(*buffer, &value);
- *buffer += sizeof(value);
- return value;
+ uint32_t value;
+ FromTpmUint32(*buffer, &value);
+ *buffer += sizeof(value);
+ return value;
}
/*
@@ -61,8 +61,8 @@ static inline uint32_t ReadTpmUint32(const uint8_t **buffer) {
*/
__attribute__((unused))
static inline void ToTpmUint16(uint8_t *buffer, uint16_t x) {
- buffer[0] = (uint8_t)(x >> 8);
- buffer[1] = (uint8_t)(x & 0xff);
+ buffer[0] = (uint8_t)(x >> 8);
+ buffer[1] = (uint8_t)(x & 0xff);
}
/*
@@ -70,7 +70,7 @@ static inline void ToTpmUint16(uint8_t *buffer, uint16_t x) {
*/
__attribute__((unused))
static inline void FromTpmUint16(const uint8_t *buffer, uint16_t *x) {
- *x = (buffer[0] << 8) | buffer[1];
+ *x = (buffer[0] << 8) | buffer[1];
}
/*
@@ -78,10 +78,10 @@ static inline void FromTpmUint16(const uint8_t *buffer, uint16_t *x) {
*/
__attribute__((unused))
static inline uint16_t ReadTpmUint16(const uint8_t **buffer) {
- uint16_t value;
- FromTpmUint16(*buffer, &value);
- *buffer += sizeof(value);
- return value;
+ uint16_t value;
+ FromTpmUint16(*buffer, &value);
+ *buffer += sizeof(value);
+ return value;
}
#endif /* TPM_LITE_TLCL_INTERNAL_H_ */