diff --git a/docs/courier-test-vectors.json b/docs/courier-test-vectors.json index abf05acc..82d24bce 100644 --- a/docs/courier-test-vectors.json +++ b/docs/courier-test-vectors.json @@ -71,11 +71,6 @@ "expected": "ad8514c90ca1fa6bf44e38c8a6252482" }, - "ciphertextHash": { - "_comment": "SHA-256 of the ciphertext, truncated to 16 bytes. This is the envelope identity a spray receipt carries.", - "expected": "bb85dcc4d8b17377c61817992df95826" - }, - "packetSigning": { "_comment": [ "THE trap. The signature does NOT cover the bytes as they appear on the", diff --git a/localPackages/BitFoundation/Tests/BitFoundationTests/CourierVectorTests.swift b/localPackages/BitFoundation/Tests/BitFoundationTests/CourierVectorTests.swift index eff7db94..adb2d189 100644 --- a/localPackages/BitFoundation/Tests/BitFoundationTests/CourierVectorTests.swift +++ b/localPackages/BitFoundation/Tests/BitFoundationTests/CourierVectorTests.swift @@ -99,9 +99,6 @@ struct CourierVectorTests { let epochDay: UInt32 let expected: String } - struct CiphertextHash: Decodable { - let expected: String - } struct PacketSigning: Decodable { struct Packet: Decodable { let version: UInt8 @@ -133,7 +130,6 @@ struct CourierVectorTests { let envelopeTLV: EnvelopeTLV let copiesClamping: CopiesClamping let recipientTagDerivation: RecipientTagDerivation - let ciphertextHash: CiphertextHash let packetSigning: PacketSigning let signature: Signature } @@ -227,23 +223,6 @@ struct CourierVectorTests { #expect(recomputed == tag) } - /// The 16-byte envelope identity a spray receipt carries. - /// - /// Weaker than the other vectors, and deliberately so: this derivation has - /// no consumer on main yet — the function that reads it arrives with the - /// courier-spray work. What production surface exists is asserted (the - /// `sha256Hash()` implementation and the `tagLength` constant), but the - /// truncation is spelled out here rather than called, so a future - /// `ciphertextHash` helper that truncates differently would not fail this. - /// When that helper lands it should assert against this same vector. - @Test func ciphertextHashIsSHA256TruncatedTo16() throws { - let v = try Self.loadVectors() - let hash = Data(try Self.hex(v.inputs.ciphertext) - .sha256Hash() - .prefix(CourierEnvelope.tagLength)) - #expect(hash.hexEncodedString() == v.ciphertextHash.expected) - } - // MARK: Packet canonicalization — the trap worth a vector /// A real `courierEnvelope` frame: type 0x04 carrying an encoded envelope,