mirror of
https://github.com/tlsnotary/PageSigner.git
synced 2026-01-08 22:27:57 -05:00
fix for very small requests
This commit is contained in:
@@ -88,6 +88,11 @@ export class GHASH {
|
||||
return this.maxOddPowerNeeded > 19;
|
||||
}
|
||||
|
||||
// return true if we expect the notary to respond with data on Step1
|
||||
isStep1ResponseExpected(){
|
||||
return this.maxOddPowerNeeded > 3;
|
||||
}
|
||||
|
||||
// findMaxOddPower finds the max odd share that we
|
||||
findMaxOddPower(maxPowerNeeded){
|
||||
assert(maxPowerNeeded <= 1026);
|
||||
|
||||
@@ -289,7 +289,9 @@ export class TWOPC {
|
||||
ghashInputs.push(concatTA(lenA, lenC));
|
||||
|
||||
const resp1 = await this.send('ghash_step1', await this.ghash.buildStep1());
|
||||
this.ghash.processOTResponse(resp1);
|
||||
if (this.ghash.isStep1ResponseExpected()){
|
||||
this.ghash.processOTResponse(resp1);
|
||||
}
|
||||
if (this.ghash.isStep2Needed()){
|
||||
const resp2 = await this.send('ghash_step2', await this.ghash.buildStep2());
|
||||
this.ghash.processOTResponse(resp2);
|
||||
|
||||
Reference in New Issue
Block a user