Skip to content

Commit

Permalink
Add Bencodex
Browse files Browse the repository at this point in the history
  • Loading branch information
Akamig committed Oct 30, 2023
1 parent 86cdf8f commit 84f3847
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions @planetarium/account-aws-kms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"dependencies": {
"@aws-sdk/client-kms": "^3.272.0",
"@noble/secp256k1": "^1.7.1",
"@planetarium/bencodex": "^0.2.2",
"asn1js": "^3.0.5"
},
"peerDependencies": {
Expand Down
6 changes: 2 additions & 4 deletions @planetarium/account-aws-kms/src/AwsKmsAccount.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { encode } from "@planetarium/bencodex";
import { AwsKmsKeyId } from "./AwsKmsKeyId.js";
import { KMSClient, SignCommand } from "@aws-sdk/client-kms";
import { Signature as NobleSignature } from "@noble/secp256k1";
Expand Down Expand Up @@ -37,10 +38,7 @@ export class AwsKmsAccount implements Account {
}

async sign(message: Message): Promise<Signature> {
const digest = await crypto.subtle.digest(
"SHA-256",
crypto.encode(message)
);
const digest = await crypto.subtle.digest("SHA-256", encode(message));
const digestArray = new Uint8Array(digest);

const cmd = new SignCommand({
Expand Down
1 change: 1 addition & 0 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84f3847

Please sign in to comment.