@polkadot/util-crypto
Advanced tools
Comparing version 12.4.2 to 12.5.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.packageInfo = void 0; | ||
exports.packageInfo = { name: '@polkadot/util-crypto', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '12.4.2' }; | ||
exports.packageInfo = { name: '@polkadot/util-crypto', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '12.5.1' }; |
@@ -12,5 +12,6 @@ "use strict"; | ||
const r = (0, util_1.u8aToBn)(data.subarray(32 + 8, 32 + 12), bn_js_1.BN_LE_OPTS).toNumber(); | ||
// FIXME At this moment we assume these to be fixed params, this is not a great idea since we lose flexibility | ||
// and updates for greater security. However we need some protection against carefully-crafted params that can | ||
// eat up CPU since these are user inputs. So we need to get very clever here, but atm we only allow the defaults | ||
// FIXME At this moment we assume these to be fixed params, this is not a great idea | ||
// since we lose flexibility and updates for greater security. However we need some | ||
// protection against carefully-crafted params that can eat up CPU since these are user | ||
// inputs. So we need to get very clever here, but atm we only allow the defaults | ||
// and if no match, bail out | ||
@@ -17,0 +18,0 @@ if (N !== defaults_js_1.DEFAULT_PARAMS.N || p !== defaults_js_1.DEFAULT_PARAMS.p || r !== defaults_js_1.DEFAULT_PARAMS.r) { |
export type EncryptedJsonVersion = '0' | '1' | '2' | '3'; | ||
export type EncryptedJsonEncoding = 'none' | 'scrypt' | 'xsalsa20-poly1305'; | ||
export interface EncryptedJsonDescriptor { | ||
/** Descriptor for the content */ | ||
content: string[]; | ||
/** The encoding (in current/latest versions this is always an array) */ | ||
type: EncryptedJsonEncoding | EncryptedJsonEncoding[]; | ||
/** The version of encoding applied */ | ||
version: EncryptedJsonVersion; | ||
} | ||
export interface EncryptedJson { | ||
/** The encoded string */ | ||
encoded: string; | ||
/** The encoding used */ | ||
encoding: EncryptedJsonDescriptor; | ||
} |
import { DeriveJunction } from './DeriveJunction.js'; | ||
export interface ExtractResult { | ||
parts: null | string[]; | ||
parts: string[] | null; | ||
path: DeriveJunction[]; | ||
@@ -5,0 +5,0 @@ } |
@@ -23,3 +23,3 @@ { | ||
"type": "module", | ||
"version": "12.4.2", | ||
"version": "12.5.1", | ||
"main": "./cjs/index.js", | ||
@@ -905,16 +905,16 @@ "module": "./index.js", | ||
"dependencies": { | ||
"@noble/curves": "1.1.0", | ||
"@noble/hashes": "1.3.1", | ||
"@polkadot/networks": "12.4.2", | ||
"@polkadot/util": "12.4.2", | ||
"@noble/curves": "^1.2.0", | ||
"@noble/hashes": "^1.3.2", | ||
"@polkadot/networks": "12.5.1", | ||
"@polkadot/util": "12.5.1", | ||
"@polkadot/wasm-crypto": "^7.2.2", | ||
"@polkadot/wasm-util": "^7.2.2", | ||
"@polkadot/x-bigint": "12.4.2", | ||
"@polkadot/x-randomvalues": "12.4.2", | ||
"@scure/base": "1.1.1", | ||
"@polkadot/x-bigint": "12.5.1", | ||
"@polkadot/x-randomvalues": "12.5.1", | ||
"@scure/base": "^1.1.3", | ||
"tslib": "^2.6.2" | ||
}, | ||
"peerDependencies": { | ||
"@polkadot/util": "12.4.2" | ||
"@polkadot/util": "12.5.1" | ||
} | ||
} |
@@ -1,1 +0,1 @@ | ||
export const packageInfo = { name: '@polkadot/util-crypto', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '12.4.2' }; | ||
export const packageInfo = { name: '@polkadot/util-crypto', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '12.5.1' }; |
@@ -1,5 +0,2 @@ | ||
export declare const DEFAULT_PARAMS: { | ||
N: number; | ||
p: number; | ||
r: number; | ||
}; | ||
import type { ScryptParams } from './types.js'; | ||
export declare const DEFAULT_PARAMS: ScryptParams; |
@@ -1,12 +0,8 @@ | ||
import type { Params } from './types.js'; | ||
import type { ScryptParams } from './types.js'; | ||
interface Result { | ||
params: Params; | ||
params: ScryptParams; | ||
password: Uint8Array; | ||
salt: Uint8Array; | ||
} | ||
export declare function scryptEncode(passphrase?: string | Uint8Array, salt?: Uint8Array, params?: { | ||
N: number; | ||
p: number; | ||
r: number; | ||
}, onlyJs?: boolean): Result; | ||
export declare function scryptEncode(passphrase?: string | Uint8Array, salt?: Uint8Array, params?: ScryptParams, onlyJs?: boolean): Result; | ||
export {}; |
@@ -1,4 +0,4 @@ | ||
import type { Params } from './types.js'; | ||
import type { ScryptParams } from './types.js'; | ||
interface Result { | ||
params: Params; | ||
params: ScryptParams; | ||
salt: Uint8Array; | ||
@@ -5,0 +5,0 @@ } |
@@ -9,5 +9,6 @@ import { u8aToBn } from '@polkadot/util'; | ||
const r = u8aToBn(data.subarray(32 + 8, 32 + 12), BN_LE_OPTS).toNumber(); | ||
// FIXME At this moment we assume these to be fixed params, this is not a great idea since we lose flexibility | ||
// and updates for greater security. However we need some protection against carefully-crafted params that can | ||
// eat up CPU since these are user inputs. So we need to get very clever here, but atm we only allow the defaults | ||
// FIXME At this moment we assume these to be fixed params, this is not a great idea | ||
// since we lose flexibility and updates for greater security. However we need some | ||
// protection against carefully-crafted params that can eat up CPU since these are user | ||
// inputs. So we need to get very clever here, but atm we only allow the defaults | ||
// and if no match, bail out | ||
@@ -14,0 +15,0 @@ if (N !== DEFAULT_PARAMS.N || p !== DEFAULT_PARAMS.p || r !== DEFAULT_PARAMS.r) { |
@@ -1,2 +0,2 @@ | ||
import type { Params } from './types.js'; | ||
export declare function scryptToU8a(salt: Uint8Array, { N, p, r }: Params): Uint8Array; | ||
import type { ScryptParams } from './types.js'; | ||
export declare function scryptToU8a(salt: Uint8Array, { N, p, r }: ScryptParams): Uint8Array; |
@@ -1,2 +0,3 @@ | ||
export interface Params { | ||
/** The params that control scrypt generation */ | ||
export interface ScryptParams { | ||
N: number; | ||
@@ -3,0 +4,0 @@ p: number; |
export * from './address/types.js'; | ||
export * from './json/types.js'; | ||
export interface Keypair { | ||
/** The publicKey for this pair */ | ||
publicKey: Uint8Array; | ||
/** The secretKey for this pair */ | ||
secretKey: Uint8Array; | ||
} | ||
export interface Seedpair { | ||
/** The publicKey for this pair */ | ||
publicKey: Uint8Array; | ||
/** The seed used to construct the pair */ | ||
seed: Uint8Array; | ||
} | ||
/** The supported types of pairs */ | ||
export type KeypairType = 'ed25519' | 'sr25519' | 'ecdsa' | 'ethereum'; | ||
export interface VerifyResult { | ||
/** The detected crypto interface, or 'none' if not detected */ | ||
crypto: 'none' | KeypairType; | ||
/** The validity for this result, false if invalid */ | ||
isValid: boolean; | ||
/** Flag to indicate if the passed data was wrapped in <Bytes>...</Bytes> */ | ||
isWrapped: boolean; | ||
/** The extracted publicKey */ | ||
publicKey: Uint8Array; | ||
} |
Sorry, the diff of this file is too big to display
1139469
17011
+ Added@noble/curves@1.4.0(transitive)
+ Added@noble/hashes@1.4.0(transitive)
+ Added@polkadot/networks@12.5.1(transitive)
+ Added@polkadot/util@12.5.1(transitive)
+ Added@polkadot/x-bigint@12.5.1(transitive)
+ Added@polkadot/x-global@12.5.1(transitive)
+ Added@polkadot/x-randomvalues@12.5.1(transitive)
+ Added@polkadot/x-textdecoder@12.5.1(transitive)
+ Added@polkadot/x-textencoder@12.5.1(transitive)
+ Added@scure/base@1.1.6(transitive)
- Removed@noble/curves@1.1.0(transitive)
- Removed@noble/hashes@1.3.1(transitive)
- Removed@polkadot/networks@12.4.2(transitive)
- Removed@polkadot/util@12.4.2(transitive)
- Removed@polkadot/x-bigint@12.4.2(transitive)
- Removed@polkadot/x-global@12.4.2(transitive)
- Removed@polkadot/x-randomvalues@12.4.2(transitive)
- Removed@polkadot/x-textdecoder@12.4.2(transitive)
- Removed@polkadot/x-textencoder@12.4.2(transitive)
- Removed@scure/base@1.1.1(transitive)
Updated@noble/curves@^1.2.0
Updated@noble/hashes@^1.3.2
Updated@polkadot/networks@12.5.1
Updated@polkadot/util@12.5.1
Updated@polkadot/x-bigint@12.5.1
Updated@scure/base@^1.1.3