Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LMS: SHA-256/192 parameters #8014

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

SparkiDev
Copy link
Contributor

Description

Add support for parameter sets with SHA-256/192.

Testing

Regression tested LMS.
--enable-lms=sha256-192
--enable-lms=sha256-192,no-sha256-256

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev self-assigned this Sep 24, 2024
@dgarske dgarske requested a review from anhu September 26, 2024 15:04
@SparkiDev SparkiDev removed their assignment Oct 2, 2024
anhu
anhu previously approved these changes Oct 8, 2024
@anhu anhu requested a review from wolfSSL-Bot October 8, 2024 19:14
@anhu anhu assigned wolfSSL-Bot and unassigned anhu Oct 8, 2024
Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy would like a word...

repro locally with ../testing/git-hooks/wolfssl-multi-test.sh --verbose-analyzers --enable-git-blame --no-result-cache --test-uncommitted quantum-safe-wolfssl-all-clang-tidy

[quantum-safe-wolfssl-all-clang-tidy] [8 of 22] [a57990b49d]
    configure...   real 0m26.616s  user 0m11.851s  sys 0m16.627s
    build...a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 200)     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
./wolfssl/wolfcrypt/wc_lms.h:200:48: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
200 |     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
|                                                ^
      |                                                (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:33: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                 ^
      |                                 (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                              ^
      |                                              (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:74: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                                                          ^
      |                                                                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 210)     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:210:47: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
210 |     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
|                                               ^
      |                                               (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 236)      (((h) + 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:236:19: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
236 |      (((h) + 1) * hLen)
|                   ^
      |                   (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 240)     (((1 << (rl)) - 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:240:26: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
240 |     (((1 << (rl)) - 1) * hLen)
|                          ^
      |                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 244)     ((1 << (cb)) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:244:20: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
244 |     ((1 << (cb)) * hLen)
|                    ^
      |                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 255)     (((h) * hLen) +                             \
./wolfssl/wolfcrypt/wc_lms.h:255:13: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
255 |     (((h) * hLen) +                             \
|             ^
      |             (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|          ^
      |          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:36: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                                    ^
      |                                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 46)     (8 * hLen / (w))
/tmp/tmp.4346_11739/wolfssl_test_workdir.26271/wolfssl/wolfcrypt/src/wc_lms.c:46:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
46 |     (8 * hLen / (w))
|          ^
      |          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 75)     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
/tmp/tmp.4346_11739/wolfssl_test_workdir.26271/wolfssl/wolfcrypt/src/wc_lms.c:75:29: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
75 |     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
|                             ^
      |                             (   )
Suppressed 28 warnings (28 in non-user code).
make[2]: *** [Makefile:8032: wolfcrypt/src/src_libwolfssl_la-wc_lms.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 200)     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
./wolfssl/wolfcrypt/wc_lms.h:200:48: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
200 |     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
|                                                ^
      |                                                (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:33: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                 ^
      |                                 (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                              ^
      |                                              (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:74: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                                                          ^
      |                                                                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 210)     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:210:47: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
210 |     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
|                                               ^
      |                                               (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 236)      (((h) + 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:236:19: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
236 |      (((h) + 1) * hLen)
|                   ^
      |                   (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 240)     (((1 << (rl)) - 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:240:26: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
240 |     (((1 << (rl)) - 1) * hLen)
|                          ^
      |                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 244)     ((1 << (cb)) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:244:20: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
244 |     ((1 << (cb)) * hLen)
|                    ^
      |                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 255)     (((h) * hLen) +                             \
./wolfssl/wolfcrypt/wc_lms.h:255:13: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
255 |     (((h) * hLen) +                             \
|             ^
      |             (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|          ^
      |          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:36: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                                    ^
      |                                    (   )
Suppressed 59 warnings (28 in non-user code, 31 NOLINT).
make[2]: *** [Makefile:7175: wolfcrypt/benchmark/benchmark.o] Error 1
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 200)     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
./wolfssl/wolfcrypt/wc_lms.h:200:48: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
200 |     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
|                                                ^
      |                                                (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:33: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                 ^
      |                                 (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                              ^
      |                                              (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:74: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                                                          ^
      |                                                                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 210)     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:210:47: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
210 |     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
|                                               ^
      |                                               (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 236)      (((h) + 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:236:19: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
236 |      (((h) + 1) * hLen)
|                   ^
      |                   (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 240)     (((1 << (rl)) - 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:240:26: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
240 |     (((1 << (rl)) - 1) * hLen)
|                          ^
      |                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 244)     ((1 << (cb)) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:244:20: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
244 |     ((1 << (cb)) * hLen)
|                    ^
      |                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 255)     (((h) * hLen) +                             \
./wolfssl/wolfcrypt/wc_lms.h:255:13: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
255 |     (((h) * hLen) +                             \
|             ^
      |             (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|          ^
      |          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:36: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                                    ^
      |                                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 84)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.26271/wolfssl/wolfcrypt/src/wc_lms_impl.c:84:42: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
84 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
|                                          ^
      |                                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 89)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.26271/wolfssl/wolfcrypt/src/wc_lms_impl.c:89:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
89 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
|                                              ^
      |                                              (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 94)     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.26271/wolfssl/wolfcrypt/src/wc_lms_impl.c:94:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
94 |     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
|                                                      ^
      |                                                      (   )
Suppressed 28 warnings (28 in non-user code).
make[2]: *** [Makefile:8039: wolfcrypt/src/src_libwolfssl_la-wc_lms_impl.lo] Error 1
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 200)     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
./wolfssl/wolfcrypt/wc_lms.h:200:48: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
200 |     (LMS_TYPE_LEN + LMS_TYPE_LEN + LMS_I_LEN + hLen)
|                                                ^
      |                                                (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:33: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                 ^
      |                                 (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                              ^
      |                                              (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 204)     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:204:74: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
204 |     (LMS_Q_LEN + LMS_TYPE_LEN + hLen + (p) * hLen + LMS_TYPE_LEN + (h) * hLen)
|                                                                          ^
      |                                                                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 210)     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:210:47: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
210 |     (HSS_Q_LEN + HSS_PRIV_KEY_PARAM_SET_LEN + hLen + LMS_I_LEN)
|                                               ^
      |                                               (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 236)      (((h) + 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:236:19: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
236 |      (((h) + 1) * hLen)
|                   ^
      |                   (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 240)     (((1 << (rl)) - 1) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:240:26: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
240 |     (((1 << (rl)) - 1) * hLen)
|                          ^
      |                          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 244)     ((1 << (cb)) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:244:20: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
244 |     ((1 << (cb)) * hLen)
|                    ^
      |                    (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 255)     (((h) * hLen) +                             \
./wolfssl/wolfcrypt/wc_lms.h:255:13: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
255 |     (((h) * hLen) +                             \
|             ^
      |             (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|          ^
      |          (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 281)         (hLen + (p) * hLen)
./wolfssl/wolfcrypt/wc_lms.h:281:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
281 |         (hLen + (p) * hLen)
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:23: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                       ^
      |                       (   )
a57990b49d (<[email protected]> 2024-09-24 22:06:34 +1000 284)         (((l) - 1) * (hLen + (p) * hLen))
./wolfssl/wolfcrypt/wc_lms.h:284:36: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
284 |         (((l) - 1) * (hLen + (p) * hLen))
|                                    ^
      |                                    (   )
Suppressed 38 warnings (29 in non-user code, 9 NOLINT).

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still some left to fix:

[quantum-safe-wolfssl-all-clang-tidy] [1 of 1] [98f1460b4a]
    autogen.sh 98f1460b4a...   real 0m17.554s  user 0m15.562s  sys 0m1.010s
    configure...   real 0m26.232s  user 0m12.218s  sys 0m15.668s
    build...98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 46)     (8 * hLen / (w))
/tmp/tmp.4346_11739/wolfssl_test_workdir.28346/wolfssl/wolfcrypt/src/wc_lms.c:46:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
46 |     (8 * hLen / (w))
|          ^
      |          (   )
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 75)     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
/tmp/tmp.4346_11739/wolfssl_test_workdir.28346/wolfssl/wolfcrypt/src/wc_lms.c:75:29: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
75 |     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
|                             ^
      |                             (   )
Suppressed 28 warnings (28 in non-user code).
make[2]: *** [Makefile:8032: wolfcrypt/src/src_libwolfssl_la-wc_lms.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
Suppressed 59 warnings (28 in non-user code, 31 NOLINT).
make[2]: *** [Makefile:7175: wolfcrypt/benchmark/benchmark.o] Error 1
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 84)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.28346/wolfssl/wolfcrypt/src/wc_lms_impl.c:84:42: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
84 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
|                                          ^
      |                                          (   )
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 89)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.28346/wolfssl/wolfcrypt/src/wc_lms_impl.c:89:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
89 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
|                                              ^
      |                                              (   )
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 94)     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.28346/wolfssl/wolfcrypt/src/wc_lms_impl.c:94:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
94 |     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
|                                                      ^
      |                                                      (   )
Suppressed 28 warnings (28 in non-user code).
make[2]: *** [Makefile:8039: wolfcrypt/src/src_libwolfssl_la-wc_lms_impl.lo] Error 1
98f1460b4a (<[email protected]> 2024-09-24 22:06:34 +1000 197)     (LMS_Q_LEN + hLen + LMS_I_LEN)
./wolfssl/wolfcrypt/wc_lms.h:197:18: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
197 |     (LMS_Q_LEN + hLen + LMS_I_LEN)
|                  ^
      |                  (   )
Suppressed 38 warnings (29 in non-user code, 9 NOLINT).

@douzzer
Copy link
Contributor

douzzer commented Oct 10, 2024

retest this please

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[quantum-safe-wolfssl-all-clang-tidy] [1 of 1] [da732a0b1e]
    autogen.sh da732a0b1e...   real 0m17.137s  user 0m15.101s  sys 0m1.076s
    configure...   real 0m27.865s  user 0m12.982s  sys 0m16.609s
    build...da732a0b1e (<[email protected]> 2024-09-24 22:06:34 +1000 46)     (8 * hLen / (w))
/tmp/tmp.4346_11739/wolfssl_test_workdir.13907/wolfssl/wolfcrypt/src/wc_lms.c:46:10: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
46 |     (8 * hLen / (w))
|          ^
      |          (   )
da732a0b1e (<[email protected]> 2024-09-24 22:06:34 +1000 75)     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
/tmp/tmp.4346_11739/wolfssl_test_workdir.13907/wolfssl/wolfcrypt/src/wc_lms.c:75:29: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
75 |     (4 + (l) * (4 + 4 + 4 + hLen * (1 + (p) + (h))) +   \
|                             ^
      |                             (   )
Suppressed 28 warnings (28 in non-user code).
make[2]: *** [Makefile:8032: wolfcrypt/src/src_libwolfssl_la-wc_lms.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
da732a0b1e (<[email protected]> 2024-09-24 22:06:34 +1000 84)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.13907/wolfssl/wolfcrypt/src/wc_lms_impl.c:84:42: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
84 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
|                                          ^
      |                                          (   )
da732a0b1e (<[email protected]> 2024-09-24 22:06:34 +1000 89)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.13907/wolfssl/wolfcrypt/src/wc_lms_impl.c:89:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
89 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
|                                              ^
      |                                              (   )
da732a0b1e (<[email protected]> 2024-09-24 22:06:34 +1000 94)     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.13907/wolfssl/wolfcrypt/src/wc_lms_impl.c:94:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
94 |     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
|                                                      ^
      |                                                      (   )
Suppressed 28 warnings (28 in non-user code).

@anhu
Copy link
Member

anhu commented Oct 10, 2024

Quick points:

  • if you build with --enable-lms=sha256-192 wc_LmsKey_SetParameters() can't be used to specify sha256-192. Its not a big deal because still have wc_LmsKey_SetLmsParm()
  • For wc_LmsKey_GetParameters() the user can't tell if its 192 or not. Again, not a big deal since they can figure out by querying the public key length.

None of these are deal breakers.

@anhu
Copy link
Member

anhu commented Oct 11, 2024

Hi @SparkiDev ,

Not sure how much work this would be, but could I request 1 more parameter set?

  • LMS 256/192
  • 1 Level
  • height 20
  • winternitz 4

Copy link
Contributor

@douzzer douzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[quantum-safe-wolfssl-all-clang-tidy] [1 of 1] [45b09c25c8]
    autogen.sh 45b09c25c8...   real 0m17.262s  user 0m15.276s  sys 0m1.061s
    configure...   real 0m27.254s  user 0m12.664s  sys 0m16.285s
    build...45b09c25c8 (<[email protected]> 2024-09-24 22:06:34 +1000 84)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.10083/wolfssl/wolfcrypt/src/wc_lms_impl.c:84:42: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
84 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + hLen)
|                                          ^
      |                                          (   )
45b09c25c8 (<[email protected]> 2024-09-24 22:06:34 +1000 89)     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.10083/wolfssl/wolfcrypt/src/wc_lms_impl.c:89:46: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
89 |     (LMS_I_LEN + LMS_R_LEN + LMS_D_LEN + 2 * hLen)
|                                              ^
      |                                              (   )
45b09c25c8 (<[email protected]> 2024-09-24 22:06:34 +1000 94)     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
/tmp/tmp.4346_11739/wolfssl_test_workdir.10083/wolfssl/wolfcrypt/src/wc_lms_impl.c:94:54: warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses]
94 |     (LMS_I_LEN + LMS_Q_LEN + LMS_P_LEN + LMS_W_LEN + hLen)
|                                                      ^
      |                                                      (   )
Suppressed 28 warnings (28 in non-user code).

@SparkiDev
Copy link
Contributor Author

retest this please

douzzer
douzzer previously approved these changes Oct 15, 2024
@douzzer
Copy link
Contributor

douzzer commented Oct 15, 2024

Note, still missing @anhu 's feature reqs -- don't merge yet.

Add support for parameter sets with SHA-256/192.
@douzzer
Copy link
Contributor

douzzer commented Oct 15, 2024

@anhu 's stuff to be addressed in followup PR(s).

@SparkiDev
Copy link
Contributor Author

retest this please

@douzzer douzzer merged commit 4fd33b6 into wolfSSL:master Oct 15, 2024
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants