Skip to content

Add msvc build option and others#4

Merged
leejonghyeong merged 4 commits intomainfrom
add-msvc-build
Mar 12, 2026
Merged

Add msvc build option and others#4
leejonghyeong merged 4 commits intomainfrom
add-msvc-build

Conversation

@leejonghyeong
Copy link
Contributor

@leejonghyeong leejonghyeong commented Mar 12, 2026

  1. Build with MSVC
  2. Add safe_memzero function
  3. Fix rejection sampling range
  4. Update the copyright year

@leejonghyeong leejonghyeong requested review from a team and Copilot March 12, 2026 02:30
Copy link
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

Adds MSVC-friendly build support while introducing a secure memory-zeroing routine and fixing an off-by-one/range issue in rejection sampling.

Changes:

  • Add safe_memzero() implementation and route safe_free() through it.
  • Adjust rejection sampling loop bounds to avoid underflow and correct the sampling range.
  • Update tests/CMake/README for MSVC compatibility (VLA removal in tests, conditional libm linking).

Reviewed changes

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

Show a summary per file
File Description
test/functionality-test.c Removes VLA usage (MSVC-incompatible) by switching to heap allocation; adjusts test constants/macros.
src/alea.c Fixes rejection sampling loop bounds/range calculation.
src/alea-internal.h Declares safe_memzero() and updates safe_free() to use it.
src/alea-internal.c Adds cross-platform secure memory-zeroing implementation.
README.md Reformats build options table (currently with markdown issues).
CMakeLists.txt Adds alea-internal.c, makes libm conditional, adds MSVC link option.
.pre-commit-config.yaml Bumps pre-commit hook versions.

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: SeungjunLee <juny2400@cryptolab.co.kr>
@leejonghyeong leejonghyeong merged commit 686e640 into main Mar 12, 2026
3 checks passed
@leejonghyeong leejonghyeong deleted the add-msvc-build branch March 12, 2026 04:19
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.

4 participants