Skip to content

Commit

Permalink
fix:add fix for few format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mertakman committed Sep 30, 2024
1 parent 50e09a1 commit 0cab9ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmd/mksyscall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ func generateSyscalls() []byte {
log.Fatal(err)
}
zsys := bout.Bytes()
zsys = bytes.Replace(zsys, []byte("\"internal/syscall/windows/sysdll\""), []byte("\"github.com/microsoft/go-crypto-winnative/internal/sysdll\""), -1)
zsys = bytes.ReplaceAll(zsys, []byte("\"internal/syscall/windows/sysdll\""), []byte("\"github.com/microsoft/go-crypto-winnative/internal/sysdll\""))
return zsys
}
8 changes: 4 additions & 4 deletions internal/cryptotest/aead.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func TestAEAD(t *testing.T, mAEAD MakeAEAD) {
// Perturb the nonce and check for an error when Opening
alterNonce := make([]byte, aead.NonceSize())
copy(alterNonce, nonce)
alterNonce[len(alterNonce)-1] += 1
alterNonce[len(alterNonce)-1]++
_, err := aead.Open(nil, alterNonce, ciphertext, addData)

if err == nil {
Expand Down Expand Up @@ -308,7 +308,7 @@ func TestAEAD(t *testing.T, mAEAD MakeAEAD) {
// Perturb the Additional Data and check for an error when Opening
alterAD := make([]byte, adLen)
copy(alterAD, addData)
alterAD[len(alterAD)-1] += 1
alterAD[len(alterAD)-1]++
_, err := aead.Open(nil, nonce, ciphertext, alterAD)

if err == nil {
Expand Down Expand Up @@ -340,7 +340,7 @@ func TestAEAD(t *testing.T, mAEAD MakeAEAD) {
// Perturb the ciphertext and check for an error when Opening
alterCT := make([]byte, len(ciphertext))
copy(alterCT, ciphertext)
alterCT[len(alterCT)-1] += 1
alterCT[len(alterCT)-1]++
_, err := aead.Open(nil, nonce, alterCT, addData)

if err == nil {
Expand All @@ -353,7 +353,7 @@ func TestAEAD(t *testing.T, mAEAD MakeAEAD) {
}

// Helper function to Seal a plaintext with additional data. Checks that
// ciphertext isn't bigger than the plaintext length plus Overhead()
// ciphertext isn't bigger than the plaintext length plus Overhead().
func sealMsg(t *testing.T, aead cipher.AEAD, ciphertext, nonce, plaintext, addData []byte) []byte {
t.Helper()

Expand Down
8 changes: 4 additions & 4 deletions internal/subtle/aliasing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ var aliasingTests = []struct {
}

func testAliasing(t *testing.T, i int, x, y []byte, anyOverlap, inexactOverlap bool) {
any := subtle.AnyOverlap(x, y)
if any != anyOverlap {
t.Errorf("%d: wrong AnyOverlap result, expected %v, got %v", i, anyOverlap, any)
isOverlapping := subtle.AnyOverlap(x, y)
if isOverlapping != anyOverlap {
t.Errorf("%d: wrong AnyOverlap result, expected %v, got %v", i, anyOverlap, isOverlapping)
}
inexact := subtle.InexactOverlap(x, y)
if inexact != inexactOverlap {
t.Errorf("%d: wrong InexactOverlap result, expected %v, got %v", i, inexactOverlap, any)
t.Errorf("%d: wrong InexactOverlap result, expected %v, got %v", i, inexactOverlap, isOverlapping)
}
}

Expand Down

0 comments on commit 0cab9ad

Please sign in to comment.