Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 266 for newInt (0.26 sec)

  1. src/math/big/doc.go

    	y := new(Float)  // y is a *Float of value 0
    
    Alternatively, new values can be allocated and initialized with factory
    functions of the form:
    
    	func NewT(v V) *T
    
    For instance, [NewInt](x) returns an *[Int] set to the value of the int64
    argument x, [NewRat](a, b) returns a *[Rat] set to the fraction a/b where
    a and b are int64 values, and [NewFloat](f) returns a *[Float] initialized
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 11:59:09 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  2. pkg/registry/core/service/ipallocator/bitmap.go

    		// Allocate() it - we don't ever want to be able to release it.
    		max--
    	}
    
    	// Don't use the network's ".0" address, but don't just Allocate() it - we
    	// don't ever want to be able to release it.
    	base.Add(base, big.NewInt(1))
    	max--
    
    	// cidr with whole mask can be negative
    	if max < 0 {
    		max = 0
    	}
    
    	r := Range{
    		net:     cidr,
    		base:    base,
    		max:     maximum(0, int(max)),
    		family:  family,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 25 20:32:40 UTC 2023
    - 10.8K bytes
    - Viewed (0)
  3. src/crypto/tls/generate_cert.go

    		if err != nil {
    			log.Fatalf("Failed to parse creation date: %v", err)
    		}
    	}
    
    	notAfter := notBefore.Add(*validFor)
    
    	serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128)
    	serialNumber, err := rand.Int(rand.Reader, serialNumberLimit)
    	if err != nil {
    		log.Fatalf("Failed to generate serial number: %v", err)
    	}
    
    	template := x509.Certificate{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 08 15:22:02 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/walk/convert.go

    		n = soleComponent(init, n)
    		// byteindex widens n so that the multiplication doesn't overflow.
    		index := ir.NewBinaryExpr(base.Pos, ir.OLSH, byteindex(n), ir.NewInt(base.Pos, 3))
    		if ssagen.Arch.LinkArch.ByteOrder == binary.BigEndian {
    			index = ir.NewBinaryExpr(base.Pos, ir.OADD, index, ir.NewInt(base.Pos, 7))
    		}
    		// The actual type is [256]uint64, but we use [256*8]uint8 so we can address
    		// individual bytes.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 17:28:22 UTC 2023
    - 18.2K bytes
    - Viewed (0)
  5. src/crypto/internal/edwards25519/scalar_test.go

    	}
    }
    
    func TestScalarSetUniformBytes(t *testing.T) {
    	mod, _ := new(big.Int).SetString("27742317777372353535851937790883648493", 10)
    	mod.Add(mod, new(big.Int).Lsh(big.NewInt(1), 252))
    	f := func(in [64]byte, sc Scalar) bool {
    		sc.SetUniformBytes(in[:])
    		repr := sc.Bytes()
    		if !isReduced(repr) {
    			return false
    		}
    		scBig := bigIntFromLittleEndianBytes(repr[:])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  6. src/crypto/ecdsa/ecdsa_test.go

    		hashToNat(c, bigmod.NewNat(), h)
    	}
    }
    
    func TestZeroSignature(t *testing.T) {
    	testAllCurves(t, testZeroSignature)
    }
    
    func testZeroSignature(t *testing.T, curve elliptic.Curve) {
    	privKey, err := GenerateKey(curve, rand.Reader)
    	if err != nil {
    		panic(err)
    	}
    
    	if Verify(&privKey.PublicKey, make([]byte, 64), big.NewInt(0), big.NewInt(0)) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:58 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  7. src/math/big/bits_test.go

    		return new(Float)
    	}
    	// len(bits) > 0
    
    	// determine lsb exponent
    	var min int
    	for i, b := range bits {
    		if i == 0 || b < min {
    			min = b
    		}
    	}
    
    	// create bit pattern
    	x := NewInt(0)
    	for _, b := range bits {
    		badj := b - min
    		// propagate carry if necessary
    		for x.Bit(badj) != 0 {
    			x.SetBit(x, badj, 0)
    			badj++
    		}
    		x.SetBit(x, badj, 1)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  8. pkg/apis/certificates/validation/validation_test.go

    	goodCert1 := mustMakeCertificate(t, &x509.Certificate{
    		SerialNumber: big.NewInt(0),
    		Subject: pkix.Name{
    			CommonName: "root1",
    		},
    		IsCA:                  true,
    		BasicConstraintsValid: true,
    	})
    
    	goodCert2 := mustMakeCertificate(t, &x509.Certificate{
    		SerialNumber: big.NewInt(0),
    		Subject: pkix.Name{
    			CommonName: "root2",
    		},
    		IsCA:                  true,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 03 18:40:49 UTC 2023
    - 61K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/typecheck/func.go

    			if l.Type() == nil {
    				n.SetType(nil)
    				return n
    			}
    			if !checkmake(t, "size", &l) {
    				n.SetType(nil)
    				return n
    			}
    		} else {
    			l = ir.NewInt(base.Pos, 0)
    		}
    		nn = ir.NewMakeExpr(n.Pos(), ir.OMAKEMAP, l, nil)
    		nn.SetEsc(n.Esc())
    
    	case types.TCHAN:
    		l = nil
    		if i < len(args) {
    			l = args[i]
    			i++
    			l = Expr(l)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 06 15:23:18 UTC 2024
    - 21.1K bytes
    - Viewed (0)
  10. src/crypto/rsa/rsa.go

    		Qinv, err := bigmod.NewNat().SetBytes(priv.Precomputed.Qinv.Bytes(), P)
    		if err != nil {
    			return nil, ErrDecryption
    		}
    		c, err = bigmod.NewNat().SetBytes(ciphertext, N)
    		if err != nil {
    			return nil, ErrDecryption
    		}
    
    		// m = c ^ Dp mod p
    		m = bigmod.NewNat().Exp(t0.Mod(c, P), priv.Precomputed.Dp.Bytes(), P)
    		// m2 = c ^ Dq mod q
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 23.4K bytes
    - Viewed (0)
Back to top