rsaPSSParameters is used to generate the RSA PSS parameters based on a given hash. It constructs a structure based on the hash and marshals it using encoding/asn1. Given there are only three possible input hashes it's somewhat heavyweight for what it does, and could be replaced by hardcoding the three possible DER parameter encodings that can be generated and picking one based on the hash.
This would also simplify the necessity for error handling that comes with calling asn1.Marshal (see https://go-review.googlesource.com/c/go/+/252557/).
rsaPSSParametersis used to generate the RSA PSS parameters based on a given hash. It constructs a structure based on the hash and marshals it usingencoding/asn1. Given there are only three possible input hashes it's somewhat heavyweight for what it does, and could be replaced by hardcoding the three possible DER parameter encodings that can be generated and picking one based on the hash.This would also simplify the necessity for error handling that comes with calling
asn1.Marshal(see https://go-review.googlesource.com/c/go/+/252557/).