@stablelib/ed25519
Advanced tools
Comparing version 0.5.0 to 0.6.0
@@ -682,2 +682,9 @@ // Copyright (C) 2016 Dmitry Chestnykh | ||
export function extractPublicKeyFromSecretKey(secretKey: Uint8Array): Uint8Array { | ||
if (secretKey.length !== SECRET_KEY_LENGTH) { | ||
throw new Error(`ed25519: secret key must be ${SECRET_KEY_LENGTH} bytes`); | ||
} | ||
return new Uint8Array(secretKey.subarray(32)); | ||
} | ||
const L = new Float64Array([ | ||
@@ -684,0 +691,0 @@ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, |
@@ -12,3 +12,4 @@ import { RandomSource } from "@stablelib/random"; | ||
export declare function generateKeyPair(prng?: RandomSource): KeyPair; | ||
export declare function extractPublicKeyFromSecretKey(secretKey: Uint8Array): Uint8Array; | ||
export declare function sign(secretKey: Uint8Array, message: Uint8Array): Uint8Array; | ||
export declare function verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean; |
@@ -662,2 +662,9 @@ "use strict"; | ||
exports.generateKeyPair = generateKeyPair; | ||
function extractPublicKeyFromSecretKey(secretKey) { | ||
if (secretKey.length !== exports.SECRET_KEY_LENGTH) { | ||
throw new Error("ed25519: secret key must be " + exports.SECRET_KEY_LENGTH + " bytes"); | ||
} | ||
return new Uint8Array(secretKey.subarray(32)); | ||
} | ||
exports.extractPublicKeyFromSecretKey = extractPublicKeyFromSecretKey; | ||
var L = new Float64Array([ | ||
@@ -664,0 +671,0 @@ 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, |
{ | ||
"name": "@stablelib/ed25519", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Ed25519 public-key signature (EdDSA with Curve25519)", | ||
@@ -5,0 +5,0 @@ "main": "./lib/ed25519.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1997048
16471
0