Functional Weave
Code in Rust

auth.totp@1.0.0

vectors.json

17,978 bytes · view raw

[
  {"fn": "totpSecret", "name": "20 random bytes, the usual size, are 32 characters", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]], "expect": "AAAQEAYEAUDAOCAJBIFQYDIOB4IBCEQT"},
  {"fn": "totpSecret", "name": "16 bytes, the least accepted (RFC 4226 R6: 128 bits)", "args": [[255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240]], "expect": "777P37H37L47R57W6X2PH4XR6A"},
  {"fn": "totpSecret", "name": "the RFC 4226 test secret", "args": [[49, 50, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 48]], "expect": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ"},
  {"fn": "totpSecret", "name": "32 bytes need no padding character either way, 52 characters unpadded", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]], "expect": "AAAQEAYEAUDAOCAJBIFQYDIOB4IBCEQTCQKRMFYYDENBWHA5DYPQ"},
  {"fn": "totpSecret", "name": "15 bytes are too few", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]], "expectError": "randomBytes must hold at least 16 bytes (128 bits)"},
  {"fn": "totpSecret", "name": "no bytes at all", "args": [[]], "expectError": "randomBytes must hold at least 16 bytes (128 bits)"},
  {"fn": "totpSecret", "name": "a value above 255", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 300]], "expectError": "randomBytes must be a list of integers from 0 to 255"},
  {"fn": "totpSecret", "name": "a fraction is not a byte", "args": [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1.5]], "expectError": "randomBytes must be a list of integers from 0 to 255"},
  {"fn": "totpUri", "name": "the usual QR code: SHA1, 6 digits, 30 seconds", "args": ["Acme", "ada@example.com", "JBSWY3DPEHPK3PXP", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "otpauth://totp/Acme:ada%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=Acme&algorithm=SHA1&digits=6&period=30"},
  {"fn": "totpUri", "name": "spaces and an at sign are percent-encoded in the label and the issuer", "args": ["Acme Corp", "ada lovelace@example.com", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "otpauth://totp/Acme%20Corp:ada%20lovelace%40example.com?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&issuer=Acme%20Corp&algorithm=SHA1&digits=6&period=30"},
  {"fn": "totpUri", "name": "a lower-case, padded secret is written back canonical", "args": ["Acme", "ada", "gezdgnbvgy3tqojqgezdgnbvgy3tqojq", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "otpauth://totp/Acme:ada?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&issuer=Acme&algorithm=SHA1&digits=6&period=30"},
  {"fn": "totpUri", "name": "SHA256, 8 digits, 60 seconds", "args": ["Acme", "ada", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", {"algorithm": "SHA256", "digits": 8, "period": 60}], "expect": "otpauth://totp/Acme:ada?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA&issuer=Acme&algorithm=SHA256&digits=8&period=60"},
  {"fn": "totpUri", "name": "non-ASCII text is percent-encoded as UTF-8", "args": ["Café Ltd", "zoë@example.com", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "otpauth://totp/Caf%C3%A9%20Ltd:zo%C3%AB%40example.com?secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ&issuer=Caf%C3%A9%20Ltd&algorithm=SHA1&digits=6&period=30"},
  {"fn": "totpUri", "name": "a colon in the issuer would break the label", "args": ["Acme:Corp", "ada", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "issuer must not contain a colon"},
  {"fn": "totpUri", "name": "a colon in the account", "args": ["Acme", "ada:1", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "account must not contain a colon"},
  {"fn": "totpUri", "name": "an empty issuer", "args": ["", "ada", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "issuer must not be empty"},
  {"fn": "totpUri", "name": "an empty account", "args": ["Acme", "", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "account must not be empty"},
  {"fn": "totpUri", "name": "a secret that is not base32", "args": ["Acme", "ada", "JBSW Y3DP", {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "base32 text may only contain A-Z and 2-7"},
  {"fn": "totpUri", "name": "5 digits is not a code length authenticators show", "args": ["Acme", "ada", "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", {"algorithm": "SHA1", "digits": 5, "period": 30}], "expectError": "digits must be 6, 7 or 8"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 0", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 0, 6, "SHA1"], "expect": "755224"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 1", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1, 6, "SHA1"], "expect": "287082"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 2", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 2, 6, "SHA1"], "expect": "359152"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 3", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 3, 6, "SHA1"], "expect": "969429"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 4", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 4, 6, "SHA1"], "expect": "338314"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 5", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 5, 6, "SHA1"], "expect": "254676"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 6", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 6, 6, "SHA1"], "expect": "287922"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 7", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 7, 6, "SHA1"], "expect": "162583"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 8", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 8, 6, "SHA1"], "expect": "399871"},
  {"fn": "hotpCode", "name": "RFC 4226 Appendix D: counter 9", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 9, 6, "SHA1"], "expect": "520489"},
  {"fn": "hotpCode", "name": "8 digits at counter 0 (reference: Python hmac)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 0, 8, "SHA1"], "expect": "84755224"},
  {"fn": "hotpCode", "name": "SHA256 at counter 1 (reference: Python hmac)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 1, 6, "SHA256"], "expect": "119246"},
  {"fn": "hotpCode", "name": "a counter above 2^32 uses all eight counter bytes (reference: Python hmac)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 4294967297, 6, "SHA1"], "expect": "108930"},
  {"fn": "hotpCode", "name": "the largest counter, 2^53 - 1 (reference: Python hmac)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 9007199254740991, 6, "SHA1"], "expect": "891307"},
  {"fn": "hotpCode", "name": "a negative counter", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", -1, 6, "SHA1"], "expectError": "counter must be a whole number from 0 to 2^53 - 1"},
  {"fn": "hotpCode", "name": "a fractional counter", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1.5, 6, "SHA1"], "expectError": "counter must be a whole number from 0 to 2^53 - 1"},
  {"fn": "hotpCode", "name": "9 digits", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 0, 9, "SHA1"], "expectError": "digits must be 6, 7 or 8"},
  {"fn": "hotpCode", "name": "SHA512 is not offered", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 0, 6, "SHA512"], "expectError": "algorithm must be SHA1 or SHA256"},
  {"fn": "hotpCode", "name": "a secret under 80 bits", "args": ["AAAAAAAAAAAAAAA", 0, 6, "SHA1"], "expectError": "secret must decode to at least 10 bytes"},
  {"fn": "hotpCode", "name": "a secret with a trailing newline", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ\n", 0, 6, "SHA1"], "expectError": "base32 text may only contain A-Z and 2-7"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 59", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 59, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "94287082"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 59", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 59, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "46119246"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 1111111109", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1111111109, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "07081804"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 1111111109", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 1111111109, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "68084774"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 1111111111", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1111111111, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "14050471"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 1111111111", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 1111111111, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "67062674"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 1234567890", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1234567890, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "89005924"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 1234567890", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 1234567890, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "91819424"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 2000000000", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 2000000000, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "69279037"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 2000000000", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 2000000000, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "90698825"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA1 at 20000000000", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 20000000000, {"algorithm": "SHA1", "digits": 8, "period": 30}], "expect": "65353130"},
  {"fn": "totpCode", "name": "RFC 6238 Appendix B: SHA256 at 20000000000", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", 20000000000, {"algorithm": "SHA256", "digits": 8, "period": 30}], "expect": "77737706"},
  {"fn": "totpCode", "name": "6 digits, the last second of a step (59 is still step 1)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 59, {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "287082"},
  {"fn": "totpCode", "name": "the first second of the next step", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 60, {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "359152"},
  {"fn": "totpCode", "name": "time zero is step zero", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 0, {"algorithm": "SHA1", "digits": 6, "period": 30}], "expect": "755224"},
  {"fn": "totpCode", "name": "a 60-second period halves the step (reference: Python hmac)", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 60}], "expect": "360094"},
  {"fn": "totpCode", "name": "a time before 1970", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", -1, {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "now must be a whole number of seconds from 0 to 2^53 - 1"},
  {"fn": "totpCode", "name": "a period of 0", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 59, {"algorithm": "SHA1", "digits": 6, "period": 0}], "expectError": "period must be a whole number of seconds, 1 or more"},
  {"fn": "totpCode", "name": "a fractional time", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 59.5, {"algorithm": "SHA1", "digits": 6, "period": 30}], "expectError": "now must be a whole number of seconds from 0 to 2^53 - 1"},
  {"fn": "verifyTotp", "name": "the current code is valid, no drift", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 37037037, "drift": 0, "reason": null}},
  {"fn": "verifyTotp", "name": "the previous step's code inside a window of 1, drift -1", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "081804", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 37037036, "drift": -1, "reason": null}},
  {"fn": "verifyTotp", "name": "the next step's code, drift +1", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "266759", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 37037038, "drift": 1, "reason": null}},
  {"fn": "verifyTotp", "name": "two steps old is outside a window of 1", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "731029", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "wrong_code"}},
  {"fn": "verifyTotp", "name": "a stored drift of -2 centres the window: two steps old is now the middle", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "731029", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 0, -2, null], "expect": {"valid": true, "step": 37037035, "drift": -2, "reason": null}},
  {"fn": "verifyTotp", "name": "window 0 accepts only the centre", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "266759", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 0, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "wrong_code"}},
  {"fn": "verifyTotp", "name": "spaces in a typed code are ignored", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050 471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 37037037, "drift": 0, "reason": null}},
  {"fn": "verifyTotp", "name": "the code already used at this step is replayed", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, 37037037], "expect": {"valid": false, "step": null, "drift": null, "reason": "replayed"}},
  {"fn": "verifyTotp", "name": "a later step than the last one used is fine", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "266759", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, 37037037], "expect": {"valid": true, "step": 37037038, "drift": 1, "reason": null}},
  {"fn": "verifyTotp", "name": "an older code after a newer one was used is replayed", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "081804", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, 37037037], "expect": {"valid": false, "step": null, "drift": null, "reason": "replayed"}},
  {"fn": "verifyTotp", "name": "five digits is malformed, not wrong", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "05047", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "malformed_code"}},
  {"fn": "verifyTotp", "name": "letters are malformed", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "12a456", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "malformed_code"}},
  {"fn": "verifyTotp", "name": "full-width digits are malformed", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "123456", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "malformed_code"}},
  {"fn": "verifyTotp", "name": "a code that matches no step in the window", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "000000", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": false, "step": null, "drift": null, "reason": "wrong_code"}},
  {"fn": "verifyTotp", "name": "at time zero the window never reaches a negative step", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "755224", 0, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 0, "drift": 0, "reason": null}},
  {"fn": "verifyTotp", "name": "RFC 6238 SHA256, 8 digits, at 2000000000", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQGEZA", "90698825", 2000000000, {"algorithm": "SHA256", "digits": 8, "period": 30}, 1, 0, null], "expect": {"valid": true, "step": 66666666, "drift": 0, "reason": null}},
  {"fn": "verifyTotp", "name": "a window of 11 is too wide", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 11, 0, null], "expectError": "window must be a whole number from 0 to 10"},
  {"fn": "verifyTotp", "name": "a negative window", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, -1, 0, null], "expectError": "window must be a whole number from 0 to 10"},
  {"fn": "verifyTotp", "name": "a drift beyond 1000 steps", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 1001, null], "expectError": "drift must be a whole number from -1000 to 1000"},
  {"fn": "verifyTotp", "name": "a fractional last used step", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, 1.5], "expectError": "lastUsedStep must be a whole number or null"},
  {"fn": "verifyTotp", "name": "the code as a number rather than text", "args": ["GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ", 123456, 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expectError": "code must be text"},
  {"fn": "verifyTotp", "name": "a secret that is too short is an error, not a wrong code", "args": ["AAAAAAAA", "050471", 1111111111, {"algorithm": "SHA1", "digits": 6, "period": 30}, 1, 0, null], "expectError": "secret must decode to at least 10 bytes"}
]