github.com/cloudflare/circl@v1.5.0/tss/rsa/util_test.go (about)

     1  package rsa
     2  
     3  import (
     4  	"math/big"
     5  	"testing"
     6  )
     7  
     8  func TestCalculateDelta(t *testing.T) {
     9  	ONE := big.NewInt(1)
    10  	if calculateDelta(0).Cmp(ONE) != 0 {
    11  		t.Fatal("calculateDelta failed on 0")
    12  	}
    13  
    14  	if calculateDelta(1).Cmp(ONE) != 0 {
    15  		t.Fatal("calculateDelta failed on 1")
    16  	}
    17  
    18  	if calculateDelta(5).Cmp(big.NewInt(120)) != 0 {
    19  		t.Fatal("calculateDelta failed on 5")
    20  	}
    21  }