@@ -197,9 +197,9 @@ export class SlhDsaSha2128sPrivateKey extends Serializable implements PrivateKey
197197 /**
198198 * The SLH-DSA-SHA2-128s key seed to use for BIP-32 compatibility
199199 * See more {@link https://github.com/satoshilabs/slips/blob/master/slip-0010.md}
200- *
200+ *
201201 * TODO: This is not standardized... AFAIK.
202- *
202+ *
203203 * @group Implementation
204204 * @category Serialization
205205 */
@@ -286,7 +286,6 @@ export class SlhDsaSha2128sPrivateKey extends Serializable implements PrivateKey
286286 return new SlhDsaSha2128sSignature ( signatureBytes ) ;
287287 }
288288
289-
290289 /**
291290 * Derives a private key from a mnemonic seed phrase using a specified BIP44 path.
292291 * To derive multiple keys from the same phrase, change the path
@@ -308,7 +307,7 @@ export class SlhDsaSha2128sPrivateKey extends Serializable implements PrivateKey
308307
309308 /**
310309 * Derives a child private key from a given BIP44 path and seed.
311- *
310+ *
312311 * We derive our 48-byte SLH-DSA key (three 16-byte seeds) from:
313312 * - the 32-byte, BIP-32-derived, secret key
314313 * - the first 16 bytes of the BIP-32-derived chain code
@@ -320,24 +319,31 @@ export class SlhDsaSha2128sPrivateKey extends Serializable implements PrivateKey
320319 * @group Implementation
321320 * @category Serialization
322321 */
323- private static fromDerivationPathInner ( path : string , seed : Uint8Array , offset = HARDENED_OFFSET ) : SlhDsaSha2128sPrivateKey {
322+ private static fromDerivationPathInner (
323+ path : string ,
324+ seed : Uint8Array ,
325+ offset = HARDENED_OFFSET ,
326+ ) : SlhDsaSha2128sPrivateKey {
324327 const { key, chainCode } = deriveKey ( SlhDsaSha2128sPrivateKey . SLIP_0010_SEED , seed ) ;
325328
326329 const segments = splitPath ( path ) . map ( ( el ) => parseInt ( el , 10 ) ) ;
327330
328331 // Derive the child key based on the path
329- const { key : privateKey , chainCode : finalChainCode } = segments . reduce ( ( parentKeys , segment ) => CKDPriv ( parentKeys , segment + offset ) , {
330- key,
331- chainCode,
332- } ) ;
333-
332+ const { key : privateKey , chainCode : finalChainCode } = segments . reduce (
333+ ( parentKeys , segment ) => CKDPriv ( parentKeys , segment + offset ) ,
334+ {
335+ key,
336+ chainCode,
337+ } ,
338+ ) ;
339+
334340 const threeSeeds = new Uint8Array ( 48 ) ;
335341 threeSeeds . set ( privateKey , 0 ) ; // First 32 bytes from the derived secret key
336342
337343 // TODO: We would need to reason about the security of this.
338344 // e.g., is it okay to treat the chain code as public?
339345 threeSeeds . set ( finalChainCode . slice ( 0 , 16 ) , 32 ) ; // Last 16 bytes from the derived chain code
340-
346+
341347 return new SlhDsaSha2128sPrivateKey ( threeSeeds , false ) ;
342348 }
343349
0 commit comments