Skip to content

Commit

Permalink
feat(): fix pss salt
Browse files Browse the repository at this point in the history
  • Loading branch information
zyjblockchain committed Jun 23, 2021
1 parent 8f4b222 commit 2a75fc4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pss_encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package tcrsa

import (
"crypto"
"crypto/rand"
"crypto/rsa"
"errors"
"fmt"
"hash"
"io"
)

// This method was copied from SignPSS function from crypto/rsa on https://golang.org/pkg/crypto/rsa/
Expand All @@ -22,9 +20,9 @@ func PreparePssDocumentHash(privateKeySize int, hash crypto.Hash, hashed []byte,
}

salt := make([]byte, saltLength)
if _, err := io.ReadFull(rand.Reader, salt); err != nil {
return nil, err
}
// if _, err := io.ReadFull(rand.Reader, salt); err != nil {
// return nil, err
// }

nBits := privateKeySize
em, err := emsaPSSEncode(hashed, nBits-1, salt, hash.New())
Expand Down

0 comments on commit 2a75fc4

Please sign in to comment.