-
Notifications
You must be signed in to change notification settings - Fork 997
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
pkg/object: support chacha20 cipher #2330
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ type Format struct { | |
Capacity uint64 `json:",omitempty"` | ||
Inodes uint64 `json:",omitempty"` | ||
EncryptKey string `json:",omitempty"` | ||
EncryptAglo string `json:",omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be |
||
KeyEncrypted bool `json:",omitempty"` | ||
TrashDays int `json:",omitempty"` | ||
MetaVersion int `json:",omitempty"` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,7 @@ func BenchmarkRSA4096Decrypt(b *testing.B) { | |
|
||
func TestAESGCM(t *testing.T) { | ||
kc := NewRSAEncryptor(testkey) | ||
dc := NewAESEncryptor(kc) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 2 return values There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add tests for ChaCha20? |
||
dc := NewDataEncryptor(kc, AES256GCM_RSA) | ||
data := []byte("hello") | ||
ciphertext, _ := dc.Encrypt(data) | ||
plaintext, _ := dc.Decrypt(ciphertext) | ||
|
@@ -139,7 +139,7 @@ func TestAESGCM(t *testing.T) { | |
func TestEncryptedStore(t *testing.T) { | ||
s, _ := CreateStorage("mem", "", "", "", "") | ||
kc := NewRSAEncryptor(testkey) | ||
dc := NewAESEncryptor(kc) | ||
dc := NewDataEncryptor(kc, AES256GCM_RSA) | ||
es := NewEncrypted(s, dc) | ||
_ = es.Put("a", bytes.NewReader([]byte("hello"))) | ||
r, err := es.Get("a", 1, 2) | ||
|
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.
This flag should be ignored like
encrypt-rsa-key
as handled in L388~L389