diff --git a/test/hpke/common.ts b/test/hpke/common.ts index 40d578d..e7fb8f2 100644 --- a/test/hpke/common.ts +++ b/test/hpke/common.ts @@ -8,7 +8,7 @@ export const Suite0 = 'HPKE-Base-P256-SHA256-AES128GCM' as Suite0 // aka APPLE-H export type PublicCoseKeyMap = Map export type SecretCoseKeyMap = Map -export const encapsulated_key_header_label = -22222; +export const encapsulated_key_header_label = -4; export const example_suite_label = 35; diff --git a/test/hpke/cose/cross-testing/cross-test.test.ts b/test/hpke/cose/cross-testing/cross-test.test.ts index f75e720..6e762d2 100644 --- a/test/hpke/cose/cross-testing/cross-test.test.ts +++ b/test/hpke/cose/cross-testing/cross-test.test.ts @@ -36,6 +36,25 @@ it('send 2 layer to friend', async () => { const pt = 'hello world' const m = new TextEncoder().encode(pt) const c4 = await wrap.encrypt(m, recipientPublicKey) - console.log(c4) - + // console.log(c4.toString('hex')) + // d8608443a10101a1054cc76efc0f1b057e5776bd70d0581b86ca9fcb76c70878e21a3a060b5783e9aed4be2826f95b9cacd766818344a1011823a20442303123584104cd5924f279ef1cd99ba24243cec2b5f795058e657f973d873ea99fa8a020d31b980644528636ec1cb1011e9b0828d4598054004188bd28b64da3bab0eb2fcc5c5820114637018aaac9cf03c81db3fa9c5fa15ef4b0d140edd4da815eada6e053fd9e + const diagnostic = await cbor.diagnose(c4) + // console.log(diagnostic) + // 96([ + // h'a10101', + // { + // 5: h'c76efc0f1b057e5776bd70d0' + // }, + // h'86ca9fcb76c70878e21a3a060b5783e9aed4be2826f95b9cacd766', + // [ + // [ + // h'a1011823', + // { + // 4: h'3031', + // -4: h'04cd5924f279ef1cd99ba24243cec2b5f795058e657f973d873ea99fa8a020d31b980644528636ec1cb1011e9b0828d4598054004188bd28b64da3bab0eb2fcc5c' + // }, + // h'114637018aaac9cf03c81db3fa9c5fa15ef4b0d140edd4da815eada6e053fd9e' + // ] + // ] + // ]) }) \ No newline at end of file diff --git a/test/hpke/cose/direct.md b/test/hpke/cose/direct.md index 79f2889..e3465f0 100644 --- a/test/hpke/cose/direct.md +++ b/test/hpke/cose/direct.md @@ -21,7 +21,7 @@ h'a10139d902', { 4: "test-key-42", - -22222: h'042b5c4...ed24ca04' / encapsulated key / + -4: h'042b5c4...ed24ca04' / encapsulated key / }, h'a054152691ebb37a679699be32e88979454aa474f87f05c866ad84' / cipher text / ]) diff --git a/test/hpke/cose/wrap.md b/test/hpke/cose/wrap.md index 69bbe6f..2a47cc5 100644 --- a/test/hpke/cose/wrap.md +++ b/test/hpke/cose/wrap.md @@ -28,7 +28,7 @@ h'a10139d902', { 4: "test-key-42", - -22222: h'0465031...c93fa9f' / encapsulated key / + -4: h'0465031...c93fa9f' / encapsulated key / }, h'9a78b4020d7320d7ffc9aff1f440acc7557a431497ff158dcc04b6644a20cda5' / encrypted key / ]