mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Style: format code by gofumpt (#761)
This commit is contained in:
parent
d77be80b40
commit
e286cdcaa8
111 changed files with 293 additions and 291 deletions
|
@ -290,7 +290,6 @@ func (w *AuthenticationWriter) writeStream(mb buf.MultiBuffer) error {
|
|||
mb = nb
|
||||
|
||||
eb, err := w.seal(rawBytes[:nBytes])
|
||||
|
||||
if err != nil {
|
||||
buf.ReleaseMulti(mb2Write)
|
||||
return err
|
||||
|
|
|
@ -18,7 +18,7 @@ func mustDecodeHex(s string) []byte {
|
|||
}
|
||||
|
||||
func TestChaCha20Stream(t *testing.T) {
|
||||
var cases = []struct {
|
||||
cases := []struct {
|
||||
key []byte
|
||||
iv []byte
|
||||
output []byte
|
||||
|
|
|
@ -3,7 +3,7 @@ package internal
|
|||
import "encoding/binary"
|
||||
|
||||
func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
|
||||
var x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15 = s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13], s[14], s[15]
|
||||
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15 := s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13], s[14], s[15]
|
||||
for i := 0; i < rounds; i += 2 {
|
||||
var x uint32
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
|
|||
}
|
||||
|
||||
func main() {
|
||||
file, err := os.OpenFile("chacha_core.generated.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
|
||||
file, err := os.OpenFile("chacha_core.generated.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0o644)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to generate chacha_core.go: %v", err)
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@ func (r *CryptionReader) Read(data []byte) (int, error) {
|
|||
return nBytes, err
|
||||
}
|
||||
|
||||
var (
|
||||
_ buf.Writer = (*CryptionWriter)(nil)
|
||||
)
|
||||
var _ buf.Writer = (*CryptionWriter)(nil)
|
||||
|
||||
type CryptionWriter struct {
|
||||
stream cipher.Stream
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue