@shardus/crypto-utils
Advanced tools
Comparing version 4.1.4 to 4.1.5
@@ -107,9 +107,2 @@ /// <reference types="node" /> | ||
/** | ||
* Returns true if the hash of the input was signed by the owner of the pk | ||
* @param msg | ||
* @param sig | ||
* @param pk | ||
*/ | ||
export declare function verify(msg: string, sig: hexstring | Buffer, pk: publicKey | Buffer): boolean; | ||
/** | ||
* Returns true if the hash of the object minus the sign field matches the signed message in the sign field | ||
@@ -116,0 +109,0 @@ * @param obj |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bufferToHex = exports._getAuthKey = exports.generateSharedKey = exports._ensureBuffer = exports.init = exports.verifyObj = exports.verify = exports.signObj = exports.sign = exports.setCustomStringifier = exports.authenticateObj = exports.authenticate = exports.tagObj = exports.tag = exports.convertPkToCurve = exports.convertSkToCurve = exports.generateKeypair = exports.hashObj = exports.hash = exports.randomBytes = exports.stringifierName = exports.stringify = void 0; | ||
exports.bufferToHex = exports._getAuthKey = exports.generateSharedKey = exports._ensureBuffer = exports.init = exports.verifyObj = exports.signObj = exports.sign = exports.setCustomStringifier = exports.authenticateObj = exports.authenticate = exports.tagObj = exports.tag = exports.convertPkToCurve = exports.convertSkToCurve = exports.generateKeypair = exports.hashObj = exports.hash = exports.randomBytes = exports.stringifierName = exports.stringify = void 0; | ||
const sodium_native_1 = __importDefault(require("sodium-native")); | ||
@@ -368,3 +368,7 @@ const buffer_xor_1 = __importDefault(require("buffer-xor")); | ||
*/ | ||
function verify(msg, sig, pk) { | ||
// verify fails on non hex strings. to re-export, we would need to make things safer, | ||
// or more flexible but also be mindful to not hurt performance of verfyObj which calls this | ||
// and does not need those extra features. possibly just a verifyInternal clone could be used | ||
function verify(//READ ABOVE , Do not export | ||
msg, sig, pk) { | ||
if (typeof msg !== 'string') { | ||
@@ -385,3 +389,2 @@ throw new TypeError('Message to compare must be a string.'); | ||
} | ||
exports.verify = verify; | ||
/** | ||
@@ -388,0 +391,0 @@ * Returns true if the hash of the object minus the sign field matches the signed message in the sign field |
{ | ||
"name": "@shardus/crypto-utils", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"description": "Provides simple crypto functions, as used by the ULC Project.", | ||
@@ -48,3 +48,3 @@ "main": "./build/src/index.js", | ||
"@types/buffer-xor": "2.0.0", | ||
"@types/node": "18.16.1", | ||
"@types/node": "18.19.1", | ||
"gts": "^3.1.1", | ||
@@ -63,4 +63,4 @@ "@typescript-eslint/eslint-plugin": "^5.48.0", | ||
"engines": { | ||
"node": "18.16.1" | ||
"node": "18.19.1" | ||
} | ||
} |
@@ -413,3 +413,6 @@ export type hexstring = string; | ||
*/ | ||
export function verify( | ||
// verify fails on non hex strings. to re-export, we would need to make things safer, | ||
// or more flexible but also be mindful to not hurt performance of verfyObj which calls this | ||
// and does not need those extra features. possibly just a verifyInternal clone could be used | ||
function verify( //READ ABOVE , Do not export | ||
msg: string, | ||
@@ -416,0 +419,0 @@ sig: hexstring | Buffer, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104750
2482