Skip to content

Commit

Permalink
Update docs and TS [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
larabr committed Aug 26, 2021
1 parent ed594fe commit 4b5aadb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions openpgp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ declare abstract class BasePacket {
* - A Subkey Packet cannot always be used when a Primary Key Packet is expected (and vice versa).
*/
declare abstract class BasePublicKeyPacket extends BasePacket {
public algorithm: enums.publicKeyNames;
public algorithm: enums.publicKey;
public created: Date;
public version: number;
public getAlgorithmInfo(): AlgorithmInfo;
Expand Down Expand Up @@ -417,8 +417,8 @@ export class SymEncryptedIntegrityProtectedDataPacket extends BasePacket {

export class AEADEncryptedDataPacket extends BasePacket {
static readonly tag: enums.packet.aeadEncryptedData;
private decrypt(sessionKeyAlgorithm: string, sessionKey: Uint8Array, config?: Config): void;
private encrypt(sessionKeyAlgorithm: string, sessionKey: Uint8Array, config?: Config): void;
private decrypt(sessionKeyAlgorithm: enums.symmetric, sessionKey: Uint8Array, config?: Config): void;
private encrypt(sessionKeyAlgorithm: enums.symmetric, sessionKey: Uint8Array, config?: Config): void;
private crypt(fn: Function, sessionKey: Uint8Array, data: MaybeStream<Uint8Array>): MaybeStream<Uint8Array>
}

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/public_key/elliptic/curves.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async function generate(curve) {
/**
* Get preferred hash algo to use with the given curve
* @param {module:type/oid} oid - curve oid
* @returns {module:enums.hash} hash algorithm
* @returns {enums.hash} hash algorithm
*/
function getPreferredHashAlgo(oid) {
return curves[enums.write(enums.curve, oid.toHex())].hash;
Expand Down
10 changes: 8 additions & 2 deletions src/type/s2k.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ class S2K {
* @param {Object} [config] - Full configuration, defaults to openpgp.config
*/
constructor(config = defaultConfig) {
/** @type {module:enums.hash} */
/**
* Hash function identifier, or 0 for gnu-dummy keys
* @type {module:enums.hash | 0}
*/
this.algorithm = enums.hash.sha256;
/** @type {module:enums.s2k} */
/**
* enums.s2k identifier or 'gnu-dummy'
* @type {String}
*/
this.type = 'iterated';
/** @type {Integer} */
this.c = config.s2kIterationCountByte;
Expand Down

0 comments on commit 4b5aadb

Please sign in to comment.