jr can now make an account on aegora
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
// Adapted from the reference implementation in RFC7693
|
||||
// Ported to Javascript by DC - https://github.com/dcposch
|
||||
|
||||
const util = require('./util')
|
||||
// const util = require('./util')
|
||||
import * as util from './util.js';
|
||||
|
||||
// 64-bit unsigned addition
|
||||
// Sets v[a,a+1] += v[b,b+1]
|
||||
@@ -356,10 +357,10 @@ function blake2bHex (input, key, outlen, salt, personal) {
|
||||
return util.toHex(output)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
blake2b: blake2b,
|
||||
blake2bHex: blake2bHex,
|
||||
blake2bInit: blake2bInit,
|
||||
blake2bUpdate: blake2bUpdate,
|
||||
blake2bFinal: blake2bFinal
|
||||
export {
|
||||
blake2b,
|
||||
blake2bHex,
|
||||
blake2bInit,
|
||||
blake2bUpdate,
|
||||
blake2bFinal
|
||||
}
|
||||
Vendored
-812
File diff suppressed because one or more lines are too long
+5
-5
@@ -76,9 +76,9 @@ function testSpeed (hashFn, N, M) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
normalizeInput: normalizeInput,
|
||||
toHex: toHex,
|
||||
debugPrint: debugPrint,
|
||||
testSpeed: testSpeed
|
||||
export {
|
||||
normalizeInput,
|
||||
toHex,
|
||||
debugPrint,
|
||||
testSpeed
|
||||
}
|
||||
-812
File diff suppressed because one or more lines are too long
Vendored
-96
@@ -1,96 +0,0 @@
|
||||
export interface Blake2bCTX {
|
||||
b: Uint8Array;
|
||||
h: Uint32Array;
|
||||
t: number;
|
||||
c: number;
|
||||
outlen: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Blake2b hashing context
|
||||
* @param outlen between 1 and 64
|
||||
* @param key optional
|
||||
* @returns the hashing context
|
||||
*/
|
||||
export declare function blake2bInit(outlen?: number, key?: Uint8Array): Blake2bCTX;
|
||||
|
||||
/**
|
||||
* Updates a Blake2b streaming hash
|
||||
* @param ctx hashing context from blake2bInit()
|
||||
* @param input Byte array
|
||||
*/
|
||||
export declare function blake2bUpdate(ctx: Blake2bCTX, input: ArrayLike<number>): void;
|
||||
|
||||
/**
|
||||
* Completes a Blake2b streaming hash
|
||||
* @param ctx hashing context from blake2bInit()
|
||||
* @returns the final hash
|
||||
*/
|
||||
export declare function blake2bFinal(ctx: Blake2bCTX): Uint8Array;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param input the input bytes, as a string, Buffer, or Uint8Array
|
||||
* @param key optional key Uint8Array, up to 64 bytes
|
||||
* @param outlen optional output length in bytes, defaults to 64
|
||||
* @returns an n-byte Uint8Array
|
||||
*/
|
||||
export declare function blake2b(input: string | Uint8Array, key?: Uint8Array, outlen?: number): Uint8Array;
|
||||
|
||||
/**
|
||||
* Computes the Blake2b hash of a string or byte array
|
||||
*
|
||||
* @param input the input bytes, as a string, Buffer, or Uint8Array
|
||||
* @param key optional key Uint8Array, up to 64 bytes
|
||||
* @param outlen outlen - optional output length in bytes, defaults to 64
|
||||
* @returns an n-byte hash in hex, all lowercase
|
||||
*/
|
||||
export declare function blake2bHex(input: string | Uint8Array, key?: Uint8Array, outlen?: number): string;
|
||||
|
||||
export interface Blake2sCTX {
|
||||
h: Uint32Array;
|
||||
b: Uint8Array;
|
||||
c: number;
|
||||
t: number;
|
||||
outlen: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Blake2s hashing context
|
||||
* @param outlen between 1 and 32
|
||||
* @param key optional Uint8Array key
|
||||
* @returns the hashing context
|
||||
*/
|
||||
export declare function blake2sInit(outlen: number, key?: Uint8Array): Blake2sCTX;
|
||||
|
||||
/**
|
||||
* Updates a Blake2s streaming hash
|
||||
* @param ctx hashing context from blake2sinit()
|
||||
* @param input byte array
|
||||
*/
|
||||
export declare function blake2sUpdate(ctx: Blake2sCTX, input: ArrayLike<number>): void;
|
||||
|
||||
/**
|
||||
* Completes a Blake2s streaming hash
|
||||
* @param ctx hashing context from blake2sinit()
|
||||
* @returns Uint8Array containing the message digest
|
||||
*/
|
||||
export declare function blake2sFinal(ctx: Blake2sCTX): Uint8Array;
|
||||
|
||||
/**
|
||||
* Computes the Blake2s hash of a string or byte array, and returns a Uint8Array
|
||||
* @param input the input bytes, as a string, Buffer, or Uint8Array
|
||||
* @param key optional key Uint8Array, up to 32 bytes
|
||||
* @param outlen optional output length in bytes, defaults to 64
|
||||
* @returns an n-byte Uint8Array
|
||||
*/
|
||||
export declare function blake2s(input: string | Uint8Array, key?: Uint8Array, outlen?: number): Uint8Array;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param input the input bytes, as a string, Buffer, or Uint8Array
|
||||
* @param key optional key Uint8Array, up to 32 bytes
|
||||
* @param outlen optional output length in bytes, defaults to 64
|
||||
* @returns an n-byte hash in hex, all lowercase
|
||||
*/
|
||||
export declare function blake2sHex(input: string | Uint8Array, key?: Uint8Array, outlen?: number): string;
|
||||
@@ -1,15 +0,0 @@
|
||||
const b2b = require('./blake2b')
|
||||
const b2s = require('./blake2s')
|
||||
|
||||
module.exports = {
|
||||
blake2b: b2b.blake2b,
|
||||
blake2bHex: b2b.blake2bHex,
|
||||
blake2bInit: b2b.blake2bInit,
|
||||
blake2bUpdate: b2b.blake2bUpdate,
|
||||
blake2bFinal: b2b.blake2bFinal,
|
||||
blake2s: b2s.blake2s,
|
||||
blake2sHex: b2s.blake2sHex,
|
||||
blake2sInit: b2s.blake2sInit,
|
||||
blake2sUpdate: b2s.blake2sUpdate,
|
||||
blake2sFinal: b2s.blake2sFinal
|
||||
}
|
||||
Reference in New Issue
Block a user