Skip to content

feat(encryption): implement the FEE wire-format foundation #982

Description

@BravoNatalie

Description

Implement the first layer of @filoz/filecoin-encryption-envelope: COSE envelope serialization, validation, and chunk-layout primitives. This work defines how FEE objects are represented and parsed, but does not include AEAD encryption or key wrapping.

Proposed solution

Add strict COSE_Encrypt0 and COSE_Encrypt handling with detached ciphertext, protected headers, recipient validation, authenticated-data construction, chunk arithmetic, and nonce derivation.

Done criteria

  • Encode and decode COSE tags 16 and 96
  • Preserve protected-header bytes for AAD
  • Validate FEE headers, crit, IVs, recipients, and algorithm placement
  • Support plaintext_length and chunk-layout calculations
  • Derive chunk nonces from the base nonce, chunk index, and final flag
  • Reject malformed, ambiguous, or unsupported CBOR
  • Enforce envelope, object, chunk-count, chunk-size, and nesting limits
  • Add byte-exact fixtures and malformed-input regression tests

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

  • Status
    ⌨️ In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions