mirror of
https://github.com/SwingbyProtocol/tss-lib.git
synced 2026-04-23 03:00:36 -04:00
* [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
19 lines
525 B
Go
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
|
|
}
|