Skip to content

Commit

Permalink
Merge pull request #27 from kantagara/nikola/web3auth-not-working-wit…
Browse files Browse the repository at this point in the history
…h-new-bouncycastle-version

Fixing Web3Auth not working with newer versions of BouncyCastle.Crypo.dll
  • Loading branch information
chaitanyapotti authored Nov 3, 2023
2 parents ad901e2 + e0c92ff commit 005a927
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static string getPubKey(string sessionId)
try
{
var domain = SecNamedCurves.GetByName("secp256k1");
var parameters = new ECDomainParameters(domain.Curve, domain.G, domain.H);
var parameters = new ECDomainParameters(domain.Curve, domain.G, domain.N);

var key = new ECPrivateKeyParameters(new BigInteger(sessionId, 16), parameters);
var q = new ECPublicKeyParameters("EC", domain.G.Multiply(key.D), parameters).Q;
Expand Down
Binary file modified Assets/Plugins/Web3AuthSDK/Libs/BouncyCastle.Crypto.dll
100644 → 100755
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Plugins/Web3AuthSDK/Types/AES256CBC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public byte[] decrypt(byte[] src, string mac)
public BigInteger ecdh(string privateKeyHex, string ephemPublicKeyHex)
{
var domain = SecNamedCurves.GetByName("secp256k1");
var parameters = new ECDomainParameters(domain.Curve, domain.G, domain.H);
var parameters = new ECDomainParameters(domain.Curve, domain.G, domain.N);

ECPrivateKeyParameters privKey = new ECPrivateKeyParameters(new BigInteger(privateKeyHex, 16), parameters);

Expand Down

0 comments on commit 005a927

Please sign in to comment.