summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>2024-02-20 23:15:15 -0300
committerMatheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>2024-02-20 23:15:15 -0300
commita99f6a716f73957c19070ec091a61f1ab8a01042 (patch)
treeac15fd3e27990c8309171d059c7e935e8441b25c
parent8a7d9326cf274003a6e92c9ca800173ec7292fec (diff)
downloadSensor-Watch-a99f6a716f73957c19070ec091a61f1ab8a01042.tar.gz
Sensor-Watch-a99f6a716f73957c19070ec091a61f1ab8a01042.tar.bz2
Sensor-Watch-a99f6a716f73957c19070ec091a61f1ab8a01042.zip
faces/totp: update example data to new structure
The data definitions are much shorter and easier to read now.
-rw-r--r--movement/watch_faces/complication/totp_face.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/movement/watch_faces/complication/totp_face.c b/movement/watch_faces/complication/totp_face.c
index 89619208..dcdc957d 100644
--- a/movement/watch_faces/complication/totp_face.c
+++ b/movement/watch_faces/complication/totp_face.c
@@ -48,27 +48,20 @@ typedef struct {
////////////////////////////////////////////////////////////////////////////////
// Enter your TOTP key data below
-static const uint8_t num_keys = 2;
-static uint8_t keys[] = {
+
+static uint8_t key_1[] = {
0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x21, 0xde, 0xad, 0xbe, 0xef, // 1 - JBSWY3DPEHPK3PXP
- 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x21, 0xde, 0xad, 0xbe, 0xef, // 2 - JBSWY3DPEHPK3PXP
-};
-static const uint8_t key_sizes[] = {
- 10,
- 10,
-};
-static const uint32_t timesteps[] = {
- 30,
- 30,
};
-static const char labels[][2] = {
- { '2', 'F' },
- { 'A', 'C' },
+
+static uint8_t key_2[] = {
+ 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x21, 0xde, 0xad, 0xbe, 0xef, // 2 - JBSWY3DPEHPK3PXP
};
-static const hmac_alg algorithms[] = {
- SHA1,
- SHA1,
+
+static totp_t totp_data[] = {
+ TOTP_INITIALIZER('2', 'F', key_1, SHA1, 30),
+ TOTP_INITIALIZER('A', 'C', key_2, SHA1, 30),
};
+
// END OF KEY DATA.
////////////////////////////////////////////////////////////////////////////////