@stablelib/xchacha20
Advanced tools
Comparing version 0.1.1 to 1.0.0
@@ -25,7 +25,7 @@ /** | ||
/** | ||
* Applies the HChaCha core function to 16-byte input, | ||
* 32-byte key key, and puts the result into 64-byte array out. | ||
* This function is used to generate the first subkey based on | ||
* the first 16 bytes of the nonce and the key. | ||
* HChaCha is a one-way function used in XChaCha to extend nonce. | ||
* | ||
* It takes 32-byte key and 16-byte src and writes 32-byte result | ||
* into dst and returns it. | ||
*/ | ||
export declare function hchacha(key: Uint8Array, src: Uint8Array, dst: Uint8Array): Uint8Array; |
@@ -5,2 +5,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Package xchacha20 implements XChaCha20 stream cipher. | ||
*/ | ||
var binary_1 = require("@stablelib/binary"); | ||
@@ -24,3 +27,3 @@ var wipe_1 = require("@stablelib/wipe"); | ||
if (nonce.length !== 24) { | ||
throw new Error("XChacha20 nonce must be 24 bytes"); | ||
throw new Error("XChaCha20 nonce must be 24 bytes"); | ||
} | ||
@@ -59,6 +62,6 @@ // Use HChaCha one-way function to transform first 16 bytes of | ||
/** | ||
* Applies the HChaCha core function to 16-byte input, | ||
* 32-byte key key, and puts the result into 64-byte array out. | ||
* This function is used to generate the first subkey based on | ||
* the first 16 bytes of the nonce and the key. | ||
* HChaCha is a one-way function used in XChaCha to extend nonce. | ||
* | ||
* It takes 32-byte key and 16-byte src and writes 32-byte result | ||
* into dst and returns it. | ||
*/ | ||
@@ -65,0 +68,0 @@ function hchacha(key, src, dst) { |
{ | ||
"name": "@stablelib/xchacha20", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "XChaCha20 stream cipher", | ||
@@ -25,11 +25,11 @@ "main": "./lib/xchacha20.js", | ||
"dependencies": { | ||
"@stablelib/binary": "^0.7.2", | ||
"@stablelib/chacha": "^0.7.2", | ||
"@stablelib/wipe": "^0.5.0" | ||
"@stablelib/binary": "^1.0.0", | ||
"@stablelib/chacha": "^1.0.0", | ||
"@stablelib/wipe": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"@stablelib/benchmark": "^0.5.0", | ||
"@stablelib/hex": "^0.5.0" | ||
"@stablelib/benchmark": "^1.0.0", | ||
"@stablelib/hex": "^1.0.0" | ||
}, | ||
"gitHead": "dd08cfe89bc89b4106f0c9705db6281dd7357b26" | ||
"gitHead": "c3b9e138650642a738a9225956c75dbe44c76ae6" | ||
} |
// Copyright (C) 2019 Kyle Den Hartog | ||
// MIT License. See LICENSE file for details. | ||
/** | ||
* Package xchacha20 implements XChaCha20 stream cipher. | ||
*/ | ||
import { writeUint32LE } from "@stablelib/binary"; | ||
@@ -25,3 +29,3 @@ import { wipe } from "@stablelib/wipe"; | ||
if (nonce.length !== 24) { | ||
throw new Error("XChacha20 nonce must be 24 bytes"); | ||
throw new Error("XChaCha20 nonce must be 24 bytes"); | ||
} | ||
@@ -66,8 +70,7 @@ | ||
/** | ||
* Applies the HChaCha core function to 16-byte input, | ||
* 32-byte key key, and puts the result into 64-byte array out. | ||
* This function is used to generate the first subkey based on | ||
* the first 16 bytes of the nonce and the key. | ||
* HChaCha is a one-way function used in XChaCha to extend nonce. | ||
* | ||
* It takes 32-byte key and 16-byte src and writes 32-byte result | ||
* into dst and returns it. | ||
*/ | ||
export function hchacha( | ||
@@ -74,0 +77,0 @@ key: Uint8Array, |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
637
1
41037
+ Added@stablelib/binary@1.0.1(transitive)
+ Added@stablelib/chacha@1.0.1(transitive)
+ Added@stablelib/int@1.0.1(transitive)
+ Added@stablelib/wipe@1.0.1(transitive)
- Removed@stablelib/binary@0.7.2(transitive)
- Removed@stablelib/chacha@0.7.2(transitive)
- Removed@stablelib/int@0.5.0(transitive)
- Removed@stablelib/wipe@0.5.0(transitive)
Updated@stablelib/binary@^1.0.0
Updated@stablelib/chacha@^1.0.0
Updated@stablelib/wipe@^1.0.0