Compare commits

..

2 Commits

Author SHA1 Message Date
semantic-release-bot 50ba311259 chore(release): 0.2.0 [skip ci]
# [0.2.0](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.1.3...v0.2.0) (2023-06-21)

### Features

* add deriveChildKey function ([d7cdaaf](d7cdaaf316))
2023-06-21 08:33:25 +00:00
Derrick Hammer d7cdaaf316
feat: add deriveChildKey function 2023-06-21 04:32:31 -04:00
5 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.2.0](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.1.3...v0.2.0) (2023-06-21)
### Features
* add deriveChildKey function ([d7cdaaf](https://git.lumeweb.com/LumeWeb/libweb/commit/d7cdaaf316d4d26ed44860701376d18030030708))
## [0.1.3](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.1.2...v0.1.3) (2023-06-21)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/libweb",
"version": "0.1.3",
"version": "0.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/libweb",
"version": "0.1.3",
"version": "0.2.0",
"dependencies": {
"@lumeweb/libportal": "^0.1.0",
"@noble/curves": "^1.1.0",

View File

@ -1,6 +1,6 @@
{
"name": "@lumeweb/libweb",
"version": "0.1.3",
"version": "0.2.0",
"main": "lib/index.js",
"type": "module",
"repository": {

View File

@ -9,4 +9,5 @@ export * from "./stringifyJSON.js";
export * from "./types.js";
export * from "./cid.js";
export * from "./encoding.js";
export * from "./keys.js";
export { ed25519, sha512 };

11
src/keys.ts Normal file
View File

@ -0,0 +1,11 @@
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));
}