Skip to content

Commit

Permalink
reuse encodeBigInt
Browse files Browse the repository at this point in the history
  • Loading branch information
qmuntal committed Jan 17, 2024
1 parent dcb7c7a commit d4c1ed9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cng/dsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,11 @@ func dsaAdjustHashSize(hkey bcrypt.KEY_HANDLE, hashed []byte, buf []byte) ([]byt
if groupSize < len(hashed) {
return hashed[:groupSize], nil
}
zeroByteCount := groupSize - len(hashed)
for i := 0; i < zeroByteCount; i++ {
buf[i] = 0
if err := encodeBigInt(buf, []sizedBigInt{
{hashed, uint32(groupSize)},
}); err != nil {
return nil, err
}
copy(buf[zeroByteCount:], hashed)
return buf[:groupSize], nil
}

Expand Down

0 comments on commit d4c1ed9

Please sign in to comment.