-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce @hpke/common for @hpke/core and @hpke/chacha20poly1305.
- Loading branch information
Showing
33 changed files
with
257 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Ajitomi Daisuke | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<h1 align="center">@hpke/common</h1> | ||
|
||
<div align="center"> | ||
<a href="https://jsr.io/@hpke/common"><img src="https://jsr.io/badges/@hpke/common" alt="JSR"/></a> | ||
</div> | ||
|
||
<div align="center"> | ||
A TypeScript <a href="https://datatracker.ietf.org/doc/html/rfc9180">Hybrid Public Key Encryption (HPKE)</a> internal-use common module for <a href="https://jsr.io/@hpke">@hpke family modules</a>. | ||
</div> | ||
|
||
<div align="center"> | ||
</div> | ||
|
||
## Installation | ||
|
||
Do not install this package directly, it is an internal package used by | ||
[@hpke/core](https://jsr.io/@hpke/core), | ||
[@hpke/chacha20poly1305](https://jsr.io/@hpke/chacha20poly1305) and so on. Use | ||
either of them instead. | ||
|
||
## Contributing | ||
|
||
We welcome all kind of contributions, filing issues, suggesting new features or | ||
sending PRs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@hpke/common", | ||
"version": "0.1.0", | ||
"exports": "./mod.ts", | ||
"publish": { | ||
"exclude": [ | ||
"dnt.ts", | ||
"tsconfig.json" | ||
] | ||
}, | ||
"fmt": { | ||
"include": [ | ||
"**/*.md", | ||
"**/*.json", | ||
"dnt.ts", | ||
"mod.ts", | ||
"src/" | ||
], | ||
"exclude": [ | ||
"**/*/*.js", | ||
"**/*/npm/", | ||
"coverage/*.json" | ||
] | ||
}, | ||
"lint": { | ||
"include": [ | ||
"**/*.md", | ||
"**/*.json", | ||
"dnt.ts", | ||
"mod.ts", | ||
"src/" | ||
], | ||
"exclude": [ | ||
"**/*/*.js", | ||
"**/*/npm/", | ||
"coverage/*.json" | ||
] | ||
}, | ||
"tasks": { | ||
"test": "deno fmt && deno lint && deno test --import-map=../../import_map.json -A --fail-fast --doc --coverage=coverage --parallel --allow-read", | ||
"cov": "deno coverage ./coverage --lcov --exclude='test'", | ||
"dnt": "deno run --import-map=../../import_map.json -A dnt.ts", | ||
"minify": "esbuild ../../npm/packages/common/esm/chacha20poly1305/mod.js --bundle --format=esm --minify" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { build, emptyDir } from "@deno/dnt"; | ||
|
||
await emptyDir("../../npm/packages/common"); | ||
|
||
const denoPkg = JSON.parse(await Deno.readTextFile("./deno.json")); | ||
|
||
await build({ | ||
entryPoints: ["./mod.ts"], | ||
outDir: "../../npm/packages/common", | ||
typeCheck: "both", | ||
test: true, | ||
declaration: true, | ||
scriptModule: "umd", | ||
importMap: "../../import_map.json", | ||
compilerOptions: { | ||
lib: ["ES2022", "DOM"], | ||
}, | ||
shims: { | ||
deno: "dev", | ||
}, | ||
testPattern: "test/**/*.test.ts", | ||
package: { | ||
name: denoPkg.name, | ||
version: denoPkg.version, | ||
description: | ||
"A Hybrid Public Key Encryption (HPKE) internal-use common module for @hpke family modules.", | ||
repository: { | ||
type: "git", | ||
url: "git+https://github.com/dajiaji/hpke-js.git", | ||
}, | ||
homepage: "https://github.com/dajiaji/hpke-js/tree/main/common#readme", | ||
license: "MIT", | ||
module: "./esm/mod.js", | ||
main: "./script/mod.js", | ||
types: "./esm/mod.d.ts", | ||
sideEffects: false, | ||
exports: { | ||
".": { | ||
"import": "./esm/mod.js", | ||
"require": "./script/mod.js", | ||
}, | ||
"./package.json": "./package.json", | ||
}, | ||
keywords: [ | ||
"hpke", | ||
"rfc9180", | ||
"hkdf", | ||
"dh", | ||
"security", | ||
"encryption", | ||
], | ||
engines: { | ||
"node": ">=16.0.0", | ||
}, | ||
author: "Ajitomi Daisuke", | ||
bugs: { | ||
url: "https://github.com/dajiaji/hpke-js/issues", | ||
}, | ||
}, | ||
}); | ||
|
||
// post build steps | ||
Deno.copyFileSync("LICENSE", "../../npm/packages/common/LICENSE"); | ||
Deno.copyFileSync("README.md", "../../npm/packages/common/README.md"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type { AeadEncryptionContext } from "./src/interfaces/aeadEncryptionContext.ts"; | ||
export type { AeadInterface } from "./src/interfaces/aeadInterface.ts"; | ||
export { AeadId, KdfId, KemId, Mode } from "./src/identifiers.ts"; | ||
export { AEAD_USAGES } from "./src/interfaces/aeadEncryptionContext.ts"; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.