Socket
Socket
Sign inDemoInstall

libsodium-neon

Package Overview
Dependencies
63
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.0.3

.eslintrc.yml

58

lib/index.js

@@ -24,3 +24,3 @@ /*

var objToBuffer = function(obj) {
var obj_to_buffer = function (obj) {
if (typeof Buffer.from === 'function') {

@@ -35,5 +35,5 @@ return new Uint8Array(Buffer.from(obj));

crypto_auth_BYTES: 32,
crypto_auth_hmacsha256: function(message, key) {
message = objToBuffer(message);
key = objToBuffer(key);
crypto_auth_hmacsha256: function (message, key) {
message = obj_to_buffer(message);
key = obj_to_buffer(key);

@@ -46,7 +46,7 @@ return new Uint8Array(sodiumneon.crypto_auth_hmacsha256(message, key));

crypto_hash_BYTES: 64,
crypto_scalarmult (secretKey, publicKey) {
secretKey = objToBuffer(secretKey);
publicKey = objToBuffer(publicKey);
crypto_scalarmult (secret_key, public_key) {
secret_key = obj_to_buffer(secret_key);
public_key = obj_to_buffer(public_key);
return new Uint8Array(sodiumneon.crypto_scalarmult(secretKey, publicKey));
return new Uint8Array(sodiumneon.crypto_scalarmult(secret_key, public_key));
},

@@ -56,25 +56,25 @@ crypto_scalarmult_BYTES: 32,

crypto_sign_BYTES: 64,
crypto_sign_detached: function(message, secretKey) {
message = objToBuffer(message);
secretKey = objToBuffer(secretKey);
crypto_sign_detached: function (message, secret_key) {
message = obj_to_buffer(message);
secret_key = obj_to_buffer(secret_key);
return new Uint8Array(sodiumneon.crypto_sign_detached(message, secretKey));
return new Uint8Array(sodiumneon.crypto_sign_detached(message, secret_key));
},
crypto_sign_ed25519_pk_to_curve25519: function(publicKey) {
publicKey = objToBuffer(publicKey);
crypto_sign_ed25519_pk_to_curve25519: function (public_key) {
public_key = obj_to_buffer(public_key);
return new Uint8Array(sodiumneon.crypto_sign_ed25519_pk_to_curve25519(publicKey));
return new Uint8Array(sodiumneon.crypto_sign_ed25519_pk_to_curve25519(public_key));
},
crypto_sign_ed25519_sk_to_curve25519: function(secretKey) {
secretKey = objToBuffer(secretKey);
crypto_sign_ed25519_sk_to_curve25519: function (secret_key) {
secret_key = obj_to_buffer(secret_key);
return new Uint8Array(sodiumneon.crypto_sign_ed25519_sk_to_curve25519(secretKey));
return new Uint8Array(sodiumneon.crypto_sign_ed25519_sk_to_curve25519(secret_key));
},
crypto_sign_keypair: function() {
var keyPair = sodiumneon.crypto_sign_keypair();
crypto_sign_keypair: function () {
var key_pair = sodiumneon.crypto_sign_keypair();
return {
publicKey: new Uint8Array(keyPair.publicKeyBuffer),
privateKey: new Uint8Array(keyPair.privateKeyBuffer),
keyType: keyPair.keyType
publicKey: new Uint8Array(key_pair.public_key_buffer),
privateKey: new Uint8Array(key_pair.private_key_buffer),
keyType: key_pair.key_type,
};

@@ -85,9 +85,9 @@ },

crypto_sign_SEEDBYTES: 32,
crypto_sign_verify_detached: function(signature, message, publicKey) {
signature = objToBuffer(signature);
message = objToBuffer(message);
publicKey = objToBuffer(publicKey);
crypto_sign_verify_detached: function (signature, message, public_key) {
signature = obj_to_buffer(signature);
message = obj_to_buffer(message);
public_key = obj_to_buffer(public_key);
return sodiumneon.crypto_sign_verify_detached(signature, message, publicKey);
}
return sodiumneon.crypto_sign_verify_detached(signature, message, public_key);
},
};
{
"dependencies": {
"neon-cli": "0.1.13"
},
"description": "Node.js bindings to sodiumoxide.",
"devDependencies": {
"eslint": "3.17.1",
"jasmine": "2.5.3",
"libsodium-wrappers-sumo": "0.4.9",
"neon-cli": "0.1.13"
"libsodium-wrappers-sumo": "0.4.9"
},
"description": "Node.js bindings to sodiumoxide.",
"license": "GPL-3.0",
"main": "lib/index.js",
"name": "libsodium-neon",
"repository": {
"type": "git",
"url": "https://github.com/wireapp/libsodium-neon.git"
},
"scripts": {
"build": "neon build",
"lint": "eslint .",
"postinstall": "npm run build",
"test": "jasmine test"
},
"version": "2.0.1"
"version": "2.0.3"
}

@@ -25,3 +25,3 @@ /*

key_material: new Uint8Array([5, 30, 208, 218, 140, 173, 89, 133, 238, 120, 243, 172, 56, 0, 84, 80, 225, 83, 110, 68, 59, 136, 105, 202, 200, 243, 73, 174, 28, 38, 66, 246]),
assert_is_not_zeros: function(array) {
assert_is_not_zeros: function (array) {
var only_zeroes = true;

@@ -35,3 +35,3 @@ for (var index = 0; index < array.length; ++index) {

return (only_zeroes === false);
}
},
};

@@ -28,4 +28,4 @@ /*

describe('libsodium-neon', function() {
it('assert_is_not_zeros', function() {
describe('libsodium-neon', function () {
it('assert_is_not_zeros', function () {
expect(helpers.assert_is_not_zeros([0, 0, 0, 0, 0])).toBe(false);

@@ -37,3 +37,3 @@ expect(helpers.assert_is_not_zeros([0, 0, 0, 230, 0])).toBe(true);

it('crypto_sign_keypair', function() {
it('crypto_sign_keypair', function () {
keypair_alice = libsodium.crypto_sign_keypair();

@@ -45,4 +45,4 @@ expect(helpers.assert_is_not_zeros(keypair_alice.publicKey)).toBe(true);

describe('Compliance', function() {
it('crypto_sign_keypair', function() {
describe('Compliance', function () {
it('crypto_sign_keypair', function () {
keypair_alice = libsodium.crypto_sign_keypair();

@@ -56,3 +56,3 @@ keypair_bob = libsodium_neon.crypto_sign_keypair();

it('crypto_auth_hmacsha256', function() {
it('crypto_auth_hmacsha256', function () {
var auth = libsodium.crypto_auth_hmacsha256(helpers.message, helpers.key_material);

@@ -63,3 +63,3 @@ var authNeon = libsodium_neon.crypto_auth_hmacsha256(helpers.message, helpers.key_material);

it('crypto_sign_detached', function() {
it('crypto_sign_detached', function () {
var sign = libsodium.crypto_sign_detached(helpers.message, keypair_alice.privateKey);

@@ -70,3 +70,3 @@ var signNeon = libsodium_neon.crypto_sign_detached(helpers.message, keypair_alice.privateKey);

it('crypto_sign_ed25519_sk_to_curve25519', function() {
it('crypto_sign_ed25519_sk_to_curve25519', function () {
curve25519_secret_key_alice = libsodium.crypto_sign_ed25519_sk_to_curve25519(keypair_alice.privateKey);

@@ -81,3 +81,3 @@ var curve25519_secret_key_alice_neon = libsodium.crypto_sign_ed25519_sk_to_curve25519(keypair_alice.privateKey);

it('crypto_sign_ed25519_pk_to_curve25519', function() {
it('crypto_sign_ed25519_pk_to_curve25519', function () {
var curve25519_public_key_alice = libsodium.crypto_sign_ed25519_pk_to_curve25519(keypair_alice.publicKey);

@@ -93,3 +93,3 @@ var curve25519_public_key_alice_neon = libsodium.crypto_sign_ed25519_pk_to_curve25519(keypair_alice.publicKey);

it('crypto_scalarmult', function() {
it('crypto_scalarmult', function () {
var scalar = libsodium.crypto_scalarmult(curve25519_secret_key_alice, curve25519_public_key_bob);

@@ -96,0 +96,0 @@ var scalar_neon = libsodium_neon.crypto_scalarmult(curve25519_secret_key_alice, curve25519_public_key_bob);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc