@peac/crypto 0.9.18 → 0.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 PEAC Protocol Contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Typed errors for @peac/crypto
3
+ *
4
+ * These error codes are INTERNAL to @peac/crypto and should NOT be exposed
5
+ * as protocol-stable API. Higher-level packages (like @peac/protocol) should
6
+ * map these to canonical E_* codes from specs/kernel/errors.json.
7
+ *
8
+ * The CRYPTO_ prefix makes it clear these are package-internal codes.
9
+ */
10
+ /**
11
+ * Internal error codes for crypto operations
12
+ *
13
+ * These are NOT canonical protocol error codes. They are internal to @peac/crypto.
14
+ * @peac/protocol maps these to canonical E_* codes (E_INVALID_FORMAT, etc).
15
+ */
16
+ export type CryptoErrorCode = 'CRYPTO_INVALID_KEY_LENGTH' | 'CRYPTO_INVALID_SEED_LENGTH' | 'CRYPTO_INVALID_JWS_FORMAT' | 'CRYPTO_INVALID_TYP' | 'CRYPTO_INVALID_ALG' | 'CRYPTO_INVALID_SIGNATURE';
17
+ /**
18
+ * Typed error for crypto operations
19
+ *
20
+ * Use `err.code` to handle errors programmatically without message parsing.
21
+ * The code is a CRYPTO_* internal code, not a canonical E_* protocol code.
22
+ */
23
+ export declare class CryptoError extends Error {
24
+ readonly code: CryptoErrorCode;
25
+ constructor(code: CryptoErrorCode, message: string);
26
+ }
27
+ /**
28
+ * Check if a CryptoError code indicates a format/structure issue
29
+ * (as opposed to a cryptographic verification failure)
30
+ *
31
+ * @internal This is an internal helper, not part of the public API.
32
+ * Use structural checks on CryptoError.code instead of relying on this function.
33
+ */
34
+ export declare function isFormatError(code: CryptoErrorCode): boolean;
35
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GACvB,2BAA2B,GAC3B,4BAA4B,GAC5B,2BAA2B,GAC3B,oBAAoB,GACpB,oBAAoB,GACpB,0BAA0B,CAAC;AAE/B;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;gBAEnB,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM;CAOnD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAQ5D"}
package/dist/errors.js ADDED
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /**
3
+ * Typed errors for @peac/crypto
4
+ *
5
+ * These error codes are INTERNAL to @peac/crypto and should NOT be exposed
6
+ * as protocol-stable API. Higher-level packages (like @peac/protocol) should
7
+ * map these to canonical E_* codes from specs/kernel/errors.json.
8
+ *
9
+ * The CRYPTO_ prefix makes it clear these are package-internal codes.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CryptoError = void 0;
13
+ exports.isFormatError = isFormatError;
14
+ /**
15
+ * Typed error for crypto operations
16
+ *
17
+ * Use `err.code` to handle errors programmatically without message parsing.
18
+ * The code is a CRYPTO_* internal code, not a canonical E_* protocol code.
19
+ */
20
+ class CryptoError extends Error {
21
+ code;
22
+ constructor(code, message) {
23
+ super(message);
24
+ this.name = 'CryptoError';
25
+ this.code = code;
26
+ // Maintain proper prototype chain for instanceof checks
27
+ Object.setPrototypeOf(this, CryptoError.prototype);
28
+ }
29
+ }
30
+ exports.CryptoError = CryptoError;
31
+ /**
32
+ * Check if a CryptoError code indicates a format/structure issue
33
+ * (as opposed to a cryptographic verification failure)
34
+ *
35
+ * @internal This is an internal helper, not part of the public API.
36
+ * Use structural checks on CryptoError.code instead of relying on this function.
37
+ */
38
+ function isFormatError(code) {
39
+ return (code === 'CRYPTO_INVALID_JWS_FORMAT' ||
40
+ code === 'CRYPTO_INVALID_TYP' ||
41
+ code === 'CRYPTO_INVALID_ALG' ||
42
+ code === 'CRYPTO_INVALID_KEY_LENGTH' ||
43
+ code === 'CRYPTO_INVALID_SEED_LENGTH');
44
+ }
45
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAyCH,sCAQC;AAjCD;;;;;GAKG;AACH,MAAa,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAkB;IAE/B,YAAY,IAAqB,EAAE,OAAe;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,wDAAwD;QACxD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF;AAVD,kCAUC;AAED;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,IAAqB;IACjD,OAAO,CACL,IAAI,KAAK,2BAA2B;QACpC,IAAI,KAAK,oBAAoB;QAC7B,IAAI,KAAK,oBAAoB;QAC7B,IAAI,KAAK,2BAA2B;QACpC,IAAI,KAAK,4BAA4B,CACtC,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  * Ed25519 JWS signing/verification and JSON Canonicalization (RFC 8785)
4
4
  */
5
5
  export * from './base64url';
6
+ export * from './errors';
6
7
  export * from './jcs';
7
8
  export * from './jws';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,OAAO,CAAC"}
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  __exportStar(require("./base64url"), exports);
22
+ __exportStar(require("./errors"), exports);
22
23
  __exportStar(require("./jcs"), exports);
23
24
  __exportStar(require("./jws"), exports);
24
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,wCAAsB;AACtB,wCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,2CAAyB;AACzB,wCAAsB;AACtB,wCAAsB"}
package/dist/jws.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"jws.d.ts","sourceRoot":"","sources":["../src/jws.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQvD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,OAAO,aAAa,CAAC;IAC1B,GAAG,EAAE,OAAO,QAAQ,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,OAAO;IACvC,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,CAAC,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BjG;AAED;;;;;;GAMG;AACH,wBAAsB,MAAM,CAAC,CAAC,GAAG,OAAO,EACtC,GAAG,EAAE,MAAM,EACX,S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AS,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,CAkBlF;AAED;;;;GAIG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC,CAKD"}
package/dist/jws.js CHANGED
@@ -44,6 +44,7 @@ exports.generateKeypair = generateKeypair;
44
44
  const ed25519 = __importStar(require("@noble/ed25519"));
45
45
  const schema_1 = require("@peac/schema");
46
46
  const base64url_1 = require("./base64url");
47
+ const errors_1 = require("./errors");
47
48
  /**
48
49
  * Sign a payload with Ed25519 and return JWS compact serialization
49
50
  *
@@ -54,7 +55,7 @@ const base64url_1 = require("./base64url");
54
55
  */
