Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestModSub (0.27 sec)

  1. src/crypto/internal/bigmod/nat_test.go

    	out := new(Nat)
    	out.Mod(x, m)
    	expected := natFromBytes([]byte{0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09})
    	if out.Equal(expected) != 1 {
    		t.Errorf("%+v != %+v", out, expected)
    	}
    }
    
    func TestModSub(t *testing.T) {
    	m := modulusFromBytes([]byte{13})
    	x := &Nat{[]uint{6}}
    	y := &Nat{[]uint{7}}
    	x.Sub(y, m)
    	expected := &Nat{[]uint{12}}
    	if x.Equal(expected) != 1 {
    		t.Errorf("%+v != %+v", x, expected)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 12 00:56:20 UTC 2024
    - 11.6K bytes
    - Viewed (0)
Back to top