mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-10 16:16:45 +00:00
Use internal tweetnacl SHA-512 implementation
Instead of relying on externally provided one (no async loading supported)
This commit is contained in:
parent
7295a2e7b3
commit
a56a4a16e8
14
package-lock.json
generated
14
package-lock.json
generated
@ -17,7 +17,7 @@
|
||||
"@openpgp/noble-curves": "^1.2.1-0",
|
||||
"@openpgp/noble-hashes": "^1.3.3-0",
|
||||
"@openpgp/seek-bzip": "^1.0.5-git",
|
||||
"@openpgp/tweetnacl": "^1.0.3",
|
||||
"@openpgp/tweetnacl": "^1.0.4-1",
|
||||
"@openpgp/web-stream-tools": "^0.0.14",
|
||||
"@rollup/plugin-alias": "^5.0.0",
|
||||
"@rollup/plugin-commonjs": "^24.0.1",
|
||||
@ -663,9 +663,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@openpgp/tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@openpgp/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-KGXNhU/mRg+uTsLGva55V340jwbX2pC8LndjOVI2oQ8vewPVTS2KnDOIXQ8O6KyT/c9Qy16KUQ5mwewe72m1Yw==",
|
||||
"version": "1.0.4-1",
|
||||
"resolved": "https://registry.npmjs.org/@openpgp/tweetnacl/-/tweetnacl-1.0.4-1.tgz",
|
||||
"integrity": "sha512-coYo04Op1+g4h6yE6q0GglGdvWkdfvpQWKmR9nDIrW+LqdTtwHFXIyIQGs5cosR4tCajxRn9aF/+WK207zxFrg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@openpgp/web-stream-tools": {
|
||||
@ -8010,9 +8010,9 @@
|
||||
}
|
||||
},
|
||||
"@openpgp/tweetnacl": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@openpgp/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
||||
"integrity": "sha512-KGXNhU/mRg+uTsLGva55V340jwbX2pC8LndjOVI2oQ8vewPVTS2KnDOIXQ8O6KyT/c9Qy16KUQ5mwewe72m1Yw==",
|
||||
"version": "1.0.4-1",
|
||||
"resolved": "https://registry.npmjs.org/@openpgp/tweetnacl/-/tweetnacl-1.0.4-1.tgz",
|
||||
"integrity": "sha512-coYo04Op1+g4h6yE6q0GglGdvWkdfvpQWKmR9nDIrW+LqdTtwHFXIyIQGs5cosR4tCajxRn9aF/+WK207zxFrg==",
|
||||
"dev": true
|
||||
},
|
||||
"@openpgp/web-stream-tools": {
|
||||
|
@ -67,7 +67,7 @@
|
||||
"@openpgp/jsdoc": "^3.6.11",
|
||||
"@openpgp/noble-hashes": "^1.3.3-0",
|
||||
"@openpgp/seek-bzip": "^1.0.5-git",
|
||||
"@openpgp/tweetnacl": "^1.0.3",
|
||||
"@openpgp/tweetnacl": "^1.0.4-1",
|
||||
"@openpgp/web-stream-tools": "^0.0.14",
|
||||
"@rollup/plugin-alias": "^5.0.0",
|
||||
"@rollup/plugin-commonjs": "^24.0.1",
|
||||
|
@ -20,7 +20,7 @@
|
||||
* @module crypto/public_key/elliptic/ecdh
|
||||
*/
|
||||
|
||||
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import nacl from '@openpgp/tweetnacl';
|
||||
import { CurveWithOID, jwkToRawPublic, rawPublicToJWK, privateToJWK, validateStandardParams, getNobleCurve } from './oid_curves';
|
||||
import * as aesKW from '../../aes_kw';
|
||||
import { getRandomBytes } from '../../random';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @module crypto/public_key/elliptic/ecdh
|
||||
*/
|
||||
|
||||
import x25519 from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import x25519 from '@openpgp/tweetnacl';
|
||||
import { x448 } from '@openpgp/noble-curves/ed448';
|
||||
import * as aesKW from '../../aes_kw';
|
||||
import { getRandomBytes } from '../../random';
|
||||
|
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
import { sha512 } from '@openpgp/noble-hashes/sha512';
|
||||
import ed25519 from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import ed25519 from '@openpgp/tweetnacl';
|
||||
import { ed448 } from '@openpgp/noble-curves/ed448';
|
||||
import util from '../../../util';
|
||||
import enums from '../../../enums';
|
||||
|
@ -21,14 +21,11 @@
|
||||
* @module crypto/public_key/elliptic/eddsa_legacy
|
||||
*/
|
||||
|
||||
import { sha512 } from '@openpgp/noble-hashes/sha512';
|
||||
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import nacl from '@openpgp/tweetnacl';
|
||||
import util from '../../../util';
|
||||
import enums from '../../../enums';
|
||||
import hash from '../../hash';
|
||||
|
||||
nacl.hash = bytes => sha512(bytes);
|
||||
|
||||
/**
|
||||
* Sign a message using the provided legacy EdDSA key
|
||||
* @param {module:type/oid} oid - Elliptic curve object identifier
|
||||
|
@ -19,7 +19,7 @@
|
||||
* @fileoverview Wrapper of an instance of an Elliptic Curve
|
||||
* @module crypto/public_key/elliptic/curve
|
||||
*/
|
||||
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import nacl from '@openpgp/tweetnacl';
|
||||
import { p256 } from '@openpgp/noble-curves/p256';
|
||||
import { p384 } from '@openpgp/noble-curves/p384';
|
||||
import { p521 } from '@openpgp/noble-curves/p521';
|
||||
|
@ -3,7 +3,6 @@
|
||||
* @module crypto/public_key
|
||||
*/
|
||||
|
||||
import nacl from '@openpgp/tweetnacl/nacl-fast-light';
|
||||
import * as rsa from './rsa';
|
||||
import * as elgamal from './elgamal';
|
||||
import * as elliptic from './elliptic';
|
||||
@ -17,7 +16,5 @@ export default {
|
||||
/** @see module:crypto/public_key/elliptic */
|
||||
elliptic: elliptic,
|
||||
/** @see module:crypto/public_key/dsa */
|
||||
dsa: dsa,
|
||||
/** @see tweetnacl */
|
||||
nacl: nacl
|
||||
dsa: dsa
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user