MCPcopy
hub / github.com/canopy-network/canopy / TestClassDiscriminant

Function TestClassDiscriminant

lib/crypto/classgroup_test.go:10–25  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestClassDiscriminant(t *testing.T) {
11 t12_11_3 := NewClassGroup(big.NewInt(12), big.NewInt(11), big.NewInt(3))
12 require.Equal(t, "-23", t12_11_3.Discriminant().String(), "they should be equal")
13
14 t93_109_32 := NewClassGroup(big.NewInt(93), big.NewInt(109), big.NewInt(32))
15 require.Equal(t, "-23", t93_109_32.Discriminant().String(), "they should be equal")
16
17 D := big.NewInt(-103)
18 e_id := newClassGroup(bigOne, bigOne, D)
19 require.Equal(t, NewClassGroup(big.NewInt(1), big.NewInt(1), big.NewInt(26)), e_id, "they should be equal")
20 require.Equal(t, e_id.Discriminant(), D, "they should be equal")
21
22 e := newClassGroup(big.NewInt(2), big.NewInt(1), D)
23 require.Equal(t, NewClassGroup(big.NewInt(2), big.NewInt(1), big.NewInt(13)), e, "they should be equal")
24 require.Equal(t, e.Discriminant(), D, "they should be equal")
25}
26
27func TestNormalized(t *testing.T) {
28 f := NewClassGroup(big.NewInt(195751), big.NewInt(1212121), big.NewInt(1876411))

Callers

nothing calls this directly

Calls 5

DiscriminantMethod · 0.95
NewClassGroupFunction · 0.85
newClassGroupFunction · 0.85
EqualMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected