Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,655 changes: 3,501 additions & 7,154 deletions package-lock.json

Large diffs are not rendered by default.

43 changes: 16 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"module": "./index.mjs",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.cjs",
"default": "./index.mjs",
"types": "./index.d.ts"
"require": "./index.cjs"
}
},
"types": "./index.d.ts",
Expand Down Expand Up @@ -37,16 +36,16 @@
"build:dev": "npm run externals:check && rm -rf build/* && npm run build:agnostic && npm run types",
"build:agnostic": "node esbuild.config.mjs",
"types": "rm -rf build/**/*.d.ts && tsc",
"test": "npx vitest --config vitest.config.mjs --run",
"test": "npx vitest --run",
"coverage": "npm run test -- --coverage",
"lint": "npx eslint .",
"docs": "npx typedoc --options typedoc.js",
"prepare": "npx husky",
"preinstall": "sh preinstall.sh",
"postinstall": "sh postinstall.sh",
"protos": "npm run protos:node && npm run protos:common",
"protos:node": "protoc -I=src --proto_path=castor/protos --ts_out=castor/protos castor/protos/node_models.proto",
"protos:common": "protoc -I=src --proto_path=castor/protos --ts_out=castor/protos castor/protos/common_models.proto"
"protos:node": "protoc -I=src --proto_path=src/castor/protos --ts_out=src/castor/protos src/castor/protos/node_models.proto",
"protos:common": "protoc -I=src --proto_path=src/castor/protos --ts_out=src/castor/protos src/castor/protos/common_models.proto"
},
"author": "IOHK",
"repository": {
Expand All @@ -58,27 +57,22 @@
"devDependencies": {
"@esbuild-plugins/node-resolve": "^0.2.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.1",
"@semantic-release/exec": "^7.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/release-notes-generator": "^10.0.3",
"@types/chai": "^4.3.4",
"@types/chai-as-promised": "^7.1.5",
"@semantic-release/release-notes-generator": "^14.0.3",
"@types/google-protobuf": "^3.15.6",
"@types/jsonld": "^1.5.14",
"@types/node": "^18.14.2",
"@types/pako": "^2.0.3",
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.55.0",
"@vitest/browser": "^1.6.0",
"@vitest/coverage-istanbul": "^1.6.0",
"@vitest/browser": "^3.1.1",
"@vitest/coverage-v8": "^3.1.1",
"anoncreds-wasm": "./externals/generated/anoncreds-wasm",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
"conventional-changelog-conventionalcommits": "^8.0.0",
"didcomm-wasm": "./externals/generated/didcomm-wasm",
"esbuild": "0.21.5",
"esbuild": "^0.25.2",
"eslint": "^8.36.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-unused-imports": "^2.0.0",
Expand All @@ -87,15 +81,13 @@
"prettier": "^3.0.2",
"protoc-gen-ts": "^0.8.7",
"rxdb": "^14.17.1",
"semantic-release": "^24.0.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0",
"semantic-release": "^24.2.3",
"typedoc": "^0.25.2",
"typedoc-plugin-external-module-map": "^1.3.2",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-rename-defaults": "^0.7.0",
"typescript": "^4.9.5",
"vitest": "^1.6.0"
"vitest": "^3.1.1"
},
"dependencies": {
"@hyperledger/identus-apollo": "^1.4.5",
Expand All @@ -115,11 +107,8 @@
"multiformats": "^9.9.0",
"pako": "^2.1.0",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0"
},
"optionalDependencies": {
"@esbuild/darwin-arm64": "0.15.18",
"@rollup/rollup-linux-x64-gnu": "^4.24.0"
"postinstall-postinstall": "^2.1.0",
"vite": "^6.3.1"
},
"peerDependencies": {
"@types/elliptic": "^6.4.16",
Expand Down
8 changes: 4 additions & 4 deletions src/pollux/utils/jwt/DER.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@

// Normalize r and s to 32 bytes
if (r.length > 32) {
r = r.slice(-32); // truncate if r is longer than 32 bytes
r = r.subarray(-32); // truncate if r is longer than 32 bytes
} else if (r.length < 32) {
const paddedR = Uint8Array.from(Buffer.alloc(32));
const paddedR = Buffer.alloc(32);
r.copy(paddedR, 32 - r.length);
r = Buffer.from(paddedR); // left pad with zeros if r is shorter than 32 bytes
}

if (s.length > 32) {
s = s.slice(-32); // truncate if s is longer than 32 bytes
s = s.subarray(-32); // truncate if s is longer than 32 bytes
} else if (s.length < 32) {
const paddedS = Uint8Array.from(Buffer.alloc(32));
const paddedS = Buffer.alloc(32);
s.copy(paddedS, 32 - s.length);
s = Buffer.from(paddedS); // left pad with zeros if s is shorter than 32 bytes
}
Expand All @@ -59,7 +59,7 @@
* @param buffer Buffer
* @returns Buffer
*/
function removeLeadingZeros(buffer: Buffer): Buffer {

Check warning on line 62 in src/pollux/utils/jwt/DER.ts

View workflow job for this annotation

GitHub Actions / Build and test

'removeLeadingZeros' is defined but never used. Allowed unused vars must match /^_/u
const arr = Array.from(buffer)
let i = 0;
while (i < arr.length - 1 && arr[i] === 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/agent/Agent.anoncreds.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe("Agent Tests", () => {
const credential = new AnonCredsCredential(Fixtures.Credentials.Anoncreds.credential);
const attachment = new AttachmentDescriptor(Fixtures.PresentationRequests.AnoncredsAttachment.data, "attach_1", undefined, undefined, "anoncreds/proof-request@v1.0");
const request = new RequestPresentation(
{ proofTypes: [] },
{},
[attachment],
didFrom,
didTo
Expand Down
Loading
Loading