genSignFromShares method

Future<String> genSignFromShares(
  1. String imagePath,
  2. String hash
)

Implementation

Future<String> genSignFromShares(String imagePath, String hash) async{
    Future<String> firstPrivatebin = Dependencies().imageToBinary(imagePath);
    String firstPrivate = await firstPrivatebin;
    List<String> privateIntegerArrayString = List<String>.generate(firstPrivate.length, (index) => firstPrivate[index]);
    List<int> privateIntegerArray = privateIntegerArrayString.map((index) => int.parse(index)).toList();
    Map P = Dependencies().randomPositions("signer", hash, 32, privateIntegerArray);
    var finalPos = P["posForSign"];
    List<int> p1Sign = Dependencies().getPrivatePosition(finalPos, privateIntegerArray);
    return Dependencies().intArrayToStr(p1Sign);
}