Repository navigation
Plan: pure-V OpenSSL-compatible crypto with measured performance (#28447) #29271
Replies: 5 comments
Baseline clarificationUse OpenSSL 4.0.2 as the initial correctness, security, and performance The OpenSSL baseline must be recorded by exact release/source revision and Add these security tasks to the implementation plan:
|
Sequencing updateThe OpenSSL conversion is now explicitly gated on #28467. OpenSSL 4.0.2 remains the pinned correctness, security, and performance |
Revised sequenceProduction crypto integration is now gated in this order:
Perl is not a build or runtime dependency. OpenSSL 4.0.2 remains the pinned |
|
Scope correction: the pure-V OpenSSL-compatible crypto implementation is V3-only. Production crypto APIs, portable V3 fallback code, V3-native architecture kernels, differential tests against OpenSSL 4.0.2, benchmarks, and constant-time review must target V3. Existing V1 assembly PRs remain reference material, not implementation scope. |
Architecture note: keep the door open to a FIPS-shaped module boundaryNot a proposal to pursue FIPS 140-3 validation — that is lab-fee expensive and PrecedentGo 1.24 shipped Two things there are directly relevant to this issue:
Cheap now, expensive laterIf a FIPS-shaped module is ever plausible, these shape the code and are much
Suggested minimumAt least record the module-boundary decision as part of task 1 (defining the Sequencing parallel worth noting: Go went own-assembler → pure-Go+asm crypto → |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Follow-up to #28447.
Primary goal
Build a V-owned, pure-V implementation of selected OpenSSL/libcrypto
primitives, with the same observable semantics and measured performance
characteristics as OpenSSL on the same hardware.
"Pure V" means production code must not depend on the OpenSSL or C runtime
implementation. V code may use V-owned architecture-specific kernels through
the assembly paths established by #28447, with a portable V implementation
remaining available as the fallback. The first scope is libcrypto primitives;
full libssl/TLS compatibility is a separate effort.
Performance parity must be demonstrated with reproducible benchmarks rather
than claimed from instruction-level similarity. Each primitive needs a defined
OpenSSL baseline, workload, build configuration, CPU, throughput metric, and
acceptable target before optimization work is considered complete.
Context
#28447 establishes the inline and external assembly paths needed to express
hand-written crypto kernels. Production rewrites of the existing crypto
modules were intentionally out of scope and should be implemented separately
after the #28447 PR series is available.
Proposed implementation tasks
vlib/cryptoandvlib/x/crypto, select the OpenSSL/libcrypto primitivesfor the first milestone, and record API, state, error, aliasing, and
endianness behavior.
compiler, optimization flags, target CPU, provider or engine settings,
threading assumptions, and benchmark workloads so comparisons are fair.
OpenSSL at runtime. Document ownership, lifetimes, minimum lengths,
overlap behavior, alignment, and context reuse.
OpenSSL as a test oracle only; production builds must remain independent of
OpenSSL and C libraries.
Poly1305, SHA-256/SHA-512, GHASH, AES-GCM, HMAC/HKDF, and X25519. Keep
every primitive independently reviewable and preserve the generic fallback.
Cover x86 features such as AES-NI, PCLMULQDQ, AVX2, and SHA extensions, and
AArch64 features such as NEON, PMULL, and SHA extensions where applicable.
context-reuse, fallback, and cross-compiler tests. Include GCC, Clang,
MSVC/MASM where applicable, and AArch64 cross-build coverage.
the V implementation. Report latency, throughput, setup cost, allocations,
and scaling by message size; include raw results and machine configuration.
in generated code, dispatch overhead, memory behavior, and assembly ABI
boundaries before accepting an optimized path.
access, compiler transformations, and zeroization. Document what is
guaranteed and what requires platform-specific review.
benchmark methodology, and any deliberate OpenSSL API differences.
Suggested delivery phases
Acceptance criteria
dependency on OpenSSL or a C runtime implementation.
including boundary and aliasing cases.
the pinned OpenSSL baseline, with reproducible results documented.
architecture and compiler combination.
Non-goals
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
All reactions