refactor: extract FFI memory adapters into separate cbmpc/ffi module#75
Merged
refactor: extract FFI memory adapters into separate cbmpc/ffi module#75
Conversation
Move C memory allocation/deallocation utilities (cmem_t, cmems_t) from core/buf and crypto/base_pki into a dedicated ffi module. This separates FFI-specific concerns from core library types and provides cleaner abstraction for Go bindings. Changes: - Create src/cbmpc/ffi with cmem_adapter.cpp/h for C memory management - Move ffi_kem_ek_t and ffi_kem_dk_t types to ffi/pki.h - Update all CGO bindings to use ffi::view() and ffi::copy_to_cmem() - Remove to_cmem/from_cmem methods from buf_t and mem_t - Remove mems_t class and related FFI conversions from core
✅ Heimdall Review Status
|
Arash-Afshar
approved these changes
Dec 15, 2025
tankbottoms
added a commit
to tankbottoms/cb-mpc
that referenced
this pull request
Mar 2, 2026
…oinbase#75) Move C memory allocation/deallocation utilities (cmem_t, cmems_t) from core/buf and crypto/base_pki into a dedicated ffi module. This separates FFI-specific concerns from core library types and provides cleaner abstraction for Go bindings. Changes: - Create src/cbmpc/ffi with cmem_adapter.cpp/h for C memory management - Move ffi_kem_ek_t and ffi_kem_dk_t types to ffi/pki.h - Update all CGO bindings to use ffi::view() and ffi::copy_to_cmem() - Remove to_cmem/from_cmem methods from buf_t and mem_t - Remove mems_t class and related FFI conversions from core
tankbottoms
pushed a commit
to tankbottoms/cb-mpc
that referenced
this pull request
Mar 15, 2026
…oinbase#75) Move C memory allocation/deallocation utilities (cmem_t, cmems_t) from core/buf and crypto/base_pki into a dedicated ffi module. This separates FFI-specific concerns from core library types and provides cleaner abstraction for Go bindings. Changes: - Create src/cbmpc/ffi with cmem_adapter.cpp/h for C memory management - Move ffi_kem_ek_t and ffi_kem_dk_t types to ffi/pki.h - Update all CGO bindings to use ffi::view() and ffi::copy_to_cmem() - Remove to_cmem/from_cmem methods from buf_t and mem_t - Remove mems_t class and related FFI conversions from core
dafisher2000
added a commit
to IntegraLedger/cb-mpc
that referenced
this pull request
Mar 23, 2026
Merge coinbase/cb-mpc master (cb60753) into Integra fork: - PR coinbase#88: constant-time hardening, input validation, prove() error returns - PR coinbase#84: ZK proof hardening, Fischlin parameter validation - PR coinbase#75: FFI module extraction (mem_t → ffi::view) - PR coinbase#71-76: benchmarks, refactoring, CI improvements Integra customizations preserved: - derive_child_key() asymmetric HD derivation - MarshalBinary/UnmarshalECDSA2PCKey/DeriveChild Go API - P2 server-first protocol support - WASM build support Post-merge adaptations: - Custom CGO bindings updated to use ffi::view() pattern (2 call sites) - WASM rebuilt with Emscripten (includes Node.js environment support) - Dockerfile.wasm-build added for reproducible WASM builds Validated: 19/19 C++ tests, 11/11 Go tests, interactive keygen+sign+derive (Go P1 ↔ Go P2, WASM P2 ↔ Go P1) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move C memory allocation/deallocation utilities (cmem_t, cmems_t) from
core/buf and crypto/base_pki into a dedicated ffi module. This separates
FFI-specific concerns from core library types and provides cleaner
abstraction for Go bindings.
Changes: