Skip to content

Commit 26d4f0a

Browse files
committed
fix merge issues with HMAC capitalization
1 parent 594744b commit 26d4f0a

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ golangci-lint-report.xml
3939

4040
# Ignore any other files or directories specific to your project
4141

42+
# Ignore files related to AI tools
43+
CLAUDE.md

.vscode/settings.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,25 @@
22
"sonarlint.connectedMode.project": {
33
"connectionId": "bitcoin-sv",
44
"projectKey": "bitcoin-sv_go-sdk"
5-
}
5+
},
6+
"workbench.colorCustomizations": {
7+
"activityBar.activeBackground": "#e7a213",
8+
"activityBar.background": "#e7a213",
9+
"activityBar.foreground": "#15202b",
10+
"activityBar.inactiveForeground": "#15202b99",
11+
"activityBarBadge.background": "#e2fdf4",
12+
"activityBarBadge.foreground": "#15202b",
13+
"commandCenter.border": "#15202b99",
14+
"sash.hoverBorder": "#e7a213",
15+
"statusBar.background": "#b8810f",
16+
"statusBar.foreground": "#15202b",
17+
"statusBarItem.hoverBackground": "#89600b",
18+
"statusBarItem.remoteBackground": "#b8810f",
19+
"statusBarItem.remoteForeground": "#15202b",
20+
"titleBar.activeBackground": "#b8810f",
21+
"titleBar.activeForeground": "#15202b",
22+
"titleBar.inactiveBackground": "#b8810f99",
23+
"titleBar.inactiveForeground": "#15202b99"
24+
},
25+
"peacock.color": "#b8810f"
626
}

docs/examples/create_hmac/create_hmac.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535

3636
// --- 2. Create HMAC (for Self) ---
3737
fmt.Println("\n--- 2. Creating HMAC for the message (for self) ---")
38-
createHmacArgs := wallet.CreateHmacArgs{
38+
createHmacArgs := wallet.CreateHMACArgs{
3939
EncryptionArgs: wallet.EncryptionArgs{
4040
ProtocolID: hmacProtocolID,
4141
KeyID: hmacKeyID,
@@ -45,16 +45,16 @@ func main() {
4545
},
4646
Data: wallet.JsonByteNoBase64(message),
4747
}
48-
createHmacResult, err := myWallet.CreateHmac(ctx, createHmacArgs, "creator_originator")
48+
createHmacResult, err := myWallet.CreateHMAC(ctx, createHmacArgs, "creator_originator")
4949
if err != nil {
5050
log.Fatalf("Failed to create HMAC: %v", err)
5151
}
52-
hmacBytes := createHmacResult.Hmac
52+
hmacBytes := createHmacResult.HMAC
5353
fmt.Printf("HMAC created: %x\n", hmacBytes)
5454

5555
// --- 3. Verify HMAC (by Self) ---
5656
fmt.Println("\n--- 3. Verifying the HMAC (by self) ---")
57-
verifyHmacArgs := wallet.VerifyHmacArgs{
57+
verifyHmacArgs := wallet.VerifyHMACArgs{
5858
EncryptionArgs: wallet.EncryptionArgs{
5959
ProtocolID: hmacProtocolID, // Must match creation
6060
KeyID: hmacKeyID, // Must match creation
@@ -63,9 +63,9 @@ func main() {
6363
},
6464
},
6565
Data: wallet.JsonByteNoBase64(message), // Original data
66-
Hmac: hmacBytes, // HMAC from step 2
66+
HMAC: hmacBytes, // HMAC from step 2
6767
}
68-
verifyHmacResult, err := myWallet.VerifyHmac(ctx, verifyHmacArgs, "verifier_originator")
68+
verifyHmacResult, err := myWallet.VerifyHMAC(ctx, verifyHmacArgs, "verifier_originator")
6969
if err != nil {
7070
// This path should ideally not be hit if args are correct and HMAC was just created
7171
log.Fatalf("Error during HMAC verification call: %v", err)
@@ -81,7 +81,7 @@ func main() {
8181
fmt.Println("\n--- 4. Verifying with tampered data (expected failure) ---")
8282
tamperedDataArgs := verifyHmacArgs // Copy previous args
8383
tamperedDataArgs.Data = wallet.JsonByteNoBase64([]byte("This is tampered data!"))
84-
tamperedDataVerifyResult, err := myWallet.VerifyHmac(ctx, tamperedDataArgs, "verifier_tampered_data")
84+
tamperedDataVerifyResult, err := myWallet.VerifyHMAC(ctx, tamperedDataArgs, "verifier_tampered_data")
8585
if err != nil {
8686
log.Fatalf("Error during tampered data HMAC verification call: %v", err)
8787
}
@@ -102,8 +102,8 @@ func main() {
102102
} else {
103103
corruptedHmac = append(corruptedHmac, 0x00) // Or handle if HMAC was empty (should not be)
104104
}
105-
tamperedHmacArgs.Hmac = wallet.JsonByteNoBase64(corruptedHmac)
106-
tamperedHmacVerifyResult, err := myWallet.VerifyHmac(ctx, tamperedHmacArgs, "verifier_tampered_hmac")
105+
tamperedHmacArgs.HMAC = wallet.JsonByteNoBase64(corruptedHmac)
106+
tamperedHmacVerifyResult, err := myWallet.VerifyHMAC(ctx, tamperedHmacArgs, "verifier_tampered_hmac")
107107
if err != nil {
108108
log.Fatalf("Error during tampered HMAC verification call: %v", err)
109109
}

0 commit comments

Comments
 (0)