diff --git a/frontend/src/models/Slot.model.ts b/frontend/src/models/Slot.model.ts index ec560a1e..cb6883c4 100644 --- a/frontend/src/models/Slot.model.ts +++ b/frontend/src/models/Slot.model.ts @@ -1,5 +1,6 @@ import { sha256 } from 'js-sha256'; import { sha256 as sha256Hash } from '@noble/hashes/sha256'; +import { sha512 } from '@noble/hashes/sha512'; import { Robot, Order, type Federation } from '.'; import { roboidentitiesClient } from '../services/Roboidentities/Web'; import { hexToBase91, validateTokenEntropy } from '../utils'; @@ -27,8 +28,8 @@ class Slot { const { hasEnoughEntropy, bitsEntropy, shannonEntropy } = validateTokenEntropy(token); const tokenSHA256 = hexToBase91(sha256(token)); - const nostrHash = sha256Hash(this.token); - this.nostrSecKey = new Uint8Array(nostrHash); + const nostrHash = sha256Hash(sha512(this.token)); + this.nostrSecKey = nostrHash; const nostrPubKey = getPublicKey(this.nostrSecKey); this.nostrPubKey = nostrPubKey;