diff --git a/GUI/src/app/menezes-vanstone/menezes-vanstone.component.html b/GUI/src/app/menezes-vanstone/menezes-vanstone.component.html index 7459dbff..660c2e98 100644 --- a/GUI/src/app/menezes-vanstone/menezes-vanstone.component.html +++ b/GUI/src/app/menezes-vanstone/menezes-vanstone.component.html @@ -13,11 +13,13 @@ Modulbreite -Bit + Bei {{numberSystem}} mindestens {{calcMinimumBitsize()}} Bit Zahlensystem + Bei {{modulusWidth}}-Bit maximal {{calcMaxNumbersystem()}} @@ -32,6 +34,11 @@ wird '-a^2' + + Seed + + + diff --git a/GUI/src/app/menezes-vanstone/menezes-vanstone.component.ts b/GUI/src/app/menezes-vanstone/menezes-vanstone.component.ts index e7a5a46c..3b0f9677 100644 --- a/GUI/src/app/menezes-vanstone/menezes-vanstone.component.ts +++ b/GUI/src/app/menezes-vanstone/menezes-vanstone.component.ts @@ -59,6 +59,7 @@ export class MenezesVanstoneComponent { public numberSystem: number = 55296; public millerRabinIterations: number = 100; public coefficientA: number = 5; + public random_seed: number= 3; public clients: ClientData[] = [ @@ -141,7 +142,8 @@ export class MenezesVanstoneComponent { let config: MvKeygenConfig = { modulus_width: this.modulusWidth, miller_rabin_rounds: this.millerRabinIterations, - coef_a: this.coefficientA + coef_a: this.coefficientA, + random_seed: this.random_seed }; this.backendRequestService.createKeyPair(config).then(key => { if (client === "Alice") { @@ -191,5 +193,19 @@ export class MenezesVanstoneComponent { client.ciphertext = {encrypted_message: "", points: []}; } + public clearFields(name: string) { + let client = (name === "Alice") ? this.clients[0] : this.clients[1]; + client.plaintext = ""; + client.ciphertext = {encrypted_message: "", points: []}; + } + protected readonly JSON = JSON; + + public calcMinimumBitsize(): number { + return Math.ceil(Math.log2(this.numberSystem)); + } + + public calcMaxNumbersystem(): number { + return 2 ** this.modulusWidth; + } } diff --git a/GUI/src/app/models/mv-keygen-config.ts b/GUI/src/app/models/mv-keygen-config.ts index 553d1350..2a2c791e 100644 --- a/GUI/src/app/models/mv-keygen-config.ts +++ b/GUI/src/app/models/mv-keygen-config.ts @@ -2,12 +2,15 @@ export class MvKeygenConfig { modulus_width: number; miller_rabin_rounds: number; coef_a: number; + random_seed: number; constructor(modulus_width: number, miller_rabin_rounds: number, - coef_a: number) { + coef_a: number, + random_seed: number) { this.modulus_width = modulus_width; this.miller_rabin_rounds = miller_rabin_rounds; this.coef_a = coef_a; + this.random_seed = random_seed; } }