forked from mystiq/hydrogen-web
Convert hkdf.js to ts
This commit is contained in:
parent
afecac3e3c
commit
6c2aa1bf61
2 changed files with 4 additions and 2 deletions
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import aesjs from "../../../lib/aes-js/index.js";
|
||||
import {hkdf} from "../../utils/crypto/hkdf.js";
|
||||
import {hkdf} from "../../utils/crypto/hkdf";
|
||||
import {Platform as ModernPlatform} from "./Platform.js";
|
||||
|
||||
export function Platform(container, paths) {
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
* Based on https://github.com/junkurihara/jscu/blob/develop/packages/js-crypto-hkdf/src/hkdf.ts
|
||||
*/
|
||||
|
||||
import type {Crypto} from "../../platform/web/dom/Crypto.js";
|
||||
|
||||
// forked this code to make it use the cryptoDriver for HMAC that is more backwards-compatible
|
||||
export async function hkdf(cryptoDriver, key, salt, info, hash, length) {
|
||||
export async function hkdf(cryptoDriver: Crypto, key: Uint8Array, salt: Uint8Array, info: Uint8Array, hash: string, length: number): Promise<Uint8Array> {
|
||||
length = length / 8;
|
||||
const len = cryptoDriver.digestSize(hash);
|
||||
|
Loading…
Reference in a new issue