Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for DerivePartKey (0.42 sec)

  1. internal/crypto/key.go

    	if out, err := sio.DecryptBuffer(key[:0], sealedKey.Key[:], unsealConfig); len(out) != 32 || err != nil {
    		return ErrSecretKeyMismatch
    	}
    	return nil
    }
    
    // DerivePartKey derives an unique 256 bit key from an ObjectKey and the part index.
    func (key ObjectKey) DerivePartKey(id uint32) (partKey [32]byte) {
    	var bin [4]byte
    	binary.LittleEndian.PutUint32(bin[:], id)
    
    	mac := hmac.New(sha256.New, key[:])
    	mac.Write(bin[:])
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Mar 19 20:28:10 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  2. internal/crypto/sse.go

    // multi-part PUT request. It derives an unique encryption key from
    // the partID and the object key.
    func EncryptMultiPart(r io.Reader, partID int, key ObjectKey) io.Reader {
    	partKey := key.DerivePartKey(uint32(partID))
    	return EncryptSinglePart(r, ObjectKey(partKey))
    }
    
    // DecryptSinglePart decrypts an io.Writer which must an object
    // uploaded with the single-part PUT API. The offset and length
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Aug 30 15:26:43 GMT 2022
    - 4.4K bytes
    - Viewed (0)
  3. internal/crypto/key_test.go

    	for i, test := range derivePartKeyTest {
    		expectedPartKey, err := hex.DecodeString(test.PartKey)
    		if err != nil {
    			t.Fatalf("Test %d failed to decode expected part-key: %v", i, err)
    		}
    		partKey := key.DerivePartKey(test.PartID)
    		if !bytes.Equal(partKey[:], expectedPartKey) {
    			t.Errorf("Test %d derives wrong part-key: got '%s' want: '%s'", i, hex.EncodeToString(partKey[:]), test.PartKey)
    		}
    	}
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 02 00:13:57 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  4. cmd/object-multipart-handlers.go

    		if err != nil {
    			writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    			return
    		}
    		copy(objectEncryptionKey[:], key)
    
    		partEncryptionKey := objectEncryptionKey.DerivePartKey(uint32(partID))
    		encReader, err := sio.EncryptReader(reader, sio.Config{Key: partEncryptionKey[:], CipherSuites: fips.DARECiphers()})
    		if err != nil {
    			writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    			return
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Mar 28 17:44:56 GMT 2024
    - 39K bytes
    - Viewed (0)
Back to top