Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 42 for cipherText (0.15 sec)

  1. internal/kms/secret-key.go

    // and MinKMS, and legacy JSON formatted ciphertexts.
    func (s secretKey) Decrypt(_ context.Context, req *DecryptRequest) ([]byte, error) {
    	if req.Name != s.keyID {
    		return nil, ErrKeyNotFound
    	}
    
    	const randSize = 28
    	ciphertext, keyType := parseCiphertext(req.Ciphertext)
    	ciphertext, random := ciphertext[:len(ciphertext)-randSize], ciphertext[len(ciphertext)-randSize:]
    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/kms/conn.go

    		Version    uint32 `json:"version,omitempty"`
    		Ciphertext []byte `json:"ciphertext"`
    	}
    	return json.Marshal(JSON{
    		KeyID:      d.KeyID,
    		Version:    uint32(d.Version),
    		Ciphertext: d.Ciphertext,
    	})
    }
    
    // UnmarshalText tries to decode text as JSON representation
    // of a DEK and sets DEK's key ID and ciphertext to the
    // decoded values.
    //
    // It sets DEK's plaintext to nil.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 5K bytes
    - Viewed (0)
  3. internal/kms/dek_test.go

    		}
    		if key.Plaintext != nil {
    			t.Fatalf("Test %d: unmarshaled DEK contains non-nil plaintext", i)
    		}
    		if !bytes.Equal(key.Ciphertext, test.Key.Ciphertext) {
    			t.Fatalf("Test %d: ciphertext mismatch: got %x - want %x", i, key.Ciphertext, test.Key.Ciphertext)
    		}
    	}
    }
    
    func mustDecodeB64(s string) []byte {
    	b, err := base64.StdEncoding.DecodeString(s)
    	if err != nil {
    		panic(err)
    	}
    	return b
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  4. src/crypto/aes/gcm_ppc64x.go

    	}
    
    	tag := ciphertext[len(ciphertext)-g.tagSize:]
    	ciphertext = ciphertext[:len(ciphertext)-g.tagSize]
    
    	var counter, tagMask [gcmBlockSize]byte
    	g.deriveCounter(&counter, nonce)
    
    	g.cipher.Encrypt(tagMask[:], counter[:])
    	gcmInc32(&counter)
    
    	var expectedTag [gcmTagSize]byte
    	g.auth(expectedTag[:], ciphertext, data, &tagMask)
    
    	ret, out := sliceForAppend(dst, len(ciphertext))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  5. src/crypto/aes/aes_gcm.go

    		panic("crypto/cipher: incorrect GCM tag size")
    	}
    
    	if len(ciphertext) < g.tagSize {
    		return nil, errOpen
    	}
    	if uint64(len(ciphertext)) > ((1<<32)-2)*uint64(BlockSize)+uint64(g.tagSize) {
    		return nil, errOpen
    	}
    
    	tag := ciphertext[len(ciphertext)-g.tagSize:]
    	ciphertext = ciphertext[:len(ciphertext)-g.tagSize]
    
    	// See GCM spec, section 7.1.
    	var counter, tagMask [gcmBlockSize]byte
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. internal/config/crypto.go

    // The context is bound to the returned ciphertext.
    //
    // The same context must be provided when decrypting the
    // ciphertext.
    func EncryptBytes(k *kms.KMS, plaintext []byte, context kms.Context) ([]byte, error) {
    	ciphertext, err := Encrypt(k, bytes.NewReader(plaintext), context)
    	if err != nil {
    		return nil, err
    	}
    	return io.ReadAll(ciphertext)
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 5K bytes
    - Viewed (0)
  7. src/crypto/aes/gcm_s390x.go

    		panic("crypto/cipher: incorrect GCM tag size")
    	}
    	if len(ciphertext) < g.tagSize {
    		return nil, errOpen
    	}
    	if uint64(len(ciphertext)) > ((1<<32)-2)*uint64(BlockSize)+uint64(g.tagSize) {
    		return nil, errOpen
    	}
    
    	tag := ciphertext[len(ciphertext)-g.tagSize:]
    	ciphertext = ciphertext[:len(ciphertext)-g.tagSize]
    
    	counter := g.deriveCounter(nonce)
    
    	var tagMask [gcmBlockSize]byte
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 11.3K bytes
    - Viewed (0)
  8. src/crypto/cipher/gcm.go

    		panic("crypto/cipher: incorrect GCM tag size")
    	}
    
    	if len(ciphertext) < g.tagSize {
    		return nil, errOpen
    	}
    	if uint64(len(ciphertext)) > ((1<<32)-2)*uint64(g.cipher.BlockSize())+uint64(g.tagSize) {
    		return nil, errOpen
    	}
    
    	tag := ciphertext[len(ciphertext)-g.tagSize:]
    	ciphertext = ciphertext[:len(ciphertext)-g.tagSize]
    
    	var counter, tagMask [gcmBlockSize]byte
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  9. internal/kms/secret-key_test.go

    	if err != nil {
    		t.Fatalf("Failed to generate key: %v", err)
    	}
    	plaintext, err := KMS.Decrypt(context.TODO(), &DecryptRequest{
    		Name:       key.KeyID,
    		Ciphertext: key.Ciphertext,
    	})
    	if err != nil {
    		t.Fatalf("Failed to decrypt key: %v", err)
    	}
    	if !bytes.Equal(key.Plaintext, plaintext) {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 07 23:55:37 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  10. src/crypto/tls/key_agreement.go

    	if len(ckx.ciphertext) < 2 {
    		return nil, errClientKeyExchange
    	}
    	ciphertextLen := int(ckx.ciphertext[0])<<8 | int(ckx.ciphertext[1])
    	if ciphertextLen != len(ckx.ciphertext)-2 {
    		return nil, errClientKeyExchange
    	}
    	ciphertext := ckx.ciphertext[2:]
    
    	priv, ok := cert.PrivateKey.(crypto.Decrypter)
    	if !ok {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 14:56:25 UTC 2024
    - 11.8K bytes
    - Viewed (0)
Back to top