aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-05-22 17:52:51 -0400
committerJack Lloyd <[email protected]>2017-05-22 17:52:51 -0400
commit22797129ff2f746f96d3725ab45e043c506664f3 (patch)
treee734f75b1569a6b011b2aa3946e3f8add901dc07 /src/tests/data
parent464a51e823b08ab953570645fc804c0bce87fdf4 (diff)
parent9761cd53a695c17ad444ada6f0a00fb9ad5a1256 (diff)
Merge GH #1054 Add HOTP and TOTP algorithms
Diffstat (limited to 'src/tests/data')
-rw-r--r--src/tests/data/otp/hotp.vec127
-rw-r--r--src/tests/data/otp/totp.vec19
2 files changed, 146 insertions, 0 deletions
diff --git a/src/tests/data/otp/hotp.vec b/src/tests/data/otp/hotp.vec
new file mode 100644
index 000000000..60e3d1665
--- /dev/null
+++ b/src/tests/data/otp/hotp.vec
@@ -0,0 +1,127 @@
+[SHA-1]
+
+# From RFC 4226
+
+Key = 3132333435363738393031323334353637383930
+Digits = 6
+
+Counter = 0
+OTP = 755224
+
+Counter = 1
+OTP = 287082
+
+Counter = 2
+OTP = 359152
+
+Counter = 3
+OTP = 969429
+
+Counter = 4
+OTP = 338314
+
+Counter = 5
+OTP = 254676
+
+Counter = 6
+OTP = 287922
+
+Counter = 7
+OTP = 162583
+
+Counter = 8
+OTP = 399871
+
+Counter = 9
+OTP = 520489
+
+# Long digit tests
+
+Digits = 7
+
+Counter = 7
+OTP = 2162583
+
+Counter = 8
+OTP = 3399871
+
+Digits = 8
+
+Counter = 7
+OTP = 82162583
+
+Counter = 8
+OTP = 73399871
+
+# From RFC 6238
+
+Key = 3132333435363738393031323334353637383930
+Digits = 8
+
+Counter = 1
+OTP = 94287082
+
+Counter = 37037036
+OTP = 07081804
+
+Counter = 37037037
+OTP = 14050471
+
+Counter = 41152263
+OTP = 89005924
+
+Counter = 66666666
+OTP = 69279037
+
+Counter = 666666666
+OTP = 65353130
+
+[SHA-256]
+
+# From RFC 6238
+
+Key = 3132333435363738393031323334353637383930313233343536373839303132
+Digits = 8
+
+Counter = 1
+OTP = 46119246
+
+Counter = 37037036
+OTP = 68084774
+
+Counter = 37037037
+OTP = 67062674
+
+Counter = 41152263
+OTP = 91819424
+
+Counter = 66666666
+OTP = 90698825
+
+Counter = 666666666
+OTP = 77737706
+
+[SHA-512]
+
+# From RFC 6238
+
+Key = 31323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334
+Digits = 8
+
+Counter = 1
+OTP = 90693936
+
+Counter = 37037036
+OTP = 25091201
+
+Counter = 37037037
+OTP = 99943326
+
+Counter = 41152263
+OTP = 93441116
+
+Counter = 66666666
+OTP = 38618901
+
+Counter = 666666666
+OTP = 47863826
diff --git a/src/tests/data/otp/totp.vec b/src/tests/data/otp/totp.vec
new file mode 100644
index 000000000..2247b6f14
--- /dev/null
+++ b/src/tests/data/otp/totp.vec
@@ -0,0 +1,19 @@
+[SHA-1]
+
+# From RFC 6238
+
+Key = 3132333435363738393031323334353637383930
+Digits = 8
+Timestep = 30
+
+Timestamp = 1970-01-01T00:00:59
+OTP = 94287082
+
+Timestamp = 2005-03-18T01:58:29
+OTP = 07081804
+
+Timestamp = 2009-02-13T23:31:30
+OTP = 89005924
+
+Timestamp = 2033-05-18:03:33:20
+OTP = 69279037