-
-
Notifications
You must be signed in to change notification settings - Fork 6
[enhancement] Renamed all structures to keep a consistent naming convention, fixes #49 #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement] Renamed all structures to keep a consistent naming convention, fixes #49 #50
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors cryptographic type naming conventions by adding underscores to separate words in RSA and ECC blob type names for improved consistency. The changes affect constants, struct types, function names, and documentation across the Windows CNG bcrypt keys package.
- Renamed
BCRYPT_RSAKEY_BLOBtoBCRYPT_RSA_KEY_BLOBthroughout the codebase - Renamed
BCRYPT_ECCKEY_BLOBtoBCRYPT_ECC_KEY_BLOBthroughout the codebase - Renamed RSA blob types (public, private, full private) to include underscores
- Updated all related test functions, error messages, and documentation
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| windows/cng/bcrypt/keys/types/blob_type.go | Updated RSA blob type constant names to include underscores |
| windows/cng/bcrypt/keys/headers/BCRYPT_RSA_KEY_BLOB.go | Renamed struct type and updated all methods, documentation, and error messages |
| windows/cng/bcrypt/keys/headers/BCRYPT_RSA_KEY_BLOB_test.go | Updated test function names and type references |
| windows/cng/bcrypt/keys/headers/BCRYPT_ECC_KEY_BLOB.go | Renamed struct type and updated all methods, documentation, and error messages |
| windows/cng/bcrypt/keys/headers/BCRYPT_ECC_KEY_BLOB_test.go | Updated test function names and type references |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PUBLIC_BLOB.go | Renamed struct type and updated all methods, documentation, and error messages |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PUBLIC_BLOB_test.go | Updated test function names and type references |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PRIVATE_BLOB.go | Renamed struct type and updated all methods, documentation, and error messages |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_PRIVATE_BLOB_test.go | Updated test function names and type references |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_FULLPRIVATE_BLOB.go | Renamed struct type and updated all methods, documentation, and error messages |
| windows/cng/bcrypt/keys/blob/BCRYPT_RSA_FULLPRIVATE_BLOB_test.go | Added empty test file stub |
| windows/cng/bcrypt/keys/BCRYPT_RSA_PUBLIC_KEY.go | Updated field types and documentation references |
| windows/cng/bcrypt/keys/BCRYPT_RSA_PRIVATE_KEY.go | Updated field types and documentation references |
| windows/cng/bcrypt/keys/BCRYPT_DSA_PUBLIC_KEY.go | Updated documentation references to use new RSA naming |
| windows/cng/bcrypt/keys/BCRYPT_DSA_PRIVATE_KEY.go | Updated documentation references to use new RSA naming |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header. | ||
| // It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure. |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation incorrectly refers to 'RSA public key format' and 'BCRYPT_RSA_KEY_BLOB' for a DSA key function. This should reference 'DSA public key format' and 'BCRYPT_DSA_KEY_BLOB' instead.
| // The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header. | |
| // It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure. | |
| // The function expects the byte slice to follow the DSA public key format, starting with the BCRYPT_DSA_KEY_BLOB header. | |
| // It extracts the DSA parameters (such as p, q, g, and y) from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure. |
| // The function expects the byte slice to follow the RSA PRIVATE key format, starting with the BCRYPT_RSA_KEY_BLOB header. | ||
| // It extracts the PRIVATE exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure. |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation incorrectly refers to 'RSA PRIVATE key format' and 'BCRYPT_RSA_KEY_BLOB' for a DSA key function. This should reference 'DSA PRIVATE key format' and 'BCRYPT_DSA_KEY_BLOB' instead.
| // The function expects the byte slice to follow the RSA PRIVATE key format, starting with the BCRYPT_RSA_KEY_BLOB header. | |
| // It extracts the PRIVATE exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure. | |
| // The function expects the byte slice to follow the DSA PRIVATE key format, starting with the BCRYPT_DSA_KEY_BLOB header. | |
| // It extracts the DSA private value and parameters from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure. |
No description provided.