Welcome to little lamb

Code » ssp » commit ad7573d

Internal changes

author Olivier Brunel
2023-04-23 15:26:53 UTC
committer Olivier Brunel
2023-04-25 15:02:08 UTC
parent 3a4a2dc5a907620bd89a26353d0e263186d2a3cd

Internal changes

Don't need to play with bits here, especially since alignment brings us
further anyways.

src/include/ssp.h +4 -5

diff --git a/src/include/ssp.h b/src/include/ssp.h
index fac4f72..2c73bf0 100644
--- a/src/include/ssp.h
+++ b/src/include/ssp.h
@@ -35,7 +35,7 @@ struct ssp {
 enum {
     TYPE_COUNTER = 0,
     TYPE_TIME,
-    TYPE_UNKNOWN = (1 << 2) - 1 /* max for 2 bits */
+    TYPE_UNKNOWN = (u8) -1
 };
 
 enum {
@@ -46,7 +46,7 @@ enum {
     ALGO_SHA3_256,
     ALGO_SHA3_512,
     ALGO_BLAKE3,
-    ALGO_UNKNOWN = (1 << 4) - 1 /* max for 4 bits */
+    ALGO_UNKNOWN = (u8) -1
 };
 
 extern const char *algos[];
@@ -54,9 +54,8 @@ extern const char *algos[];
 struct otp
 {
     size_t slen; /* length of secret within data; or offset to comments */
-    u8 type     : 2;
-    u8 algo     : 4;
-    u8 _unused  : 2;
+    u8 type;
+    u8 algo;
     union {
         u8 precision;
         u8 digits;