Skip to content
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

Fix for few formatting issues on repo. #69

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]++
mertakman marked this conversation as resolved.
Show resolved Hide resolved
_, 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
Loading