Skip to content

Commit

Permalink
Merge branch 'master' of github.com:symbolicsoft/noiseexplorer
Browse files Browse the repository at this point in the history
  • Loading branch information
nadimkobeissi committed Aug 19, 2023
2 parents ce74d65 + fa98a6d commit cdc255e
Show file tree
Hide file tree
Showing 119 changed files with 357 additions and 119 deletions.
4 changes: 3 additions & 1 deletion implementations/go/I1K.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/I1K1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/I1N.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/I1X.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/I1X1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IK.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IK1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IKpsk1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IKpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IN.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/INpsk1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/INpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IX.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IX1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/IXpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K1K.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K1K1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K1N.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K1X.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/K1X1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KK.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KK1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KKpsk0.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KKpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KN.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KNpsk0.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KNpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KX.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KX1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/KXpsk2.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/Kpsk0.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/N.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/NK.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/NK1.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
4 changes: 3 additions & 1 deletion implementations/go/NKpsk0.noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,9 @@ func decryptWithAd(cs *cipherstate, ad []byte, ciphertext []byte) (*cipherstate,
return cs, []byte{}, false, err
}
valid, ad, plaintext := decrypt(cs.k, cs.n, ad, ciphertext)
cs = setNonce(cs, incrementNonce(cs.n))
if valid {
cs = setNonce(cs, incrementNonce(cs.n))
}
return cs, plaintext, valid, err
}

Expand Down
Loading

0 comments on commit cdc255e

Please sign in to comment.