Skip to content

Commit

Permalink
Merge pull request #35 from armortal/34-update-rsa-publicexponent
Browse files Browse the repository at this point in the history
fix(#34): use pointer
  • Loading branch information
stevencedro authored Apr 14, 2024
2 parents 72ab19c + 3d1e9de commit c7b923a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func main() {
Params: &rsa.HashedKeyGenParams{
KeyGenParams: rsa.KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down
2 changes: 1 addition & 1 deletion algorithms/rsa/rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type KeyGenParams struct {
// The length, in bits, of the RSA modulus
ModulusLength uint64
// The RSA public exponent
PublicExponent big.Int
PublicExponent *big.Int
}

// HashedKeyGenParams is the model of the dictionary specificationn at
Expand Down
2 changes: 1 addition & 1 deletion algorithms/rsa/rsa_oaep.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (a *oaepSubtleCrypto) generateKeyOaep(algorithm *HashedKeyGenParams, extrac
alg := &KeyAlgorithm{
name: rsaOaep,
modulusLength: algorithm.ModulusLength,
publicExponent: &algorithm.PublicExponent,
publicExponent: algorithm.PublicExponent,
HashedKeyAlgorithm: &HashedKeyAlgorithm{
Hash: algorithm.Hash,
},
Expand Down
14 changes: 7 additions & 7 deletions algorithms/rsa/rsa_oaep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestEncryptDecrypt(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down Expand Up @@ -69,7 +69,7 @@ func TestOaep_ExportKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestOaep_GenerateKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down Expand Up @@ -219,7 +219,7 @@ func TestOaep_GenerateKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65536),
PublicExponent: big.NewInt(65536),
},
Hash: "SHA-256",
},
Expand All @@ -235,7 +235,7 @@ func TestOaep_GenerateKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand All @@ -251,7 +251,7 @@ func TestOaep_GenerateKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand All @@ -269,7 +269,7 @@ func TestOaep_ImportKey(t *testing.T) {
Params: &HashedKeyGenParams{
KeyGenParams: KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down
2 changes: 1 addition & 1 deletion examples/rsaoaep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
Params: &rsa.HashedKeyGenParams{
KeyGenParams: rsa.KeyGenParams{
ModulusLength: 2048,
PublicExponent: *big.NewInt(65537),
PublicExponent: big.NewInt(65537),
},
Hash: "SHA-256",
},
Expand Down

0 comments on commit c7b923a

Please sign in to comment.