Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions kms/cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ type CipherAlgorithm int
const (
CipherAlgo_AES CipherAlgorithm = iota + 1
CipherAlgo_RSA

CipherAlgo_Provider_Specific_Base CipherAlgorithm = 65536
CipherAlgo_Provider_Specific_Top CipherAlgorithm = 165536
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, are top values necessary? Is there a concern with [base, max_int]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satoqz I guess we can range to max_int, but I'd prefer to give us more headroom and partition halfway in that case. If we have more than 64k algorithms, that's admittedly a lot, but reserving the remaining 64k...4b for provider-specific seems unbalanced.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷 fine by me.

)

func (c CipherAlgorithm) String() string {
Expand Down Expand Up @@ -65,6 +68,9 @@ const (
CipherMode_RSA_OAEP_SHA256
CipherMode_RSA_OAEP_SHA384
CipherMode_RSA_OAEP_SHA512

CipherMode_Provider_Specific_Base CipherAlgorithmMode = 65536
CipherMode_Provider_Specific_Top CipherAlgorithmMode = 165536
)

func (c CipherAlgorithmMode) String() string {
Expand Down
6 changes: 6 additions & 0 deletions kms/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const (
KeyType_EC_Private
KeyType_ED_Public
KeyType_ED_Private

KeyType_Provider_Specific_Base KeyType = 65536
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
KeyType_Provider_Specific_Base KeyType = 65536
KeyType_ProviderSpecificBase KeyType = 65536

nit, I think we can omit the underscores here as the identifier isn't made of acronyms.

KeyType_Provider_Specific_Top KeyType = 165536
)

func (k KeyType) String() string {
Expand Down Expand Up @@ -64,6 +67,9 @@ const (
Curve_P256
Curve_P384
Curve_P521

Curve_Provider_Specific_Base Curve = 65536
Curve_Provider_Specific_Top Curve = 165536
)

func (c Curve) String() string {
Expand Down
3 changes: 3 additions & 0 deletions kms/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const (
SignAlgo_EC_P384
SignAlgo_EC_P521
SignAlgo_ED

SignAlgo_Provider_Specific_Base SignAlgorithm = 65536
SignAlgo_Provider_Specific_Top SignAlgorithm = 165536
)

func (s SignAlgorithm) String() string {
Expand Down
Loading