aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/examples/totp-example.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/totp-example.c')
-rw-r--r--examples/totp-example.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/totp-example.c b/examples/totp-example.c
index 025e410..ba06e9d 100644
--- a/examples/totp-example.c
+++ b/examples/totp-example.c
@@ -220,10 +220,10 @@ int main(int argc, char * argv[])
220 220
221 // dynamically truncates hash 221 // dynamically truncates hash
222 offset = hmac_result[19] & 0x0f; 222 offset = hmac_result[19] & 0x0f;
223 bin_code = (hmac_result[offset] & 0x7f) << 24 223 bin_code = (hmac_result[offset] & 0x7f) << 24
224 | (hmac_result[offset+1] & 0xff) << 16 224 | (hmac_result[offset+1] & 0xff) << 16
225 | (hmac_result[offset+2] & 0xff) << 8 225 | (hmac_result[offset+2] & 0xff) << 8
226 | (hmac_result[offset+3] & 0xff) ; 226 | (hmac_result[offset+3] & 0xff) ;
227 227
228 // truncates code to 6 digits 228 // truncates code to 6 digits
229 totp = bin_code % 1000000; 229 totp = bin_code % 1000000;