Skip to content

Commit 3d1e9de

Browse files
committed
fix(#34): use pointer
1 parent 72ab19c commit 3d1e9de

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func main() {
385385
Params: &rsa.HashedKeyGenParams{
386386
KeyGenParams: rsa.KeyGenParams{
387387
ModulusLength: 2048,
388-
PublicExponent: *big.NewInt(65537),
388+
PublicExponent: big.NewInt(65537),
389389
},
390390
Hash: "SHA-256",
391391
},

algorithms/rsa/rsa.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type KeyGenParams struct {
4444
// The length, in bits, of the RSA modulus
4545
ModulusLength uint64
4646
// The RSA public exponent
47-
PublicExponent big.Int
47+
PublicExponent *big.Int
4848
}
4949

5050
// HashedKeyGenParams is the model of the dictionary specificationn at

algorithms/rsa/rsa_oaep.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (a *oaepSubtleCrypto) generateKeyOaep(algorithm *HashedKeyGenParams, extrac
235235
alg := &KeyAlgorithm{
236236
name: rsaOaep,
237237
modulusLength: algorithm.ModulusLength,
238-
publicExponent: &algorithm.PublicExponent,
238+
publicExponent: algorithm.PublicExponent,
239239
HashedKeyAlgorithm: &HashedKeyAlgorithm{
240240
Hash: algorithm.Hash,
241241
},

algorithms/rsa/rsa_oaep_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestEncryptDecrypt(t *testing.T) {
3333
Params: &HashedKeyGenParams{
3434
KeyGenParams: KeyGenParams{
3535
ModulusLength: 2048,
36-
PublicExponent: *big.NewInt(65537),
36+
PublicExponent: big.NewInt(65537),
3737
},
3838
Hash: "SHA-256",
3939
},
@@ -69,7 +69,7 @@ func TestOaep_ExportKey(t *testing.T) {
6969
Params: &HashedKeyGenParams{
7070
KeyGenParams: KeyGenParams{
7171
ModulusLength: 2048,
72-
PublicExponent: *big.NewInt(65537),
72+
PublicExponent: big.NewInt(65537),
7373
},
7474
Hash: "SHA-256",
7575
},
@@ -164,7 +164,7 @@ func TestOaep_GenerateKey(t *testing.T) {
164164
Params: &HashedKeyGenParams{
165165
KeyGenParams: KeyGenParams{
166166
ModulusLength: 2048,
167-
PublicExponent: *big.NewInt(65537),
167+
PublicExponent: big.NewInt(65537),
168168
},
169169
Hash: "SHA-256",
170170
},
@@ -219,7 +219,7 @@ func TestOaep_GenerateKey(t *testing.T) {
219219
Params: &HashedKeyGenParams{
220220
KeyGenParams: KeyGenParams{
221221
ModulusLength: 2048,
222-
PublicExponent: *big.NewInt(65536),
222+
PublicExponent: big.NewInt(65536),
223223
},
224224
Hash: "SHA-256",
225225
},
@@ -235,7 +235,7 @@ func TestOaep_GenerateKey(t *testing.T) {
235235
Params: &HashedKeyGenParams{
236236
KeyGenParams: KeyGenParams{
237237
ModulusLength: 2048,
238-
PublicExponent: *big.NewInt(65537),
238+
PublicExponent: big.NewInt(65537),
239239
},
240240
Hash: "SHA-256",
241241
},
@@ -251,7 +251,7 @@ func TestOaep_GenerateKey(t *testing.T) {
251251
Params: &HashedKeyGenParams{
252252
KeyGenParams: KeyGenParams{
253253
ModulusLength: 2048,
254-
PublicExponent: *big.NewInt(65537),
254+
PublicExponent: big.NewInt(65537),
255255
},
256256
Hash: "SHA-256",
257257
},
@@ -269,7 +269,7 @@ func TestOaep_ImportKey(t *testing.T) {
269269
Params: &HashedKeyGenParams{
270270
KeyGenParams: KeyGenParams{
271271
ModulusLength: 2048,
272-
PublicExponent: *big.NewInt(65537),
272+
PublicExponent: big.NewInt(65537),
273273
},
274274
Hash: "SHA-256",
275275
},

examples/rsaoaep/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func main() {
1616
Params: &rsa.HashedKeyGenParams{
1717
KeyGenParams: rsa.KeyGenParams{
1818
ModulusLength: 2048,
19-
PublicExponent: *big.NewInt(65537),
19+
PublicExponent: big.NewInt(65537),
2020
},
2121
Hash: "SHA-256",
2222
},

0 commit comments

Comments
 (0)