55
56
  async function sign(payload, privateKey, kid) {
56
57
  if (privateKey.length !== 32) {
57
- throw new Error('Ed25519 private key must be 32 bytes');
58
+ throw new errors_1.CryptoError('CRYPTO_INVALID_KEY_LENGTH', 'Ed25519 private key must be 32 bytes');
58
59
  }
59
60
  // Create header
60
61
  const header = {
@@ -84,12 +85,12 @@ async function sign(payload, privateKey, kid) {
84
85
  */
85
86
  async function verify(jws, publicKey) {
86
87
  if (publicKey.length !== 32) {
87
- throw new Error('Ed25519 public key must be 32 bytes');
88
+ throw new errors_1.CryptoError('CRYPTO_INVALID_KEY_LENGTH', 'Ed25519 public key must be 32 bytes');
88
89
  }
89
90
  // Split JWS
90
91
  const parts = jws.split('.');
91
92
  if (parts.length !== 3) {
92
- throw new Error('Invalid JWS: must have three dot-separated parts');
93
+ throw new errors_1.CryptoError('CRYPTO_INVALID_JWS_FORMAT', 'Invalid JWS: must have three dot-separated parts');
93
94
  }
94
95
  const [headerB64, payloadB64, signatureB64] = parts;
95
96
  // Decode header
@@ -97,10 +98,10 @@ async function verify(jws, publicKey) {
97
98
  const header = JSON.parse(headerJson);
98
99
  // Validate header
99
100
  if (header.typ !== schema_1.PEAC_WIRE_TYP) {
100
- throw new Error(`Invalid typ: expected ${schema_1.PEAC_WIRE_TYP}, got ${header.typ}`);
101
+ throw new errors_1.CryptoError('CRYPTO_INVALID_TYP', `Invalid typ: expected ${schema_1.PEAC_WIRE_TYP}, got ${header.typ}`);
101
102
  }
102
103
  if (header.alg !== schema_1.PEAC_ALG) {
103
- throw new Error(`Invalid alg: expected ${schema_1.PEAC_ALG}, got ${header.alg}`);
104
+ throw new errors_1.CryptoError('CRYPTO_INVALID_ALG', `Invalid alg: expected ${schema_1.PEAC_ALG}, got ${header.alg}`);
104
105
  }
105
106
  // Decode payload
106
107
  const payloadJson = (0, base64url_1.base64urlDecodeString)(payloadB64);
@@ -126,7 +127,7 @@ async function verify(jws, publicKey) {
126
127
  function decode(jws) {
127
128
  const parts = jws.split('.');
128
129
  if (parts.length !== 3) {
129
- throw new Error('Invalid JWS: must have three dot-separated parts');
130
+ throw new errors_1.CryptoError('CRYPTO_INVALID_JWS_FORMAT', 'Invalid JWS: must have three dot-separated parts');
130
131
  }
131
132
  const [headerB64, payloadB64] = parts;
132
133
  const headerJson = (0, base64url_1.base64urlDecodeString)(headerB64);
@@ -145,4 +146,7 @@ async function generateKeypair() {
145
146
  const publicKey = await ed25519.getPublicKeyAsync(privateKey);
146
147
  return { privateKey, publicKey };
147
148
  }
149
+ // NOTE: generateKeypairFromSeed has been moved to @peac/crypto/testkit
150
+ // It's intentionally NOT exported from the main module to prevent accidental
151
+ // use in production. Use: import { generateKeypairFromSeed } from '@peac/crypto/testkit'
148
152
  //# sourceMappingURL=jws.js.map
package/dist/jws.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"jws.js","sourceRoot":"","sources":["../src/jws.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCH,oBA4BC;AASD,wBA8CC;AAQD,wBAeC;AAOD,0CAQC;AA5JD,wDAA0C;AAC1C,yCAAuD;AACvD,2CAKqB;AAoBrB;;;;;;;GAOG;AACI,KAAK,UAAU,IAAI,CAAC,OAAgB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CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC;IAEtC,MAAM,UAAU,GAAG,IAAA,iCAAqB,EAAC,SAAS,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAc,CAAC;IAEnD,MAAM,WAAW,GAAG,IAAA,iCAAqB,EAAC,UAAU,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAM,CAAC;IAE7C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,eAAe;IAInC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAE9D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC;AAED,uEAAuE;AACvE,6EAA6E;AAC7E,yFAAyF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * PEAC Crypto Test Kit
3
+ *
4
+ * This module contains utilities for TEST FIXTURES ONLY.
5
+ * These functions are NOT exported from the main entry point.
6
+ *
7
+ * Import path: @peac/crypto/testkit
8
+ *
9
+ * SECURITY: Never use these in production. Production bundlers can
10
+ * tree-shake this module away since it's a separate export path.
11
+ */
12
+ /**
13
+ * Generate an Ed25519 keypair from a deterministic seed.
14
+ *
15
+ * WARNING: FOR TEST FIXTURES ONLY. DO NOT USE IN PRODUCTION.
16
+ * Production code should use generateKeypair() which uses cryptographically
17
+ * secure random bytes. Seeded keys are predictable and compromise security.
18
+ *
19
+ * This function is intentionally in a separate module (@peac/crypto/testkit)
20
+ * so that production bundlers can tree-shake it away.
21
+ *
22
+ * @param seed - 32-byte seed (e.g., SHA-256 hash of a known string)
23
+ * @returns Private key (32 bytes) and public key (32 bytes)
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * // Use only in test fixtures for reproducibility
28
+ * import { generateKeypairFromSeed } from '@peac/crypto/testkit';
29
+ *
30
+ * const seed = sha256('peac-test-key-001');
31
+ * const { privateKey, publicKey } = await generateKeypairFromSeed(seed);
32
+ * ```
33
+ */
34
+ export declare function generateKeypairFromSeed(seed: Uint8Array): Promise<{
35
+ privateKey: Uint8Array;
36
+ publicKey: Uint8Array;
37
+ }>;
38
+ //# sourceMappingURL=testkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testkit.d.ts","sourceRoot":"","sources":["../src/testkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IACvE,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC,CAWD"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ /**
3
+ * PEAC Crypto Test Kit
4
+ *
5
+ * This module contains utilities for TEST FIXTURES ONLY.
6
+ * These functions are NOT exported from the main entry point.
7
+ *
8
+ * Import path: @peac/crypto/testkit
9
+ *
10
+ * SECURITY: Never use these in production. Production bundlers can
11
+ * tree-shake this module away since it's a separate export path.
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.generateKeypairFromSeed = generateKeypairFromSeed;
48
+ const ed25519 = __importStar(require("@noble/ed25519"));
49
+ const errors_js_1 = require("./errors.js");
50
+ /**
51
+ * Generate an Ed25519 keypair from a deterministic seed.
52
+ *
53
+ * WARNING: FOR TEST FIXTURES ONLY. DO NOT USE IN PRODUCTION.
54
+ * Production code should use generateKeypair() which uses cryptographically
55
+ * secure random bytes. Seeded keys are predictable and compromise security.
56
+ *
57
+ * This function is intentionally in a separate module (@peac/crypto/testkit)
58
+ * so that production bundlers can tree-shake it away.
59
+ *
60
+ * @param seed - 32-byte seed (e.g., SHA-256 hash of a known string)
61
+ * @returns Private key (32 bytes) and public key (32 bytes)
62
+ *
63
+ * @example
64
+ * ```ts
65
+ * // Use only in test fixtures for reproducibility
66
+ * import { generateKeypairFromSeed } from '@peac/crypto/testkit';
67
+ *
68
+ * const seed = sha256('peac-test-key-001');
69
+ * const { privateKey, publicKey } = await generateKeypairFromSeed(seed);
70
+ * ```
71
+ */
72
+ async function generateKeypairFromSeed(seed) {
73
+ if (seed.length !== 32) {
74
+ throw new errors_js_1.CryptoError('CRYPTO_INVALID_SEED_LENGTH', 'Ed25519 seed must be 32 bytes');
75
+ }
76
+ // In Ed25519, the private key IS the seed (32 bytes)
77
+ // The public key is derived from it
78
+ const privateKey = seed;
79
+ const publicKey = await ed25519.getPublicKeyAsync(privateKey);
80
+ return { privateKey, publicKey };
81
+ }
82
+ //# sourceMappingURL=testkit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testkit.js","sourceRoot":"","sources":["../src/testkit.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,0DAcC;AAvCD,wDAA0C;AAC1C,2CAA0C;AAE1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,KAAK,UAAU,uBAAuB,CAAC,IAAgB;IAI5D,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,uBAAW,CAAC,4BAA4B,EAAE,+BAA+B,CAAC,CAAC;IACvF,CAAC;IAED,qDAAqD;IACrD,oCAAoC;IACpC,MAAM,UAAU,GAAG,IAAI,CAAC;IACxB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAE9D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnC,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,23 @@
1
1
  {
2
2
  "name": "@peac/crypto",
3
- "version": "0.9.18",
3
+ "version": "0.9.31",
4
4
  "description": "Ed25519 JWS signing and verification for PEAC protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./testkit": {
15
+ "types": "./dist/testkit.d.ts",
16
+ "import": "./dist/testkit.js",
17
+ "require": "./dist/testkit.js",
18
+ "default": "./dist/testkit.js"
19
+ }
20
+ },
7
21
  "repository": {
8
22
  "type": "git",
9
23
  "url": "https://github.com/peacprotocol/peac.git",
@@ -22,19 +36,19 @@
22
36
  "publishConfig": {
23
37
  "access": "public"
24
38
  },
25
- "scripts": {
26
- "build": "tsc",
27
- "test": "vitest run",
28
- "test:watch": "vitest",
29
- "clean": "rm -rf dist"
30
- },
31
39
  "dependencies": {
32
40
  "@noble/ed25519": "^2.0.0",
33
- "@peac/schema": "workspace:*"
41
+ "@peac/schema": "0.9.31"
34
42
  },
35
43
  "devDependencies": {
36
44
  "@types/node": "^20.10.0",
37
45
  "typescript": "^5.3.3",
38
46
  "vitest": "^1.1.0"
47
+ },
48
+ "scripts": {
49
+ "build": "tsc",
50
+ "test": "vitest run",
51
+ "test:watch": "vitest",
52
+ "clean": "rm -rf dist"
39
53
  }
40
- }
54
+ }