MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / TestEncryptDecryptAES_ShortKey

Function TestEncryptDecryptAES_ShortKey

internal/crypto/aes_test.go:72–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestEncryptDecryptAES_ShortKey(t *testing.T) {
73 // Even a short key should work properly via HKDF derivation
74 key := "short"
75 plaintext := "test data"
76
77 encrypted, err := EncryptAES(key, plaintext)
78 require.NoError(t, err)
79
80 decrypted, err := DecryptAES(key, encrypted)
81 require.NoError(t, err)
82 assert.Equal(t, plaintext, decrypted)
83}
84
85func TestEncryptDecryptAES_LongKey(t *testing.T) {
86 key := strings.Repeat("a", 100)

Callers

nothing calls this directly

Calls 2

EncryptAESFunction · 0.85
DecryptAESFunction · 0.85

Tested by

no test coverage detected