@@ -195,11 +195,11 @@ func (ctx rsaEncrypterVerifier) encryptKey(cek []byte, alg KeyAlgorithm) (recipi
195
195
func (ctx rsaEncrypterVerifier ) encrypt (cek []byte , alg KeyAlgorithm ) ([]byte , error ) {
196
196
switch alg {
197
197
case RSA1_5 :
198
- return rsa .EncryptPKCS1v15 (randReader , ctx .publicKey , cek )
198
+ return rsa .EncryptPKCS1v15 (RandReader , ctx .publicKey , cek )
199
199
case RSA_OAEP :
200
- return rsa .EncryptOAEP (sha1 .New (), randReader , ctx .publicKey , cek , []byte {})
200
+ return rsa .EncryptOAEP (sha1 .New (), RandReader , ctx .publicKey , cek , []byte {})
201
201
case RSA_OAEP_256 :
202
- return rsa .EncryptOAEP (sha256 .New (), randReader , ctx .publicKey , cek , []byte {})
202
+ return rsa .EncryptOAEP (sha256 .New (), RandReader , ctx .publicKey , cek , []byte {})
203
203
}
204
204
205
205
return nil , ErrUnsupportedAlgorithm
@@ -285,9 +285,9 @@ func (ctx rsaDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm
285
285
286
286
switch alg {
287
287
case RS256 , RS384 , RS512 :
288
- out , err = rsa .SignPKCS1v15 (randReader , ctx .privateKey , hash , hashed )
288
+ out , err = rsa .SignPKCS1v15 (RandReader , ctx .privateKey , hash , hashed )
289
289
case PS256 , PS384 , PS512 :
290
- out , err = rsa .SignPSS (randReader , ctx .privateKey , hash , hashed , & rsa.PSSOptions {
290
+ out , err = rsa .SignPSS (RandReader , ctx .privateKey , hash , hashed , & rsa.PSSOptions {
291
291
SaltLength : rsa .PSSSaltLengthAuto ,
292
292
})
293
293
}
@@ -388,7 +388,7 @@ func (ctx ecKeyGenerator) keySize() int {
388
388
389
389
// Get a content encryption key for ECDH-ES
390
390
func (ctx ecKeyGenerator ) genKey () ([]byte , rawHeader , error ) {
391
- priv , err := ecdsa .GenerateKey (ctx .publicKey .Curve , randReader )
391
+ priv , err := ecdsa .GenerateKey (ctx .publicKey .Curve , RandReader )
392
392
if err != nil {
393
393
return nil , rawHeader {}, err
394
394
}
@@ -472,7 +472,7 @@ func (ctx edDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm)
472
472
return Signature {}, ErrUnsupportedAlgorithm
473
473
}
474
474
475
- sig , err := ctx .privateKey .Sign (randReader , payload , crypto .Hash (0 ))
475
+ sig , err := ctx .privateKey .Sign (RandReader , payload , crypto .Hash (0 ))
476
476
if err != nil {
477
477
return Signature {}, err
478
478
}
@@ -522,7 +522,7 @@ func (ctx ecDecrypterSigner) signPayload(payload []byte, alg SignatureAlgorithm)
522
522
_ , _ = hasher .Write (payload )
523
523
hashed := hasher .Sum (nil )
524
524
525
- r , s , err := ecdsa .Sign (randReader , ctx .privateKey , hashed )
525
+ r , s , err := ecdsa .Sign (RandReader , ctx .privateKey , hashed )
526
526
if err != nil {
527
527
return Signature {}, err
528
528
}
0 commit comments