microsoft / security-utilities

Security utilities for key generation, string redaction, etc.
MIT License
24 stars 9 forks source link

Rust/His: Move to a definition-index approach for interop #31

Closed beaubelgrave closed 3 months ago

beaubelgrave commented 4 months ago

The existing code would copy the name of the definition out to callers. This caused allocation and other unnecessary things to occur to determine which definition of a secret was found.

Add a new interop method to get the count of definitions in the scanner. Add a new interop method to get the name of the definition by index. Update C# to use these new interop methods to cache the definition names once, then always use the definition ID to get to an interned string for the definition.