Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for nonAdjacentForm (0.28 sec)

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

    	basepointNafTable := basepointNafTable()
    	var aTable nafLookupTable5
    	aTable.FromP3(A)
    	// Because the basepoint is fixed, we can use a wider NAF
    	// corresponding to a bigger table.
    	aNaf := a.nonAdjacentForm(5)
    	bNaf := b.nonAdjacentForm(8)
    
    	// Find the first nonzero coefficient.
    	i := 255
    	for j := i; j >= 0; j-- {
    		if aNaf[j] != 0 || bNaf[j] != 0 {
    			break
    		}
    	}
    
    	multA := &projCached{}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 05 21:53:10 UTC 2022
    - 6.3K bytes
    - Viewed (0)
  2. src/crypto/internal/edwards25519/scalar.go

    	nonzero |= nonzero >> 4
    	nonzero |= nonzero >> 2
    	nonzero |= nonzero >> 1
    	return int(^nonzero) & 1
    }
    
    // nonAdjacentForm computes a width-w non-adjacent form for this scalar.
    //
    // w must be between 2 and 8, or nonAdjacentForm will panic.
    func (s *Scalar) nonAdjacentForm(w uint) [256]int8 {
    	// This implementation is adapted from the one
    	// in curve25519-dalek and is documented there:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  3. src/crypto/internal/edwards25519/scalar_test.go

    		0, 0, 0, 11, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 7,
    		0, 0, 0, 0, 0, -15, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
    	}
    
    	sNaf := s.nonAdjacentForm(5)
    
    	for i := 0; i < 256; i++ {
    		if expectedNaf[i] != sNaf[i] {
    			t.Errorf("Wrong digit at position %d, got %d, expected %d", i, sNaf[i], expectedNaf[i])
    		}
    	}
    }
    
    type notZeroScalar Scalar
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 7.6K bytes
    - Viewed (0)
Back to top