Skip to content

Set hashType in ports#10193

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
padelsbach:set-hashtype-in-ports
Apr 23, 2026
Merged

Set hashType in ports#10193
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
padelsbach:set-hashtype-in-ports

Conversation

@padelsbach
Copy link
Copy Markdown
Contributor

@padelsbach padelsbach commented Apr 10, 2026

Description

Ensures hashType is set for port implementations so downstream logic can differentiate between the sha512 modes.

Testing

How did you test?

Checklist

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

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10193

Scan targets checked: wolfcrypt-api_misuse, wolfcrypt-bugs, wolfcrypt-compliance, wolfcrypt-concurrency, wolfcrypt-consttime, wolfcrypt-defaults, wolfcrypt-mutation, wolfcrypt-port, wolfcrypt-port-bugs, wolfcrypt-portability, wolfcrypt-proptest, wolfcrypt-src, wolfcrypt-zeroize

No new issues found in the changed files. ✅

@padelsbach padelsbach marked this pull request as ready for review April 13, 2026 20:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR ensures wc_Sha512 port-specific initializers populate hashType so downstream logic can distinguish SHA-512 variants (SHA-512, SHA-512/224, SHA-512/256).

Changes:

  • Set sha->hashType in multiple port wc_InitSha512*_ex implementations when WOLFSSL_SHA512_HASHTYPE is enabled.
  • Add hashType initialization for STM32 SHA-512/224 and SHA-512/256 init paths.
  • Adjust several init functions to capture/init return codes before conditionally setting hashType.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wolfcrypt/src/sha512.c Sets hashType for SE050 and STM32 SHA-512 family init paths.
wolfcrypt/src/port/silabs/silabs_hash.c Sets hashType after successful Silicon Labs SHA-512 init.
wolfcrypt/src/port/riscv/riscv-64-sha512.c Sets hashType for RISC-V SHA-512 /224 /256 init paths.
wolfcrypt/src/port/maxim/max3266x.c Sets hashType during MAX3266X SHA-512 initialization.
wolfcrypt/src/port/kcapi/kcapi_hash.c Sets hashType for KCAPI SHA-512 /224 /256 init paths; updates variant comments.
wolfcrypt/src/port/cypress/psoc6_crypto.c Sets hashType for PSoC6 SHA-512 /224 /256 init paths.
wolfcrypt/src/port/caam/caam_sha.c Sets hashType after successful CAAM SHA-512 init.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/src/sha512.c
@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@JacobBarthelmeh
Copy link
Copy Markdown
Contributor

Retest this please Jenkins

@JacobBarthelmeh JacobBarthelmeh merged commit fe8541c into wolfSSL:master Apr 23, 2026
458 of 460 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants