@syncfusion/ej2-pdf
Version:
Feature-rich JavaScript PDF library with built-in support for loading and manipulating PDF document.
100 lines (99 loc) • 3.47 kB
TypeScript
import { _PdfNativeAccumulatorSink, _PdfNativeHashInput } from '../digital-signature/signature/pdf-accumulator';
import { _Word64 } from '../encryptor';
/**
* SHA-512 hash implementation used internally for PDF cryptography.
*
* @private
*/
export declare class _Sha512 {
/**
* Create a chunked conversion sink for incremental hashing.
*
* @private
* @param {_PdfNativeAccumulatorSink} outputSink that will receive the hash output.
* @returns {_PdfNativeHashInput} for feeding chunks.
*/
_startChunkedConversion(outputSink: _PdfNativeAccumulatorSink): _PdfNativeHashInput;
/**
* SHA-512 constant round values.
*
* @private
*/
_k: Array<_Word64>;
/**
* Upper-case sigma function used in SHA-512 compression.
*
* @private
* @param {_Word64} result `_Word64` to receive the result.
* @param {_Word64} x `_Word64` value.
* @param {_Word64} buffer `_Word64` buffer.
* @returns {void} nothing.
*/
_sigma(result: _Word64, x: _Word64, buffer: _Word64): void;
/**
* Upper-case sigma prime function used in SHA-512 compression.
*
* @private
* @param {_Word64} result `_Word64` to receive the result.
* @param {_Word64} x `_Word64` value.
* @param {_Word64} buffer `_Word64` buffer.
* @returns {void} nothing.
*/
_sigmaPrime(result: _Word64, x: _Word64, buffer: _Word64): void;
/**
* Lower-case sigma function used in message schedule for SHA-512.
*
* @private
* @param {_Word64} result to receive the result.
* @param {_Word64} x value.
* @param {_Word64} buffer buffer.
* @returns {void} nothing.
*/
_littleSigma(result: _Word64, x: _Word64, buffer: _Word64): void;
/**
* Lower-case sigma prime function used in message schedule for SHA-512.
*
* @private
* @param {_Word64} result `_Word64` to receive the result.
* @param {_Word64} x `_Word64` value.
* @param {_Word64} buffer `_Word64` buffer.
* @returns {void} nothing.
*/
_littleSigmaPrime(result: _Word64, x: _Word64, buffer: _Word64): void;
/**
* Compute the SHA-512 (or SHA-384 when `isMode384` is true) digest for a slice of bytes.
*
* @private
* @param {Uint8Array} data to hash.
* @param {number} offset into `data`.
* @param {number} length bytes to hash.
* @param {boolean} isMode384 true, produce SHA-384 digest.
* @returns {Uint8Array} The digest as a `Uint8Array`.
*/
_hash(data: Uint8Array, offset: number, length: number, isMode384?: boolean): Uint8Array;
}
/**
* SHA-384 convenience wrapper using the SHA-512 implementation.
*
* @private
*/
export declare class _Sha384 {
/**
* Create a chunked conversion sink for incremental hashing.
*
* @private
* @param {_PdfNativeAccumulatorSink} outputSink that will receive the hash output.
* @returns {_PdfNativeHashInput} for feeding chunks.
*/
_startChunkedConversion(outputSink: _PdfNativeAccumulatorSink): _PdfNativeHashInput;
/**
* Compute the SHA-384 digest for a slice of bytes.
*
* @private
* @param {Uint8Array} data bytes to hash.
* @param {number} offset into `data`.
* @param {number} length of bytes to hash.
* @returns {Uint8Array} The 48-byte SHA-384 digest as `Uint8Array`.
*/
_hash(data: Uint8Array, offset: number, length: number): Uint8Array;
}