Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,364 for rend (0.26 sec)

  1. src/crypto/internal/edwards25519/scalar_test.go

    // weighted towards high, low, and edge values.
    func (Scalar) Generate(rand *mathrand.Rand, size int) reflect.Value {
    	var s [32]byte
    	diceRoll := rand.Intn(100)
    	switch {
    	case diceRoll == 0:
    	case diceRoll == 1:
    		s = scOneBytes
    	case diceRoll == 2:
    		s = scalarMinusOneBytes
    	case diceRoll < 5:
    		// Generate a low scalar in [0, 2^125).
    		rand.Read(s[:16])
    		s[15] &= (1 << 5) - 1
    	case diceRoll < 10:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  2. src/crypto/internal/edwards25519/field/fe_test.go

    	}
    )
    
    func generateWeirdFieldElement(rand *mathrand.Rand) Element {
    	return Element{
    		weirdLimbs52[rand.Intn(len(weirdLimbs52))],
    		weirdLimbs51[rand.Intn(len(weirdLimbs51))],
    		weirdLimbs51[rand.Intn(len(weirdLimbs51))],
    		weirdLimbs51[rand.Intn(len(weirdLimbs51))],
    		weirdLimbs51[rand.Intn(len(weirdLimbs51))],
    	}
    }
    
    func (Element) Generate(rand *mathrand.Rand, size int) reflect.Value {
    	if rand.Intn(2) == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 13.9K bytes
    - Viewed (0)
  3. src/crypto/rand/rand_test.go

    		t.Fatalf("Compressed %d -> %d", len(b), z.Len())
    	}
    }
    
    func TestReadEmpty(t *testing.T) {
    	n, err := Reader.Read(make([]byte, 0))
    	if n != 0 || err != nil {
    		t.Fatalf("Read(make([]byte, 0)) = %d, %v", n, err)
    	}
    	n, err = Reader.Read(nil)
    	if n != 0 || err != nil {
    		t.Fatalf("Read(nil) = %d, %v", n, err)
    	}
    }
    
    func BenchmarkRead(b *testing.B) {
    	b.Run("32", func(b *testing.B) {
    		benchmarkRead(b, 32)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 19 20:02:21 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  4. internal/grid/benchmark_test.go

    	// Create n managers.
    	const payloadSize = 512
    	rng := rand.New(rand.NewSource(time.Now().UnixNano()))
    	payload := make([]byte, payloadSize)
    	_, err = rng.Read(payload)
    	errFatal(err)
    
    	for _, remote := range grid.Managers {
    		// Register a single handler which echos the payload.
    		errFatal(remote.RegisterStreamingHandler(handlerTest, StreamHandler{
    			// Send 10x requests.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 15.7K bytes
    - Viewed (0)
  5. src/internal/trace/mud_test.go

    package trace
    
    import (
    	"math"
    	"math/rand"
    	"testing"
    )
    
    func TestMUD(t *testing.T) {
    	// Insert random uniforms and check histogram mass and
    	// cumulative sum approximations.
    	rnd := rand.New(rand.NewSource(42))
    	mass := 0.0
    	var mud mud
    	for i := 0; i < 100; i++ {
    		area, l, r := rnd.Float64(), rnd.Float64(), rnd.Float64()
    		if rnd.Intn(10) == 0 {
    			r = l
    		}
    		t.Log(l, r, area)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. test/stress/runstress.go

    	if *v {
    		log.Println(a...)
    	}
    }
    
    func dialStress(a net.Addr) {
    	for {
    		d := net.Dialer{Timeout: time.Duration(rand.Intn(1e9))}
    		c, err := d.Dial("tcp", a.String())
    		if err == nil {
    			Println("did dial")
    			go func() {
    				time.Sleep(time.Duration(rand.Intn(500)) * time.Millisecond)
    				c.Close()
    				Println("closed dial")
    			}()
    		}
    		// Don't run out of ephemeral ports too quickly:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  7. src/crypto/ecdsa/ecdsa.go

    //
    // The signature is randomized. Most applications should use [crypto/rand.Reader]
    // as rand. Note that the returned signature does not depend deterministically on
    // the bytes read from rand, and may change between calls and/or between versions.
    func SignASN1(rand io.Reader, priv *PrivateKey, hash []byte) ([]byte, error) {
    	randutil.MaybeReadByte(rand)
    
    	if boring.Enabled && rand == boring.RandReader {
    		b, err := boringPrivateKey(priv)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  8. src/math/rand/v2/race_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package rand_test
    
    import (
    	. "math/rand/v2"
    	"sync"
    	"testing"
    )
    
    // TestConcurrent exercises the rand API concurrently, triggering situations
    // where the race detector is likely to detect issues.
    func TestConcurrent(t *testing.T) {
    	const (
    		numRoutines = 10
    		numCycles   = 10
    	)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 14:31:46 UTC 2023
    - 1005 bytes
    - Viewed (0)
  9. pkg/ledger/ledger_test.go

    	for i := 0; i < configSize; i++ {
    		ids = append(ids, addConfig(l, b))
    	}
    	b.ResetTimer()
    	for n := 0; n < b.N; n++ {
    		eg.Go(func() error {
    			_, err := l.Put(ids[rand.Int()%configSize], strconv.Itoa(rand.Int()))
    			_ = l.RootHash()
    			return err
    		})
    	}
    	if err := eg.Wait(); err != nil {
    		b.Fatalf("An error occurred putting new data on the ledger: %v", err)
    	}
    	b.StopTimer()
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jul 12 16:12:59 UTC 2023
    - 4K bytes
    - Viewed (0)
  10. src/crypto/rsa/pss_test.go

    	// k otherwise, where k is the length in octets of the RSA modulus n."
    	key, err := GenerateKey(rand.Reader, 513)
    	if err != nil {
    		t.Fatal(err)
    	}
    	digest := sha256.Sum256([]byte("message"))
    	signature, err := key.Sign(rand.Reader, digest[:], &PSSOptions{
    		SaltLength: PSSSaltLengthAuto,
    		Hash:       crypto.SHA256,
    	})
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 8.8K bytes
    - Viewed (0)
Back to top