Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for NewBuiltin (0.15 sec)

  1. internal/kms/secret-key.go

    	}
    
    	keyID, b64Key := v[0], v[1]
    	key, err := base64.StdEncoding.DecodeString(b64Key)
    	if err != nil {
    		return nil, err
    	}
    	return NewBuiltin(keyID, key)
    }
    
    // NewBuiltin returns a single-key KMS that derives new DEKs from the
    // given key.
    func NewBuiltin(keyID string, key []byte) (*KMS, error) {
    	if len(key) != 32 {
    		return nil, errors.New("kms: invalid key length " + strconv.Itoa(len(key)))
    	}
    	return &KMS{
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 8.2K bytes
    - Viewed (0)
  2. internal/config/crypto_test.go

    func TestEncryptDecrypt(t *testing.T) {
    	key, err := hex.DecodeString("ddedadb867afa3f73bd33c25499a723ed7f9f51172ee7b1b679e08dc795debcc")
    	if err != nil {
    		t.Fatalf("Failed to decode master key: %v", err)
    	}
    	KMS, err := kms.NewBuiltin("my-key", key)
    	if err != nil {
    		t.Fatalf("Failed to create KMS: %v", err)
    	}
    
    	for i, test := range encryptDecryptTests {
    		ciphertext, err := Encrypt(KMS, bytes.NewReader(test.Data), test.Context)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/typecheck/universe.go

    		n := ir.NewDeclNameAt(src.NoXPos, ir.OTYPE, sym)
    		n.SetType(typ)
    		n.SetTypecheck(1)
    		sym.Def = n
    		return n
    	})
    
    	for _, s := range &builtinFuncs {
    		ir.NewBuiltin(types.BuiltinPkg.Lookup(s.name), s.op)
    	}
    
    	for _, s := range &unsafeFuncs {
    		ir.NewBuiltin(types.UnsafePkg.Lookup(s.name), s.op)
    	}
    
    	s := types.BuiltinPkg.Lookup("true")
    	s.Def = ir.NewConstAt(src.NoXPos, s, types.UntypedBool, constant.MakeBool(true))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/types2/universe.go

    		}
    		def(newBuiltin(id))
    	}
    }
    
    // DefPredeclaredTestFuncs defines the assert and trace built-ins.
    // These built-ins are intended for debugging and testing of this
    // package only.
    func DefPredeclaredTestFuncs() {
    	if Universe.Lookup("assert") != nil {
    		return // already defined
    	}
    	def(newBuiltin(_Assert))
    	def(newBuiltin(_Trace))
    }
    
    func init() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  5. src/go/types/universe.go

    		}
    		def(newBuiltin(id))
    	}
    }
    
    // DefPredeclaredTestFuncs defines the assert and trace built-ins.
    // These built-ins are intended for debugging and testing of this
    // package only.
    func DefPredeclaredTestFuncs() {
    	if Universe.Lookup("assert") != nil {
    		return // already defined
    	}
    	def(newBuiltin(_Assert))
    	def(newBuiltin(_Trace))
    }
    
    func init() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types2/object.go

    }
    
    // A Builtin represents a built-in function.
    // Builtins don't have a valid type.
    type Builtin struct {
    	object
    	id builtinId
    }
    
    func newBuiltin(id builtinId) *Builtin {
    	return &Builtin{object{name: predeclaredFuncs[id].name, typ: Typ[Invalid], color_: black}, id}
    }
    
    // Nil represents the predeclared value nil.
    type Nil struct {
    	object
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
  7. src/go/types/object.go

    }
    
    // A Builtin represents a built-in function.
    // Builtins don't have a valid type.
    type Builtin struct {
    	object
    	id builtinId
    }
    
    func newBuiltin(id builtinId) *Builtin {
    	return &Builtin{object{name: predeclaredFuncs[id].name, typ: Typ[Invalid], color_: black}, id}
    }
    
    // Nil represents the predeclared value nil.
    type Nil struct {
    	object
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 20.1K bytes
    - Viewed (0)
Back to top