Skip to content

Commit

Permalink
fix max computations
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncolburne committed Jan 6, 2025
1 parent 18b1fea commit 89eb4ee
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions mldsainternal.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,14 @@ func sign(parameters ParameterSet, sk, mPrime, rnd []byte) []byte {
ct0Max := int32(0)
for _, row := range ct0 {
for _, value := range row {
if ct0Max < value {
ct0Max = value
ct0 := value

if ct0 < 0 {
ct0 *= -1
}

if ct0Max < ct0 {
ct0Max = ct0
}
}
}
Expand Down Expand Up @@ -252,8 +258,14 @@ func verify(parameters ParameterSet, pk, mPrime, sigma []byte) bool {
zMax := int32(0)
for _, row := range z {
for _, value := range row {
if zMax < value {
zMax = value
zValue := value

if zValue < 0 {
zValue *= -1
}

if zMax < zValue {
zMax = zValue
}
}
}
Expand Down

0 comments on commit 89eb4ee

Please sign in to comment.