Skip to content

Commit e6bb827

Browse files
author
Ernie Turner
authored
Fix examples to omit public signing key
1 parent aeee130 commit e6bb827

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const signingKeys = Api256.generateEd25519KeyPair();
5050
const plaintext = Api256.generatePlaintext();
5151

5252
//Encrypt the data to the public key and then attempt to decrypt with the private key
53-
const encryptedValue = Api256.encrypt(plaintext, keys.publicKey, signingKeys.publicKey, signingKeys.privateKey);
53+
const encryptedValue = Api256.encrypt(plaintext, keys.publicKey, signingKeys.privateKey);
5454
const decryptedValue = Api256.decrypt(encryptedValue, keys.privateKey);
5555

5656
assert.equal(decryptedValue, plaintext);
@@ -72,17 +72,17 @@ const signingKeys = Api256.generateEd25519KeyPair();
7272
const plaintext = Api256.generatePlaintext();
7373

7474
//Encrypt the data to the user public key
75-
const encryptedValue = Api256.encrypt(plaintext, userKeys.publicKey, signingKeys.publicKey, signingKeys.privateKey);
75+
const encryptedValue = Api256.encrypt(plaintext, userKeys.publicKey, signingKeys.privateKey);
7676

7777
//Generate a second public/private key pair as the target of the transform. This will allow the encrypted data to be
7878
//transformed to this second key pair and allow it to be decrypted.
7979
const deviceKeys = Api256.generateKeyPair();
8080

8181
//Generate a transform key from the user private key to the device public key
82-
const userToDeviceTransformKey = Api256.generateTransformKey(userKeys.privateKey, deviceKeys.publicKey, signingKeys.publicKey, signingKeys.privateKey);
82+
const userToDeviceTransformKey = Api256.generateTransformKey(userKeys.privateKey, deviceKeys.publicKey, signingKeys.privateKey);
8383

8484
//Transform the encrypted data (without decrypting it!) so that it can be decrypted with the second key pair
85-
const transformedEncryptedValue = Api256.transform(encryptedValue, userToDeviceTransformKey, signingKeys.publicKey, signingKeys.privateKey);
85+
const transformedEncryptedValue = Api256.transform(encryptedValue, userToDeviceTransformKey, signingKeys.privateKey);
8686

8787
//Decrypt the data using the second private key
8888
const decryptedValue = Api256.decrypt(transformedEncryptedValue, deviceKeys.privateKey);
@@ -120,4 +120,4 @@ const recrypt = require('index.node');
120120

121121
+ From this repos root, run `npm i` or `yarn`.
122122
+ Run `npm/yarn run compile` to compile the Rust source into a `native/index.node` module.
123-
+ Run `npm/yarn run test`.
123+
+ Run `npm/yarn run test`.

0 commit comments

Comments
 (0)