Skip to content

Commit 648f239

Browse files
committed
changing names to match C# SDK for benchmarking functionality.
1 parent d6ab4f9 commit 648f239

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

index.node

0 Bytes
Binary file not shown.

src-ts/hybrid/types/aes-rsa-hybrid-initializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class AESRSAHybridInitializer {
1515
this.aesType = aesType;
1616
let aesWrapper = new AESWrapper();
1717
this.aesKey = (aesType === 128) ? aesWrapper.aes128Key() : aesWrapper.aes256Key();
18-
this.aesNonce = aesWrapper.aesNonce();
18+
this.aesNonce = aesWrapper.generateAESNonce();
1919
if (rsaSize !== 1028 && rsaSize !== 2048 && rsaSize !== 4096) {
2020
throw new Error("You must provide an appropriate RSA Key pair size to generate a hybrid initalizer");
2121
}

src-ts/symmetric/aes-wrapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class AESWrapper {
2020
return aes256Key();
2121
}
2222

23-
public aesNonce(): Array<number> {
23+
public generateAESNonce(): Array<number> {
2424
return aesNonce();
2525
}
2626

@@ -40,11 +40,11 @@ export class AESWrapper {
4040
return aes256Decrypt(aesKey, nonce, ciphertext);
4141
}
4242

43-
public aes256KeyFromX25519SharedSecret(shared_secret: Array<number>): AesKeyFromX25519SharedSecret {
43+
public aes256KeyNonceX25519DiffieHellman(shared_secret: Array<number>): AesKeyFromX25519SharedSecret {
4444
return aes256KeyFromX25519SharedSecret(shared_secret);
4545
}
4646

47-
public aes128KeyFromX25519SharedSecret(shared_secret: Array<number>): AesKeyFromX25519SharedSecret {
47+
public aes128KeyNonceX25519DiffieHellman(shared_secret: Array<number>): AesKeyFromX25519SharedSecret {
4848
return aes128KeyFromX25519SharedSecret(shared_secret);
4949
}
5050
}

test-ts/insecure-channel.test.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ describe("Insecure Channel Tests", () => {
1414
const alice_shared_secret = x25519Wrapper.generateSharedSecret(alice_keys.secretKey, bob_keys.publicKey);
1515
const bob_shared_secret = x25519Wrapper.generateSharedSecret(bob_keys.secretKey, alice_keys.publicKey);
1616

17-
const alice_aes_key = aesWrapper.aes256KeyFromX25519SharedSecret(alice_shared_secret);
18-
const bob_aes_key = aesWrapper.aes256KeyFromX25519SharedSecret(bob_shared_secret);
17+
const alice_aes_key = aesWrapper.aes256KeyNonceX25519DiffieHellman(alice_shared_secret);
18+
const bob_aes_key = aesWrapper.aes256KeyNonceX25519DiffieHellman(bob_shared_secret);
1919

2020
const tohashed: string = "This is my encrypt text";
2121
const encoder = new TextEncoder();
@@ -36,8 +36,8 @@ describe("Insecure Channel Tests", () => {
3636
const alice_shared_secret = x25519Wrapper.generateSharedSecret(alice_keys.secretKey, bob_keys.publicKey);
3737
const bob_shared_secret = x25519Wrapper.generateSharedSecret(bob_keys.secretKey, alice_keys.publicKey);
3838

39-
const alice_aes_key = aesWrapper.aes128KeyFromX25519SharedSecret(alice_shared_secret);
40-
const bob_aes_key = aesWrapper.aes128KeyFromX25519SharedSecret(bob_shared_secret);
39+
const alice_aes_key = aesWrapper.aes128KeyNonceX25519DiffieHellman(alice_shared_secret);
40+
const bob_aes_key = aesWrapper.aes128KeyNonceX25519DiffieHellman(bob_shared_secret);
4141

4242
const tohashed: string = "This is my encrypt text";
4343
const encoder = new TextEncoder();

test-ts/symmetric.test.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ describe("Symmetric Tests", () => {
66
it("aes 128 encrypt and decrypt equals", () => {
77
const aesWrapper: AESWrapper = new AESWrapper();
88
const aesKey = aesWrapper.aes128Key();
9-
const aesNonce = aesWrapper.aesNonce();
9+
const aesNonce = aesWrapper.generateAESNonce();
1010
const tohashed: string = "This is my array to encrypt";
1111
const encoder = new TextEncoder();
1212
const tohashBytes: Array<number> = Array.from(encoder.encode(tohashed));
@@ -19,7 +19,7 @@ describe("Symmetric Tests", () => {
1919
it("aes 256 encrypt and decrypt equals", () => {
2020
const aesWrapper: AESWrapper = new AESWrapper();
2121
const aesKey = aesWrapper.aes256Key();
22-
const aesNonce = aesWrapper.aesNonce();
22+
const aesNonce = aesWrapper.generateAESNonce();
2323
const tohashed: string = "This is my array to encrypt";
2424
const encoder = new TextEncoder();
2525
const tohashBytes: Array<number> = Array.from(encoder.encode(tohashed));

0 commit comments

Comments
 (0)