Skip to content

Commit

Permalink
force app to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Jan 10, 2025
1 parent 9606e3c commit 0d79d10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {generateAdaMnemonic} from '../mnemonic/mnemonic'
export async function generatePrivateKeyForCatalyst() {
const mnemonic = generateAdaMnemonic()
const bip39entropy = mnemonicToEntropy(mnemonic)
const EMPTY_PASSWORD = Buffer.from('')
const EMPTY_PASSWORD = Uint8Array.from([])
const rootKey = await CardanoMobile.Bip32PrivateKey.fromBip39Entropy(Buffer.from(bip39entropy, 'hex'), EMPTY_PASSWORD)

return rootKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import {generateMnemonic, mnemonicToEntropy} from 'bip39'
import {randomBytes} from 'react-native-randombytes'

import {wrappedCsl} from '../wrappedCsl'
import {CardanoMobile} from '../../wallets'

const mnemonicStrengh = 160

export const generateAdaMnemonic = () => generateMnemonic(mnemonicStrengh, randomBytes)

export const generateWalletRootKey = async (mnemonic: string, csl: WasmModuleProxy) => {
const bip39entropy = mnemonicToEntropy(mnemonic)
const emptyPassword = Buffer.from('')
const emptyPassword = Uint8Array.from([])
const rootKey = await csl.Bip32PrivateKey.fromBip39Entropy(Buffer.from(bip39entropy, 'hex'), emptyPassword)

return rootKey
Expand All @@ -25,3 +26,11 @@ export const getMasterKeyFromMnemonic = async (mnemonic: string) => {
release()
return rootKey
}

const mnemonic =
'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon share'

const result = mnemonicToEntropy(mnemonic)
const emptyPassword = Uint8Array.from([])

CardanoMobile.Bip32PrivateKey.fromBip39Entropy(Buffer.from(result, 'hex'), emptyPassword)

0 comments on commit 0d79d10

Please sign in to comment.