return 0;
}
-static inline unsigned char *pack_be64(unsigned char data[], uint64_t value) {
+static inline unsigned char *pack_be64(unsigned char data[],
+ uint64_t value) {
size_t i;
for(i = 0; i < sizeof value; i++)
data[i] = (value >> ((sizeof value - 1 - i) * CHAR_BIT)) & 0xff;
// fill data with the current time divided by INTERVAL_SECONDS
pack_be64(data, time(NULL) / INTERVAL_SECONDS);
- if(HMAC(EVP_sha1(), ptr, len, data, sizeof data, ptr, &hmac_len) == NULL) {
+ if(HMAC(EVP_sha1(), ptr, len, data, sizeof data,
+ ptr, &hmac_len) == NULL) {
fprintf(stderr, "\nError: hmac.\n");
return -1;
}
i = ptr[hmac_len - 1] & 0xf;
- printf("%06"PRIu32"\n", (((ptr[i] & 0x7f) << 24) | (ptr[i + 1] << 16) |
- (ptr[i + 2] << 8) | ptr[i + 3]) % 1000000);
+ printf("%06"PRIu32"\n", (
+ ((ptr[i] & 0x7f) << 24) | (ptr[i + 1] << 16) |
+ (ptr[i + 2] << 8) | ptr[i + 3]
+ ) % 1000000);
return 0;
}