Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 481 for Primes (0.12 sec)

  1. src/crypto/rsa/rsa.go

    	priv.Precomputed.Dq = new(big.Int).Sub(priv.Primes[1], bigOne)
    	priv.Precomputed.Dq.Mod(priv.D, priv.Precomputed.Dq)
    
    	priv.Precomputed.Qinv = new(big.Int).ModInverse(priv.Primes[1], priv.Primes[0])
    
    	r := new(big.Int).Mul(priv.Primes[0], priv.Primes[1])
    	priv.Precomputed.CRTValues = make([]CRTValue, len(priv.Primes)-2)
    	for i := 2; i < len(priv.Primes); i++ {
    		prime := priv.Primes[i]
    		values := &priv.Precomputed.CRTValues[i-2]
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 23.4K bytes
    - Viewed (0)
  2. test/chan/sieve1.go

    		// Note that ch is different on each iteration.
    		prime := <-ch
    		primes <- prime
    		ch1 := make(chan int)
    		go Filter(ch, ch1, prime)
    		ch = ch1
    	}
    }
    
    func main() {
    	primes := make(chan int)
    	go Sieve(primes)
    	a := []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}
    	for i := 0; i < len(a); i++ {
    		if x := <-primes; x != a[i] {
    			println(x, " != ", a[i])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:44:02 UTC 2012
    - 1.5K bytes
    - Viewed (0)
  3. src/crypto/rsa/boring.go

    }
    
    func copyPrivateKey(k *PrivateKey) PrivateKey {
    	dst := PrivateKey{
    		PublicKey: copyPublicKey(&k.PublicKey),
    		D:         new(big.Int).Set(k.D),
    	}
    	dst.Primes = make([]*big.Int, len(k.Primes))
    	for i, p := range k.Primes {
    		dst.Primes[i] = new(big.Int).Set(p)
    	}
    	if x := k.Precomputed.Dp; x != nil {
    		dst.Precomputed.Dp = new(big.Int).Set(x)
    	}
    	if x := k.Precomputed.Dq; x != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Aug 18 00:30:19 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  4. test/chan/sieve2.go

    	go func() {
    		// In order to generate the nth prime we only need multiples of
    		// primessqrt(nth prime).  Thus, the merging goroutine will
    		// receive from 'primes' much slower than this goroutine
    		// will send to it, making the buffer accumulate and block this
    		// goroutine from sending, causing a deadlock.  The solution is to
    		// use a proxy goroutine to do automatic buffering.
    		primes := sendproxy(primes)
    
    		candidates := odds()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Feb 19 06:44:02 UTC 2012
    - 3.9K bytes
    - Viewed (0)
  5. src/crypto/x509/pkcs1.go

    		E: priv.E,
    		N: priv.N,
    	}
    
    	key.D = priv.D
    	key.Primes = make([]*big.Int, 2+len(priv.AdditionalPrimes))
    	key.Primes[0] = priv.P
    	key.Primes[1] = priv.Q
    	for i, a := range priv.AdditionalPrimes {
    		if a.Prime.Sign() <= 0 {
    			return nil, errors.New("x509: private key contains zero or negative prime")
    		}
    		key.Primes[i+2] = a.Prime
    		// We ignore the other two values because rsa will calculate
    		// them as needed.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  6. src/math/big/prime_test.go

    }
    
    func TestProbablyPrime(t *testing.T) {
    	nreps := 20
    	if testing.Short() {
    		nreps = 1
    	}
    	for i, s := range primes {
    		p, _ := new(Int).SetString(s, 10)
    		if !p.ProbablyPrime(nreps) || nreps != 1 && !p.ProbablyPrime(1) || !p.ProbablyPrime(0) {
    			t.Errorf("#%d prime found to be non-prime (%s)", i, s)
    		}
    	}
    
    	for i, s := range composites {
    		s = strings.Map(cutSpace, s)
    		c, _ := new(Int).SetString(s, 10)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 7.1K bytes
    - Viewed (0)
  7. src/crypto/internal/nistec/p224_sqrt.go

    // p224SqrtCandidate sets r to a square root candidate for x. r and x must not overlap.
    func p224SqrtCandidate(r, x *fiat.P224Element) {
    	// Since p = 1 mod 4, we can't use the exponentiation by (p + 1) / 4 like
    	// for the other primes. Instead, implement a variation of Tonelli–Shanks.
    	// The constant-time implementation is adapted from Thomas Pornin's ecGFp5.
    	//
    	// https://github.com/pornin/ecgfp5/blob/82325b965/rust/src/field.rs#L337-L385
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 12 00:04:29 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  8. src/crypto/dsa/dsa.go

    // this error must be handled.
    var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key")
    
    // ParameterSizes is an enumeration of the acceptable bit lengths of the primes
    // in a set of DSA parameters. See FIPS 186-3, section 4.2.
    type ParameterSizes int
    
    const (
    	L1024N160 ParameterSizes = iota
    	L2048N224
    	L2048N256
    	L3072N256
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:09:47 UTC 2023
    - 7.2K bytes
    - Viewed (0)
  9. src/math/big/prime.go

    	var rA, rB uint32
    	switch _W {
    	case 32:
    		rA = uint32(x.abs.modW(primesA))
    		rB = uint32(x.abs.modW(primesB))
    	case 64:
    		r := x.abs.modW((primesA * primesB) & _M)
    		rA = uint32(r % primesA)
    		rB = uint32(r % primesB)
    	default:
    		panic("math/big: invalid word size")
    	}
    
    	if rA%3 == 0 || rA%5 == 0 || rA%7 == 0 || rA%11 == 0 || rA%13 == 0 || rA%17 == 0 || rA%19 == 0 || rA%23 == 0 || rA%37 == 0 ||
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 02 14:43:52 UTC 2022
    - 10.4K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/hash/Fingerprint2011.java

     */
    @ElementTypesAreNonnullByDefault
    final class Fingerprint2011 extends AbstractNonStreamingHashFunction {
      static final HashFunction FINGERPRINT_2011 = new Fingerprint2011();
    
      // Some primes between 2^63 and 2^64 for various uses.
      private static final long K0 = 0xa5b85c5e198ed849L;
      private static final long K1 = 0x8d58ac26afe12e47L;
      private static final long K2 = 0xc47b6e9e3a970ed3L;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Dec 28 17:50:25 UTC 2021
    - 6.5K bytes
    - Viewed (0)
Back to top