Refine must2 and apply NewAesGcm() to all usage

This commit is contained in:
风扇滑翔翼
2025-08-10 11:20:20 +00:00
committed by GitHub
parent 0cceea75da
commit 68ae33c9e5
10 changed files with 22 additions and 70 deletions

View File

@@ -58,11 +58,7 @@ func (a *MemoryAccount) CheckIV(iv []byte) error {
}
func createAesGcm(key []byte) cipher.AEAD {
block, err := aes.NewCipher(key)
common.Must(err)
gcm, err := cipher.NewGCM(block)
common.Must(err)
return gcm
return crypto.NewAesGcm(key)
}
func createChaCha20Poly1305(key []byte) cipher.AEAD {