Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for fieldAdd (0.2 sec)

  1. src/crypto/internal/mlkem768/mlkem768.go

    func fieldReduceOnce(a uint16) fieldElement {
    	x := a - q
    	// If x underflowed, then x >= 2¹⁶ - q > 2¹⁵, so the top bit is set.
    	x += (x >> 15) * q
    	return fieldElement(x)
    }
    
    func fieldAdd(a, b fieldElement) fieldElement {
    	x := uint16(a + b)
    	return fieldReduceOnce(x)
    }
    
    func fieldSub(a, b fieldElement) fieldElement {
    	x := uint16(a - b + q)
    	return fieldReduceOnce(x)
    }
    
    const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 28.4K bytes
    - Viewed (0)
  2. src/crypto/internal/mlkem768/mlkem768_test.go

    		if got != exp {
    			t.Fatalf("reduce(%d) = %d, expected %d", a, got, exp)
    		}
    	}
    }
    
    func TestFieldAdd(t *testing.T) {
    	for a := fieldElement(0); a < q; a++ {
    		for b := fieldElement(0); b < q; b++ {
    			got := fieldAdd(a, b)
    			exp := (a + b) % q
    			if got != exp {
    				t.Fatalf("%d + %d = %d, expected %d", a, b, got, exp)
    			}
    		}
    	}
    }
    
    func TestFieldSub(t *testing.T) {
    	for a := fieldElement(0); a < q; a++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 15:27:18 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  3. schema/field.go

    		}
    	default:
    		field.ValueOf = func(ctx context.Context, v reflect.Value) (interface{}, bool) {
    			v = reflect.Indirect(v)
    			for _, fieldIdx := range field.StructField.Index {
    				if fieldIdx >= 0 {
    					v = v.Field(fieldIdx)
    				} else {
    					v = v.Field(-fieldIdx - 1)
    
    					if !v.IsNil() {
    						v = v.Elem()
    					} else {
    						return nil, true
    					}
    				}
    			}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
  4. schema/index_test.go

    		},
    		"idx_index_tests_field_d": {
    			Name:  "idx_index_tests_field_d",
    			Class: "UNIQUE",
    			Fields: []schema.IndexOption{
    				{Field: &schema.Field{Name: "FieldD"}},
    				// Note: Duplicate Columns
    				{Field: &schema.Field{Name: "FieldD"}},
    			},
    		},
    		"uniq_field_e1_e2": {
    			Name:  "uniq_field_e1_e2",
    			Class: "UNIQUE",
    			Fields: []schema.IndexOption{
    				{Field: &schema.Field{Name: "FieldE1"}},
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. src/encoding/xml/marshal_test.go

    	FieldB string
    	*EmbedC
    }
    
    type EmbedC struct {
    	FieldA1 string `xml:"FieldA>A1"`
    	FieldA2 string `xml:"FieldA>A2"`
    	FieldB  string
    	FieldC  string
    }
    
    type embedD struct {
    	fieldD string
    	FieldE string // Promoted and visible when embedD is embedded.
    }
    
    type NameCasing struct {
    	XMLName struct{} `xml:"casing"`
    	Xy      string
    	XY      string
    	XyA     string `xml:"Xy,attr"`
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 18:46:41 UTC 2024
    - 66K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/ssagen/ssa.go

    // callee args space for its use.
    func (s *State) UseArgs(n int64) {
    	if s.maxarg < n {
    		s.maxarg = n
    	}
    }
    
    // fieldIdx finds the index of the field referred to by the ODOT node n.
    func fieldIdx(n *ir.SelectorExpr) int {
    	t := n.X.Type()
    	if !t.IsStruct() {
    		panic("ODOT's LHS is not a struct")
    	}
    
    	for i, f := range t.Fields() {
    		if f.Sym == n.Sel {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 19:44:43 UTC 2024
    - 284.9K bytes
    - Viewed (0)
Back to top