forked from tide-foundation/Tide-h4x2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from tide-foundation/staging
3.1 into main
- Loading branch information
Showing
17 changed files
with
148 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ | |
"Api": "https://new-simulator.australiaeast.cloudapp.azure.com" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 11 additions & 10 deletions
21
H4x2-Node/H4x2-Node/wwwroot/modules/H4x2-TideJS/Models/SendShardResponse.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
import Point from "../Ed25519/point.js"; | ||
import { BigIntFromByteArray, base64ToBytes } from "../Tools/Utils.js"; | ||
|
||
export default class SendShardResponse{ | ||
/** | ||
* @param {Point[]} gKtesti | ||
* @param {Point} gRi | ||
* @param {bigint} Si | ||
* @param {Point} gK1 | ||
* @param {string} encCommitStatei | ||
* @param {Point[]} gMultiplied | ||
* @param {string} ephKeyi | ||
*/ | ||
constructor(gKtesti, gRi, gMultiplied, ephKeyi){ | ||
this.gKtesti = gKtesti | ||
this.gRi = gRi | ||
constructor(Si, gK1, encCommitStatei, gMultiplied){ | ||
this.Si = Si | ||
this.gK1 = gK1 | ||
this.encCommitStatei = encCommitStatei | ||
this.gMultiplied = gMultiplied | ||
this.ephKeyi = ephKeyi | ||
} | ||
|
||
static from(data){ | ||
const obj = JSON.parse(data); | ||
const gKtesti = obj.GKntesti.map(p => Point.fromB64(p)); | ||
const gRi = Point.fromB64(obj.GRi); | ||
const si = BigIntFromByteArray(base64ToBytes(obj.Si)); | ||
const gK1 = Point.fromB64(obj.GK1); | ||
const gMultiplied = obj.GMultiplied.map(p => p == null ? null : Point.fromB64(p)); | ||
return new SendShardResponse(gKtesti, gRi, gMultiplied, obj.EphKeyi); | ||
return new SendShardResponse(si, gK1, obj.EncCommitStatei, gMultiplied); | ||
} | ||
} |
Oops, something went wrong.