Skip to content

Commit

Permalink
readme & bump
Browse files Browse the repository at this point in the history
  • Loading branch information
hazae41 committed Jan 18, 2023
1 parent 531efa4 commit 920b42e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm i @hazae41/paimon
### Usage

```ts
import { Paimon, PaddingScheme, RsaPrivateKey } from "@hazae41/paimon";
import { Paimon, RsaPrivateKey } from "@hazae41/paimon";

// Wait for WASM to load
Paimon.initSyncBundledOnce()
Expand All @@ -23,11 +23,10 @@ const identity = keypair.to_public_key()

// Define bytes to sign and padding to use
const bytes = new TextEncoder().encode("hello world")
const padding = PaddingScheme.new_pkcs1v15_sign_raw()

// Sign and verify
const proof = keypair.sign(padding, bytes)
const verified = identity.verify(padding, bytes, proof)
const proof = keypair.sign_pkcs1v15_raw(bytes)
const verified = identity.verify_pkcs1v15_raw(bytes, proof)
```

### Unreproducible building
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "@hazae41/paimon",
"version": "1.0.12",
"version": "1.0.13",
"description": "WebAssembly port of RustCrypto's RSA, a Rust implementation of RSA encryption and signatures.",
"homepage": "https://github.com/hazae41/paimon",
"repository": "github:hazae41/paimon",
Expand Down

0 comments on commit 920b42e

Please sign in to comment.