Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for montgomery (0.39 sec)

  1. src/math/big/nat.go

    	for i := len(y) - 1; i >= 0; i-- {
    		yi := y[i]
    		for j := 0; j < _W; j += n {
    			if i != len(y)-1 || j != 0 {
    				zz = zz.montgomery(z, z, m, k0, numWords)
    				z = z.montgomery(zz, zz, m, k0, numWords)
    				zz = zz.montgomery(z, z, m, k0, numWords)
    				z = z.montgomery(zz, zz, m, k0, numWords)
    			}
    			zz = zz.montgomery(z, powers[yi>>(_W-n)], m, k0, numWords)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:31:58 UTC 2024
    - 31.7K bytes
    - Viewed (0)
  2. src/crypto/internal/bigmod/nat.go

    // n = len(m.nat.limbs).
    //
    // Faster Montgomery multiplication replaces standard modular multiplication for
    // numbers in this representation.
    //
    // This assumes that x is already reduced mod m.
    func (x *Nat) montgomeryRepresentation(m *Modulus) *Nat {
    	// A Montgomery multiplication (which computes a * b / R) by R * R works out
    	// to a multiplication by R, which takes the value out of the Montgomery domain.
    	return x.montgomeryMul(x, m.rr, m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 24K bytes
    - Viewed (0)
  3. src/crypto/internal/nistec/p256_asm.go

    // domain (with R 2²⁵⁶) as four limbs in little-endian order value.
    type p256Element [4]uint64
    
    // p256One is one in the Montgomery domain.
    var p256One = p256Element{0x0000000000000001, 0xffffffff00000000,
    	0xffffffffffffffff, 0x00000000fffffffe}
    
    var p256Zero = p256Element{}
    
    // p256P is 2²⁵⁶ - 2²²⁴ + 2¹⁹² + 2⁹⁶ - 1 in the Montgomery domain.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  4. src/crypto/internal/edwards25519/scalar_fiat.go

    // The type fiatScalarMontgomeryDomainFieldElement is a field element in the Montgomery domain.
    //
    // Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
    type fiatScalarMontgomeryDomainFieldElement [4]uint64
    
    // The type fiatScalarNonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 10 18:45:00 UTC 2022
    - 35.6K bytes
    - Viewed (0)
  5. src/crypto/internal/nistec/fiat/p256_fiat64.go

    // The type p256MontgomeryDomainFieldElement is a field element in the Montgomery domain.
    //
    // Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
    type p256MontgomeryDomainFieldElement [4]uint64
    
    // The type p256NonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 05 21:53:03 UTC 2022
    - 41.2K bytes
    - Viewed (0)
  6. src/crypto/internal/nistec/fiat/p224_fiat64.go

    // The type p224MontgomeryDomainFieldElement is a field element in the Montgomery domain.
    //
    // Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]]
    type p224MontgomeryDomainFieldElement [4]uint64
    
    // The type p224NonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 05 21:53:03 UTC 2022
    - 43.2K bytes
    - Viewed (0)
  7. src/crypto/internal/edwards25519/scalar.go

    //
    // This type works similarly to math/big.Int, and all arguments and
    // receivers are allowed to alias.
    //
    // The zero value is a valid zero element.
    type Scalar struct {
    	// s is the scalar in the Montgomery domain, in the format of the
    	// fiat-crypto implementation.
    	s fiatScalarMontgomeryDomainFieldElement
    }
    
    // The field implementation in scalar_fiat.go is generated by the fiat-crypto
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  8. src/math/big/nat_test.go

    		k0 := Word(new(Int).ModInverse(k, _B).Uint64())
    		if k0 != Word(test.k0) {
    			t.Errorf("#%d: k0 in table=%#x, computed=%#x\n", i, test.k0, k0)
    		}
    
    		// check montgomery with correct k0 produces correct output
    		z := nat(nil).montgomery(x, y, m, k0, len(m))
    		z = z.norm()
    		if z.cmp(out) != 0 {
    			t.Errorf("#%d: got 0x%s want 0x%s", i, z.utoa(16), out.utoa(16))
    		}
    	}
    }
    
    var expNNTests = []struct {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 09 15:29:36 UTC 2024
    - 26.2K bytes
    - Viewed (0)
  9. src/crypto/internal/bigmod/nat_test.go

    	expected := &Nat{[]uint{1}}
    	if out.Equal(expected) != 1 {
    		t.Errorf("%+v != %+v", out, expected)
    	}
    }
    
    // TestMulReductions tests that Mul reduces results equal or slightly greater
    // than the modulus. Some Montgomery algorithms don't and need extra care to
    // return correct results. See https://go.dev/issue/13907.
    func TestMulReductions(t *testing.T) {
    	// Two short but multi-limb primes.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 12 00:56:20 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. src/cmd/compile/internal/ssa/magic.go

    // Divisibility x%c == 0 can be checked more efficiently than directly computing
    // the modulus x%c and comparing against 0.
    //
    // The same "Division by invariant integers using multiplication" paper
    // by Granlund and Montgomery referenced above briefly mentions this method
    // and it is further elaborated in "Hacker's Delight" by Warren Section 10-17
    //
    // The first thing to note is that for odd integers, exact division can be computed
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:25 UTC 2024
    - 15.8K bytes
    - Viewed (0)
Back to top