Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 69 for BeUint64 (0.43 sec)

  1. src/crypto/rand/util_test.go

    	t.Error("Prime always generated the same prime given the same input")
    }
    
    func TestInt(t *testing.T) {
    	// start at 128 so the case of (max.BitLen() % 8) == 0 is covered
    	for n := 128; n < 140; n++ {
    		b := new(big.Int).SetInt64(int64(n))
    		if i, err := rand.Int(rand.Reader, b); err != nil {
    			t.Fatalf("Can't generate random value: %v, %v", i, err)
    		}
    	}
    }
    
    type countingReader struct {
    	r io.Reader
    	n int
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 05 01:35:39 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/util/sets/int64.go

    //
    // Deprecated: use generic Set instead.
    // new ways:
    // s1 := Set[int64]{}
    // s2 := New[int64]()
    type Int64 map[int64]Empty
    
    // NewInt64 creates a Int64 from a list of values.
    func NewInt64(items ...int64) Int64 {
    	return Int64(New[int64](items...))
    }
    
    // Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}).
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 20 03:47:18 UTC 2022
    - 3.9K bytes
    - Viewed (0)
  3. misc/cgo/gmp/gmp.go

    // and sets z to that value.
    func (z *Int) SetBytes(b []byte) *Int {
    	z.doinit()
    	if len(b) == 0 {
    		z.SetInt64(0)
    	} else {
    		C.mpz_import(&z.i[0], C.size_t(len(b)), 1, 1, 1, 0, unsafe.Pointer(&b[0]))
    	}
    	return z
    }
    
    // SetInt64 sets z = x and returns z.
    func (z *Int) SetInt64(x int64) *Int {
    	z.doinit()
    	// TODO(rsc): more work on 32-bit platforms
    	C.mpz_set_si(&z.i[0], C.long(x))
    	return z
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 9.5K bytes
    - Viewed (0)
  4. src/math/big/int_test.go

    func euclidExtGCD(a, b *Int) (g, x, y *Int) {
    	A := new(Int).Set(a)
    	B := new(Int).Set(b)
    
    	// A = Ua*a + Va*b
    	// B = Ub*a + Vb*b
    	Ua := new(Int).SetInt64(1)
    	Va := new(Int)
    
    	Ub := new(Int)
    	Vb := new(Int).SetInt64(1)
    
    	q := new(Int)
    	temp := new(Int)
    
    	r := new(Int)
    	for len(B.abs) > 0 {
    		q, r = q.QuoRem(A, B, r)
    
    		A, B, r = B, r, A
    
    		// Ua, Ub = Ub, Ua-q*Ub
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 58.5K bytes
    - Viewed (0)
  5. src/math/big/float_test.go

    	}
    }
    
    func TestIssue6866(t *testing.T) {
    	for _, prec := range precList {
    		two := new(Float).SetPrec(prec).SetInt64(2)
    		one := new(Float).SetPrec(prec).SetInt64(1)
    		three := new(Float).SetPrec(prec).SetInt64(3)
    		msix := new(Float).SetPrec(prec).SetInt64(-6)
    		psix := new(Float).SetPrec(prec).SetInt64(+6)
    
    		p := new(Float).SetPrec(prec)
    		z1 := new(Float).SetPrec(prec)
    		z2 := new(Float).SetPrec(prec)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 20:22:45 UTC 2024
    - 51.9K bytes
    - Viewed (0)
  6. src/math/big/int.go

    	// changes must be reviewed by a security expert.
    	if len(x.abs) == 0 {
    		return 0
    	}
    	if x.neg {
    		return -1
    	}
    	return 1
    }
    
    // SetInt64 sets z to x and returns z.
    func (z *Int) SetInt64(x int64) *Int {
    	neg := false
    	if x < 0 {
    		neg = true
    		x = -x
    	}
    	z.abs = z.abs.setUint64(uint64(x))
    	z.neg = neg
    	return z
    }
    
    // SetUint64 sets z to x and returns z.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 14 17:02:38 UTC 2024
    - 33.1K bytes
    - Viewed (0)
  7. src/crypto/ecdh/nist.go

    		bufA[i], bufB[i] = a[len(a)-i-1], b[len(b)-i-1]
    	}
    
    	// Perform a subtraction with borrow.
    	var borrow uint64
    	for i := 0; i < len(bufA); i += 8 {
    		limbA, limbB := byteorder.LeUint64(bufA[i:]), byteorder.LeUint64(bufB[i:])
    		_, borrow = bits.Sub64(limbA, limbB, borrow)
    	}
    
    	// If there is a borrow at the end of the operation, then a < b.
    	return borrow == 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  8. src/math/big/rat.go

    	if b == 0 {
    		panic("division by zero")
    	}
    	z.a.SetInt64(a)
    	if b < 0 {
    		b = -b
    		z.a.neg = !z.a.neg
    	}
    	z.b.abs = z.b.abs.setUint64(uint64(b))
    	return z.norm()
    }
    
    // SetInt sets z to x (by making a copy of x) and returns z.
    func (z *Rat) SetInt(x *Int) *Rat {
    	z.a.Set(x)
    	z.b.abs = z.b.abs.setWord(1)
    	return z
    }
    
    // SetInt64 sets z to x and returns z.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 13.5K bytes
    - Viewed (0)
  9. src/crypto/elliptic/p256_test.go

    	scalars := make([]*big.Int, 0, len(p224BaseMultTests)+1)
    	for _, e := range p224BaseMultTests {
    		k, _ := new(big.Int).SetString(e.k, 10)
    		scalars = append(scalars, k)
    	}
    	k := new(big.Int).SetInt64(1)
    	k.Lsh(k, 500)
    	scalars = append(scalars, k)
    
    	for i, k := range scalars {
    		x, y := p256.ScalarBaseMult(k.Bytes())
    		x2, y2 := p256Generic.ScalarBaseMult(k.Bytes())
    		if x.Cmp(x2) != 0 || y.Cmp(y2) != 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 31 16:58:48 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  10. src/crypto/dsa/dsa.go

    		return errors.New("crypto/dsa: invalid ParameterSizes")
    	}
    
    	qBytes := make([]byte, N/8)
    	pBytes := make([]byte, L/8)
    
    	q := new(big.Int)
    	p := new(big.Int)
    	rem := new(big.Int)
    	one := new(big.Int)
    	one.SetInt64(1)
    
    GeneratePrimes:
    	for {
    		if _, err := io.ReadFull(rand, qBytes); err != nil {
    			return err
    		}
    
    		qBytes[len(qBytes)-1] |= 1
    		qBytes[0] |= 0x80
    		q.SetBytes(qBytes)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 7.2K bytes
    - Viewed (0)
Back to top