12 lines
279 B
TypeScript
12 lines
279 B
TypeScript
|
import { blake3 } from "@noble/hashes/blake3";
|
||
|
import { concatBytes } from "@noble/hashes/utils";
|
||
|
|
||
|
export function deriveChildKey(
|
||
|
parentKey: Uint8Array,
|
||
|
tweak: string,
|
||
|
): Uint8Array {
|
||
|
const tweakHash = blake3(tweak);
|
||
|
|
||
|
return blake3(concatBytes(parentKey, tweakHash));
|
||
|
}
|