Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 9b7c8f1e82 chore(release): 0.2.0-develop.32 [skip ci]
# [0.2.0-develop.32](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.31...v0.2.0-develop.32) (2023-08-20)

### Features

* change deriveChildKey to hkdf sha256 and create deriveBlakeChildKey that hashes based on the initial blake3 route used by s5 ([7fefaf0](7fefaf0818))
2023-08-20 06:36:33 +00:00
Derrick Hammer 63e73ced76
Merge remote-tracking branch 'origin/develop' into develop 2023-08-20 02:35:38 -04:00
Derrick Hammer 7fefaf0818
feat: change deriveChildKey to hkdf sha256 and create deriveBlakeChildKey that hashes based on the initial blake3 route used by s5 2023-08-20 02:35:17 -04:00
4 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.2.0-develop.32](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.31...v0.2.0-develop.32) (2023-08-20)
### Features
* change deriveChildKey to hkdf sha256 and create deriveBlakeChildKey that hashes based on the initial blake3 route used by s5 ([7fefaf0](https://git.lumeweb.com/LumeWeb/libweb/commit/7fefaf0818417f1cc4ae0c9f360e5b08734d68f3))
# [0.2.0-develop.31](https://git.lumeweb.com/LumeWeb/libweb/compare/v0.2.0-develop.30...v0.2.0-develop.31) (2023-08-15)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.31",
"version": "0.2.0-develop.32",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@lumeweb/libweb",
"version": "0.2.0-develop.31",
"version": "0.2.0-develop.32",
"dependencies": {
"@lumeweb/community-portals": "^0.1.0-develop.6",
"@lumeweb/libportal": "0.2.0-develop.17",

View File

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

View File

@ -1,9 +1,18 @@
import { blake3 } from "@noble/hashes/blake3";
import { concatBytes } from "@noble/hashes/utils";
import { hkdf } from "@noble/hashes/hkdf";
import { sha256 } from "@noble/hashes/sha256";
export function deriveChildKey(
parentKey: Uint8Array,
tweak: string,
): Uint8Array {
return hkdf(sha256, parentKey, undefined, tweak, 32);
}
export function deriveBlakeChildKey(
parentKey: Uint8Array,
tweak: string,
): Uint8Array {
const tweakHash = blake3(tweak);