-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from xsc/chore/bring-into-2021
Adapt Codebase
- Loading branch information
Showing
30 changed files
with
228 additions
and
287 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{:lint-as {pandect.core-test/deftest-api clojure.test/deftest} | ||
:output {:exclude-files ["^src/pandect/algo"]}} |
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,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: ["**"] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
- uses: DeLaGuardo/clojure-lint-action@master | ||
with: | ||
clj-kondo-args: --lint src test | ||
check-name: clj-kondo | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install dependencies | ||
run: lein deps | ||
- name: Run tests | ||
run: lein ci |
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 |
---|---|---|
|
@@ -13,3 +13,5 @@ pom.xml.asc | |
*.swp | ||
*~ | ||
.nrepl-port | ||
src/pandect/algo | ||
.clj-kondo/.cache |
This file was deleted.
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 |
---|---|---|
@@ -1,34 +1,36 @@ | ||
(defproject pandect "0.6.2-SNAPSHOT" | ||
(defproject pandect "1.0.0-SNAPSHOT" | ||
:description "Message Digest and Checksum Library for Clojure" | ||
:url "https://github.com/xsc/pandect" | ||
:license {:name "MIT License" | ||
:url "https://opensource.org/licenses/MIT" | ||
:license {:name "MIT" | ||
:comment "MIT License" | ||
:url "https://choosealicense.com/licenses/mit" | ||
:year 2014 | ||
:key "mit"} | ||
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"] | ||
[org.bouncycastle/bcprov-jdk15on "1.54" :scope "provided"]] | ||
:exclusions [org.clojure/clojure] | ||
:source-paths ["src/clojure" "target/generated"] | ||
:java-source-paths ["src/java"] | ||
:profiles {:dev {:plugins [[lein-codox "0.9.4"]] | ||
:codox {:project {:name "pandect"} | ||
:metadata {:doc/format :markdown} | ||
:output-path "doc" | ||
:namespaces [pandect.core | ||
pandect.buffer | ||
#"^pandect\.algo\.[a-z\-]+"]}} | ||
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"] | ||
[org.bouncycastle/bcprov-jdk15on "1.54" :scope "provided"] | ||
^:inline-dep [potemkin "0.4.5"] | ||
^:inline-dep [riddley "0.2.0"]] | ||
:profiles {:dev | ||
{:global-vars {*warn-on-reflection* true}} | ||
:benchmark {:dependencies [[criterium "0.4.3"] | ||
[clj-message-digest "1.0.0"] | ||
[digest "1.4.4"]] | ||
:source-paths ["shootout"] | ||
:jvm-opts ^:replace ["-Xmx1g" "-server"]} | ||
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]} | ||
:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]} | ||
:1.7 {:dependencies [[org.clojure/clojure "1.7.0"]]} | ||
:1.9 {:dependencies [[org.clojure/clojure "1.9.0-alpha13"]]}} | ||
:kaocha | ||
{:dependencies [[lambdaisland/kaocha "1.0.732" | ||
:exclusions [org.clojure/spec.alpha]]]} | ||
:ci | ||
[:kaocha | ||
{:global-vars {*warn-on-reflection* false}}]} | ||
|
||
:prep-tasks ["codegen"] | ||
:aliases {"benchmark" ["with-profile" "dev,benchmark" "run" "-m"] | ||
"codegen" ["run" "-m" "pandect.codegen"] | ||
"all" ["with-profile" "+dev:+1.5:+1.6:+1.7:+1.9"]} | ||
:prep-tasks [["codegen"]] | ||
:plugins [[lein-isolate "0.2.2-SNAPSHOT"]] | ||
:middleware [leiningen.isolate/middleware] | ||
|
||
:aliases {"kaocha" ["with-profile" "+kaocha" "run" "-m" "kaocha.runner"] | ||
"ci" ["with-profile" "+ci" "run" "-m" "kaocha.runner" | ||
"--reporter" "documentation"] | ||
"benchmark" ["with-profile" "dev,benchmark" "run" "-m"] | ||
"codegen" ["run" "-m" "pandect.codegen"]} | ||
:pedantic? :abort) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
(ns ^{:doc "Digest Creation for Pandect" | ||
:author "Yannick Scherer"} | ||
pandect.core | ||
(:require [pandect.buffer] | ||
[potemkin :refer [import-vars]] | ||
[pandect.codegen :refer [algorithms algorithm-namespace]])) | ||
|
||
;; ## Re-export all algorithms | ||
|
||
;; ### Helper | ||
|
||
(defn- collect-algorithm-functions | ||
[ns algorithm-symbol] | ||
(require ns) | ||
(let [s (name algorithm-symbol)] | ||
(->> (ns-publics ns) | ||
(map (comp first)) | ||
(filter #(.startsWith (name %) s))))) | ||
|
||
;; ### Declare (necessary for clj-kondo to work) | ||
|
||
(defn- create-declare | ||
[] | ||
`(~'declare ~'with-buffer-size | ||
~@(->> (for [algo (algorithms) | ||
:let [ns (algorithm-namespace algo)]] | ||
(collect-algorithm-functions ns algo)) | ||
(apply concat)))) | ||
|
||
(comment | ||
;; Create the 'declare' form by evaluting the following: | ||
(create-declare)) | ||
|
||
(declare with-buffer-size ripemd256 ripemd256-hmac-file-bytes ripemd256-file ripemd256-hmac ripemd256-hmac-file ripemd256-hmac* ripemd256* ripemd256-hmac-bytes ripemd256-file-bytes ripemd256-hmac-file* ripemd256-bytes ripemd256-file* tiger tiger-file* tiger-hmac-bytes tiger-file tiger-hmac tiger-hmac-file-bytes tiger-file-bytes tiger-hmac* tiger-bytes tiger-hmac-file tiger* tiger-hmac-file* sha3-512 sha3-512-bytes sha3-512-file-bytes sha3-512* sha3-512-file* sha3-512-file keccak-384-file keccak-384-hmac* keccak-384 keccak-384-hmac-file keccak-384* keccak-384-bytes keccak-384-hmac-file-bytes keccak-384-file* keccak-384-file-bytes keccak-384-hmac-file* keccak-384-hmac keccak-384-hmac-bytes md5-file-bytes md5-hmac-bytes md5-hmac md5-rsa-verify-file md5-rsa* md5 md5-hmac-file* md5* md5-rsa-bytes md5-bytes md5-rsa-verify md5-rsa-file md5-file md5-hmac-file-bytes md5-rsa-file-bytes md5-rsa-file* md5-rsa md5-file* md5-hmac* md5-hmac-file ripemd128-hmac-file-bytes ripemd128 ripemd128-hmac ripemd128-file-bytes ripemd128-hmac-bytes ripemd128-hmac* ripemd128-hmac-file* ripemd128-file ripemd128-bytes ripemd128* ripemd128-file* ripemd128-hmac-file ripemd320-hmac-bytes ripemd320-hmac-file* ripemd320-hmac ripemd320 ripemd320-hmac* ripemd320-file ripemd320-hmac-file-bytes ripemd320-file* ripemd320-bytes ripemd320-hmac-file ripemd320* ripemd320-file-bytes siphash48-file siphash48-file-bytes siphash48-file* siphash48 siphash48-bytes siphash48* blake2b-384-file* blake2b-384-bytes blake2b-384* blake2b-384 blake2b-384-file blake2b-384-file-bytes sha3-224* sha3-224-bytes sha3-224-file* sha3-224-file-bytes sha3-224 sha3-224-file blake2b-512* blake2b-512-file* blake2b-512-file-bytes blake2b-512-bytes blake2b-512 blake2b-512-file sha3-384-file sha3-384 sha3-384* sha3-384-file* sha3-384-file-bytes sha3-384-bytes md2-rsa-file md2-bytes md2-rsa-verify md2-rsa* md2-rsa-file-bytes md2-rsa-bytes md2-file-bytes md2 md2-rsa-file* md2-rsa-verify-file md2* md2-file* md2-rsa md2-file whirlpool-hmac whirlpool-hmac* whirlpool-bytes whirlpool-hmac-bytes whirlpool-hmac-file* whirlpool whirlpool-file whirlpool* whirlpool-file* whirlpool-hmac-file whirlpool-hmac-file-bytes whirlpool-file-bytes blake2b-256* blake2b-256-bytes blake2b-256-file* blake2b-256-file blake2b-256-file-bytes blake2b-256 sha3-256-file-bytes sha3-256-file sha3-256-file* sha3-256 sha3-256-bytes sha3-256* siphash-file* siphash* siphash-file siphash siphash-bytes siphash-file-bytes keccak-224-file* keccak-224-hmac-file keccak-224-hmac* keccak-224-bytes keccak-224* keccak-224-hmac-file* keccak-224-file keccak-224-hmac keccak-224-file-bytes keccak-224 keccak-224-hmac-file-bytes keccak-224-hmac-bytes sha1-rsa sha1-rsa-file sha1-file sha1-rsa* sha1-dsa sha1-bytes sha1-hmac-file* sha1-dsa* sha1-hmac-bytes sha1-file* sha1-hmac-file-bytes sha1-hmac sha1-dsa-file* sha1-hmac* sha1-rsa-verify sha1* sha1 sha1-rsa-bytes sha1-dsa-bytes sha1-rsa-verify-file sha1-rsa-file-bytes sha1-rsa-file* sha1-dsa-file-bytes sha1-hmac-file sha1-dsa-verify sha1-dsa-verify-file sha1-file-bytes sha1-dsa-file sha224-hmac-file sha224-hmac sha224-bytes sha224-hmac* sha224-hmac-file* sha224-file sha224* sha224-file-bytes sha224-file* sha224-hmac-file-bytes sha224 sha224-hmac-bytes sha384-rsa sha384-rsa-verify-file sha384-rsa-verify sha384* sha384-hmac sha384-hmac-file sha384-hmac-file* sha384-rsa-file-bytes sha384-rsa* sha384-rsa-file* sha384-file-bytes sha384-file* sha384-rsa-bytes sha384-hmac-file-bytes sha384-file sha384 sha384-bytes sha384-hmac* sha384-rsa-file sha384-hmac-bytes keccak-256-bytes keccak-256-hmac* keccak-256-file* keccak-256* keccak-256-hmac keccak-256-hmac-file-bytes keccak-256-hmac-file keccak-256-file-bytes keccak-256-hmac-bytes keccak-256-hmac-file* keccak-256 keccak-256-file gost-file-bytes gost-hmac-file* gost-hmac* gost-hmac-bytes gost-bytes gost-hmac gost-hmac-file-bytes gost-file* gost* gost-hmac-file gost-file gost sha512-hmac-file-bytes sha512-rsa* sha512-bytes sha512-hmac sha512-rsa-file sha512-rsa-verify sha512-rsa-file* sha512-hmac* sha512-hmac-file sha512-hmac-file* sha512-file-bytes sha512-file* sha512-file sha512-rsa-file-bytes sha512 sha512-rsa-bytes sha512* sha512-hmac-bytes sha512-rsa sha512-rsa-verify-file crc32-file* crc32-bytes crc32-file-bytes crc32* crc32 crc32-file blake2b-160-bytes blake2b-160-file blake2b-160-file-bytes blake2b-160 blake2b-160* blake2b-160-file* ripemd160-hmac* ripemd160-file ripemd160-hmac-file* ripemd160-file-bytes ripemd160-file* ripemd160-hmac-file-bytes ripemd160-bytes ripemd160* ripemd160-hmac-file ripemd160-hmac-bytes ripemd160 ripemd160-hmac keccak-512-hmac-file-bytes keccak-512-hmac-file keccak-512-file-bytes keccak-512-file* keccak-512-hmac-bytes keccak-512-hmac* keccak-512-hmac-file* keccak-512-bytes keccak-512-hmac keccak-512* keccak-512-file keccak-512 sha256-hmac-bytes sha256-hmac-file sha256-file-bytes sha256-rsa* sha256-rsa sha256-hmac* sha256-hmac sha256* sha256-rsa-verify sha256-hmac-file-bytes sha256-rsa-file-bytes sha256-file* sha256-rsa-bytes sha256-bytes sha256-rsa-file* sha256-hmac-file* sha256-file sha256-rsa-file sha256 sha256-rsa-verify-file md4* md4-file md4-bytes md4-hmac* md4-hmac-file* md4-hmac md4-file-bytes md4-hmac-file-bytes md4-file* md4-hmac-file md4 md4-hmac-bytes adler32* adler32-bytes adler32-file* adler32-file adler32-file-bytes adler32) | ||
|
||
;; ### Import Vars | ||
|
||
(defmacro ^:private reexport-algos | ||
[] | ||
`(do | ||
(import-vars pandect.buffer/with-buffer-size) | ||
~@(for [algo (algorithms) | ||
:let [ns (algorithm-namespace algo)]] | ||
`(do | ||
(require '~ns) | ||
(import-vars | ||
[~ns ~@(collect-algorithm-functions ns algo)]))))) | ||
|
||
(reexport-algos) |
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
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.