Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vostokplatform/signature-generator

Package Overview
Dependencies
Maintainers
6
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vostokplatform/signature-generator - npm Package Compare versions

Comparing version 1.1.2 to 1.2.1

dist/byteProcessor/ByteProcessor.js

2

package.json
{
"name": "@vostokplatform/signature-generator",
"version": "1.1.2",
"version": "1.2.1",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "files": [

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require("../");
const __1 = require("../");
const DEFAULT_CONFIG = {
networkByte: _1.MAINNET_BYTE,
networkByte: __1.MAINNET_BYTE,
logLevel: 'warning',

@@ -7,0 +7,0 @@ minimalSeedLength: 15,

@@ -38,4 +38,4 @@ "use strict";

exports.PUBLIC_KEY_LENGTH = 32;
exports.PUBLIC_KEY_LENGTH_GOST = 64;
exports.PUBLIC_KEY_GOST_LENGTH = 64;
// That is to mark ByteProcessor instances which cannot be affected by user
exports.STUB_NAME = 'reservedName';

@@ -101,5 +101,5 @@ export const PERMISSION_TRANSACTION_ROLE = {

export const PUBLIC_KEY_LENGTH: number = 32;
export const PUBLIC_KEY_LENGTH_GOST: number = 64;
export const PUBLIC_KEY_GOST_LENGTH: number = 64;
// That is to mark ByteProcessor instances which cannot be affected by user
export const STUB_NAME = 'reservedName';

@@ -253,3 +253,3 @@ "use strict";

for (var i = 0; i < input.length; i++) {
if (ctx.c === 128) {
if (ctx.c === 128) { // buffer full ?
ctx.t += ctx.c; // add counters

@@ -267,3 +267,3 @@ blake2bCompress(ctx, false); // compress (not last)

ctx.t += ctx.c; // mark last block offset
while (ctx.c < 128) {
while (ctx.c < 128) { // fill up with zeros
ctx.b[ctx.c++] = 0;

@@ -270,0 +270,0 @@ }

@@ -44,8 +44,8 @@ "use strict";

options = options || { type: 'Array' };
if (typeof window !== 'undefined' || typeof self !== 'undefined') {
if (typeof exports === 'object' && typeof module !== 'undefined') {
return nodeRandom(count, options);
}
else if (typeof window !== 'undefined' || typeof self !== 'undefined') {
return browserRandom(count, options);
}
else if (typeof exports === 'object' && typeof module !== 'undefined') {
return nodeRandom(count, options);
}
else {

@@ -52,0 +52,0 @@ throw new Error('Your environment is not defined');

@@ -52,8 +52,8 @@ declare let exports: any;

options = options || { type: 'Array' };
options = options || {type: 'Array'};
if (typeof window !== 'undefined' || typeof self !== 'undefined') {
if (typeof exports === 'object' && typeof module !== 'undefined') {
return nodeRandom(count, options);
} else if (typeof window !== 'undefined' || typeof self !== 'undefined') {
return browserRandom(count, options);
} else if (typeof exports === 'object' && typeof module !== 'undefined') {
return nodeRandom(count, options);
} else {

@@ -71,13 +71,13 @@ throw new Error('Your environment is not defined');

randomArray(byteCount) {
return secureRandom(byteCount, { type: 'Array' });
return secureRandom(byteCount, {type: 'Array'});
},
randomUint8Array(byteCount) {
return secureRandom(byteCount, { type: 'Uint8Array' });
return secureRandom(byteCount, {type: 'Uint8Array'});
},
randomBuffer(byteCount) {
return secureRandom(byteCount, { type: 'Buffer' });
return secureRandom(byteCount, {type: 'Buffer'});
}
};

@@ -52,2 +52,3 @@ "use strict";

return this.getBytes().then((dataBytes) => {
console.log('crypto', Config_1.config.isCryptoGost());
return Config_1.config.isCryptoGost()

@@ -217,3 +218,3 @@ ? cryptoGost_1.default.buildTransactionSignature(dataBytes, privateKey)

new __1.Long('timestamp'),
new __1.Base58('transactionId')
new __1.Base58('leaseId')
]);

@@ -220,0 +221,0 @@ exports.TX_NUMBER_MAP[9 /* CANCEL_LEASING */] = CANCEL_LEASING;

@@ -88,2 +88,3 @@ import {

return this.getBytes().then((dataBytes) => {
console.log('crypto', config.isCryptoGost())
return config.isCryptoGost()

@@ -274,3 +275,3 @@ ? cryptoGost.buildTransactionSignature(dataBytes, privateKey)

new Long('timestamp'),
new Base58('transactionId')
new Base58('leaseId')
]);

@@ -277,0 +278,0 @@

@@ -11,3 +11,3 @@ "use strict";

const concat_1 = require("./concat");
const _1 = require("../");
const __1 = require("../");
const constants_1 = require("../constants");

@@ -102,3 +102,3 @@ function sha256(input) {

const addressBytes = base58_1.default.decode(address);
if (addressBytes[0] !== 1 || addressBytes[1] !== _1.config.getNetworkByte()) {
if (addressBytes[0] !== 1 || addressBytes[1] !== __1.config.getNetworkByte()) {
return false;

@@ -120,3 +120,3 @@ }

}
const prefix = Uint8Array.from([constants_1.ADDRESS_VERSION, _1.config.getNetworkByte()]);
const prefix = Uint8Array.from([constants_1.ADDRESS_VERSION, __1.config.getNetworkByte()]);
const publicKeyHashPart = Uint8Array.from(hashChain(publicKeyBytes).slice(0, 20));

@@ -123,0 +123,0 @@ const rawAddress = concat_1.concatUint8Arrays(prefix, publicKeyHashPart);

@@ -7,3 +7,3 @@ "use strict";

const concat_1 = require("./concat");
const _1 = require("../");
const __1 = require("../");
const constants_1 = require("../constants");

@@ -65,3 +65,3 @@ const gost_1 = require("../libs/gost");

const addressBytes = base58_1.default.decode(address);
if (addressBytes[0] !== 1 || addressBytes[1] !== _1.config.getNetworkByte()) {
if (addressBytes[0] !== 1 || addressBytes[1] !== __1.config.getNetworkByte()) {
return false;

@@ -83,6 +83,6 @@ }

}
if (!publicKeyBytes || publicKeyBytes.byteLength !== constants_1.PUBLIC_KEY_LENGTH_GOST || !(publicKeyBytes instanceof Uint8Array)) {
if (!publicKeyBytes || publicKeyBytes.byteLength !== constants_1.PUBLIC_KEY_GOST_LENGTH || !(publicKeyBytes instanceof Uint8Array)) {
throw new Error('Missing or invalid public key');
}
const prefix = Uint8Array.from([constants_1.ADDRESS_VERSION, _1.config.getNetworkByte()]);
const prefix = Uint8Array.from([constants_1.ADDRESS_VERSION, __1.config.getNetworkByte()]);
const publicKeyHashPart = gost_1.default.streebog256(publicKeyBytes).slice(0, 20);

@@ -89,0 +89,0 @@ const rawAddress = concat_1.concatUint8Arrays(prefix, publicKeyHashPart);

@@ -12,3 +12,3 @@ import * as CryptoJS from 'crypto-js';

import { config } from '../';
import { ADDRESS_VERSION, INITIAL_NONCE, PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH_GOST as PUBLIC_KEY_LENGTH } from '../constants';
import { ADDRESS_VERSION, INITIAL_NONCE, PRIVATE_KEY_LENGTH, PUBLIC_KEY_GOST_LENGTH as PUBLIC_KEY_LENGTH } from '../constants';
import { IKeyPairBytes } from '../interface';

@@ -15,0 +15,0 @@ import cryptoGost from '../libs/gost';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc