Files
tss-lib/common/hash_utils.go
yutianwu abd66f8884 [R4R] Add eddsa (#88)
* [R4R] Add eddsa keygen and signing (#3)

* add eddsa signing and keygen

* contruct extended element from x,y

* update dep

* fix test

* fix bug

* delete unused code

* add resharing

* fix comments

* refactor RejectionSampl;e

* rename variable (#4)

* delete printf

* update dependency

* resolve conflict
2020-03-06 11:34:06 +08:00

19 lines
525 B
Go

// Copyright © 2019 Binance
//
// This file is part of Binance. The full Binance copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
package common
import (
"math/big"
)
// RejectionSample implements the rejection sampling logic for converting a
// SHA512/256 hash to a value between 0-q
func RejectionSample(q *big.Int, eHash *big.Int) *big.Int { // e' = eHash
e := eHash.Mod(eHash, q)
return e
}