Skip to content

Evaluate lazy initialization for Sodium size constants to avoid type-initialization lockout #59

Description

During PR #45 review, a valid concern was raised about static field initialization in PSModule/Sodium/Sodium.cs: PublicKeyBytes, SecretKeyBytes, SealBytes, and SeedBytes are populated via native P/Invoke at type initialization time. If libsodium cannot be loaded, type initialization can fail and poison the type for the process lifetime, reducing recoverability and masking diagnostics.

This follow-up should evaluate a lazy initialization approach (for example Lazy or deferred first-use resolution) so native load failures are surfaced with clearer diagnostics and can be retried in-session after remediation.

Context:

Metadata

Metadata

Assignees

No one assigned

    Labels

    MaintenanceRepository maintenance and upkeep tasks

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions