-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
dokka
documentation at https://macs.kotlincrypto.org` (#73)
- Loading branch information
Showing
21 changed files
with
339 additions
and
140 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 |
---|---|---|
|
@@ -4,3 +4,6 @@ build/ | |
.idea/ | ||
local.properties | ||
.kotlin/ | ||
|
||
gh-pages/* | ||
!gh-pages/publish.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2025 Matthew Nelson | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
import org.jetbrains.dokka.DokkaConfiguration.Visibility | ||
import org.jetbrains.dokka.gradle.DokkaTaskPartial | ||
import java.net.URI | ||
|
||
plugins { | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
tasks.withType<DokkaTaskPartial>().configureEach { | ||
suppressInheritedMembers = true | ||
|
||
dokkaSourceSets.configureEach { | ||
includes.from("README.md") | ||
noStdlibLink = true | ||
|
||
externalDocumentationLink { | ||
url = URI("https://core.kotlincrypto.org/").toURL() | ||
} | ||
externalDocumentationLink { | ||
url = URI("https://hash.kotlincrypto.org/").toURL() | ||
} | ||
|
||
sourceLink { | ||
localDirectory = rootDir | ||
remoteUrl = URI("https://github.com/KotlinCrypto/MACs/tree/master").toURL() | ||
remoteLineSuffix = "#L" | ||
} | ||
|
||
documentedVisibilities.set(setOf( | ||
Visibility.PUBLIC, | ||
)) | ||
} | ||
} |
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,37 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2025 Matthew Nelson | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
set -e | ||
|
||
readonly DIR_SCRIPT="$( cd "$( dirname "$0" )" >/dev/null && pwd )" | ||
readonly REPO_NAME="MACs" | ||
|
||
trap 'rm -rf "$DIR_SCRIPT/$REPO_NAME"' EXIT | ||
|
||
cd "$DIR_SCRIPT" | ||
git clone -b gh-pages --single-branch https://github.com/KotlinCrypto/$REPO_NAME.git | ||
rm -rf "$DIR_SCRIPT/$REPO_NAME/"* | ||
echo "$REPO_NAME.kotlincrypto.org" > "$DIR_SCRIPT/$REPO_NAME/CNAME" | ||
|
||
cd .. | ||
./gradlew clean -DKMP_TARGETS_ALL | ||
./gradlew dokkaHtmlMultiModule --no-build-cache -DKMP_TARGETS_ALL | ||
cp -aR build/dokka/htmlMultiModule/* gh-pages/$REPO_NAME | ||
|
||
cd "$DIR_SCRIPT/$REPO_NAME" | ||
sed -i "s|module:|module:library/|g" "package-list" | ||
|
||
git add --all | ||
git commit -S --message "Update dokka docs" | ||
git push |
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,48 +1,51 @@ | ||
[versions] | ||
androidx-test-runner = "1.5.2" | ||
androidx-test-runner = "1.5.2" | ||
|
||
bouncy-castle = "1.73" | ||
bouncy-castle = "1.73" | ||
|
||
encoding = "2.3.1" | ||
encoding = "2.3.1" | ||
|
||
gradle-android = "8.2.2" | ||
gradle-benchmark = "0.4.11" | ||
gradle-binary-compat = "0.16.3" | ||
gradle-kmp-configuration = "0.3.2" | ||
gradle-kotlin = "1.9.24" | ||
gradle-publish-maven = "0.29.0" | ||
gradle-android = "8.2.2" | ||
gradle-benchmark = "0.4.11" | ||
gradle-binary-compat = "0.16.3" | ||
gradle-dokka = "1.9.20" | ||
gradle-kmp-configuration = "0.3.2" | ||
gradle-kotlin = "1.9.24" | ||
gradle-publish-maven = "0.29.0" | ||
|
||
kotlincrypto-bitops = "0.1.2" | ||
kotlincrypto-core = "0.6.1-SNAPSHOT" | ||
kotlincrypto-hash = "0.6.1-SNAPSHOT" | ||
kotlincrypto-sponges = "0.3.4" | ||
kotlincrypto-bitops = "0.1.2" | ||
kotlincrypto-core = "0.6.1-SNAPSHOT" | ||
kotlincrypto-hash = "0.6.1-SNAPSHOT" | ||
kotlincrypto-sponges = "0.3.4" | ||
|
||
[libraries] | ||
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" } | ||
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" } | ||
gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" } | ||
|
||
kotlincrypto-core-digest = { module = "org.kotlincrypto.core:digest", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-core-mac = { module = "org.kotlincrypto.core:mac", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-core-xof = { module = "org.kotlincrypto.core:xof", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-hash-blake2 = { module = "org.kotlincrypto.hash:blake2", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-md = { module = "org.kotlincrypto.hash:md", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha1 = { module = "org.kotlincrypto.hash:sha1", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha2 = { module = "org.kotlincrypto.hash:sha2", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha3 = { module = "org.kotlincrypto.hash:sha3", version.ref = "kotlincrypto-hash" } | ||
gradle-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "gradle-dokka" } | ||
gradle-kmp-configuration = { module = "io.matthewnelson:gradle-kmp-configuration-plugin", version.ref = "gradle-kmp-configuration" } | ||
gradle-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "gradle-kotlin" } | ||
gradle-publish-maven = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "gradle-publish-maven" } | ||
|
||
kotlincrypto-core-digest = { module = "org.kotlincrypto.core:digest", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-core-mac = { module = "org.kotlincrypto.core:mac", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-core-xof = { module = "org.kotlincrypto.core:xof", version.ref = "kotlincrypto-core" } | ||
kotlincrypto-hash-blake2 = { module = "org.kotlincrypto.hash:blake2", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-md = { module = "org.kotlincrypto.hash:md", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha1 = { module = "org.kotlincrypto.hash:sha1", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha2 = { module = "org.kotlincrypto.hash:sha2", version.ref = "kotlincrypto-hash" } | ||
kotlincrypto-hash-sha3 = { module = "org.kotlincrypto.hash:sha3", version.ref = "kotlincrypto-hash" } | ||
|
||
# tests & tools | ||
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" } | ||
benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "gradle-benchmark" } | ||
bouncy-castle = { module = "org.bouncycastle:bcprov-ext-jdk15to18", version.ref = "bouncy-castle" } | ||
encoding-base16 = { module = "io.matthewnelson.encoding:base16", version.ref = "encoding" } | ||
encoding-base64 = { module = "io.matthewnelson.encoding:base64", version.ref = "encoding" } | ||
kotlincrypto-bitops-bits = { module = "org.kotlincrypto.bitops:bits", version.ref = "kotlincrypto-bitops" } | ||
kotlincrypto-bitops-endian = { module = "org.kotlincrypto.bitops:endian", version.ref = "kotlincrypto-bitops" } | ||
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidx-test-runner" } | ||
benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "gradle-benchmark" } | ||
bouncy-castle = { module = "org.bouncycastle:bcprov-ext-jdk15to18", version.ref = "bouncy-castle" } | ||
encoding-base16 = { module = "io.matthewnelson.encoding:base16", version.ref = "encoding" } | ||
encoding-base64 = { module = "io.matthewnelson.encoding:base64", version.ref = "encoding" } | ||
kotlincrypto-bitops-bits = { module = "org.kotlincrypto.bitops:bits", version.ref = "kotlincrypto-bitops" } | ||
kotlincrypto-bitops-endian = { module = "org.kotlincrypto.bitops:endian", version.ref = "kotlincrypto-bitops" } | ||
kotlincrypto-sponges-keccak = { module = "org.kotlincrypto.sponges:keccak", version.ref = "kotlincrypto-sponges" } | ||
|
||
[plugins] | ||
android-library = { id = "com.android.library", version.ref = "gradle-android" } | ||
benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "gradle-benchmark" } | ||
binary-compat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "gradle-binary-compat" } | ||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "gradle-kotlin" } | ||
android-library = { id = "com.android.library", version.ref = "gradle-android" } | ||
benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "gradle-benchmark" } | ||
binary-compat = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "gradle-binary-compat" } | ||
dokka = { id = "org.jetbrains.dokka", version.ref = "gradle-dokka" } | ||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "gradle-kotlin" } |
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,25 @@ | ||
# Module blake2 | ||
|
||
`Mac` implementations for BLAKE2 Keyed Hashing | ||
|
||
Implementations for: | ||
- BLAKE2b | ||
- BLAKE2s | ||
|
||
See [HERE][url-mac-usage] for basic usage example of `Mac`. | ||
|
||
```kotlin | ||
// Using SecureRandom from the secure-random repo as an example | ||
import org.kotlincrypto.SecureRandom | ||
// ... | ||
|
||
fun main() { | ||
val key64 = SecureRandom().nextBytesOf(64) | ||
val key32 = SecureRandom().nextBytesOf(32) | ||
|
||
BLAKE2b(key64, 512) | ||
BLAKE2s(key32, 256) | ||
} | ||
``` | ||
|
||
[url-mac-usage]: https://core.kotlincrypto.org/library/mac/index.html |
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.