Skip to content

Commit

Permalink
Prepare 0.2.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
05nelsonm committed Apr 8, 2023
1 parent 2c1a3e7 commit 6384020
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 12 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# CHANGELOG

## Version 0.2.3 (2023-07-08)
- Adds a new module, `hmac-sha3` [[#21]][21]
- `HmacKeccak224`
- `HmacKeccak256`
- `HmacKeccak384`
- `HmacKeccak512`
- `HmacSHA3_224`
- `HmacSHA3_256`
- `HmacSHA3_384`
- `HmacSHA3_512`
- Cleans up `Hmac` implementation [[#21]]
- Updates `kotlincrypto.core` to `0.2.3` [[#23]][23]
- Updates `kotlincrypto.hash` to `0.2.3` [[#23]][23]

## Version 0.2.1 (2023-03-28)
- Updates `kotlincrypto.core` to `0.2.0`
- Updates `kotlincrypto.hash` to `0.2.1`
Expand All @@ -8,7 +22,7 @@
- Adds `HmacSHA224` algorithm
- Adds `HmacSHA384` algorithm
- Adds `HmacSHA512t` algorithm
- Combines all `hmac-sha2-*` algorithms into single `sha2` module
- Combines all `hmac-sha2-*` algorithms into single `hmac-sha2` module

## Version 0.1.0 (2023-03-06)
- Fixes `Hmac.Engine` implementation where `offset` or `len`
Expand All @@ -19,3 +33,6 @@

## Version 0.1.0 (2023-03-05)
- Initial Release

[21]: https://github.com/KotlinCrypto/MACs/pull/21
[23]: https://github.com/KotlinCrypto/MACs/pull/23
47 changes: 38 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,29 @@ If you are looking for `SecureRandom`, see the [secure-random repo][url-secure-r
### Usage

```kotlin

fun main() {
val (random, key) = Random.Default.let { r -> Pair(r.nextBytes(615), r.nextBytes(50)) }
// NOTE: SecureRandom is not included as a dependency in
// MACs, only using it here as an example b/c one
// should never derive a key using Random.
val key = SecureRandom().nextBytesOf(100)
val random = Random.Default.nextBytes(615)

HmacMD5(key).apply { update(random) }.doFinal()

HmacSHA1(key).doFinal(random)
}
```

`SHA-2`
```kotlin
fun main() {
val key = SecureRandom().nextBytesOf(100)
val random = Random.Default.nextBytes(615)

// SHA2
HmacSHA224(key).doFinal(random)

HmacSHA256(key).apply { update(random) }.doFinal(random)

HmacSha384(key).doFinal(random)

val hMacSha512 = HmacSHA512(key)
Expand All @@ -67,8 +77,23 @@ fun main() {
}
```

### Get Started
`SHA-3`
```kotlin
fun main() {
val key = SecureRandom().nextBytesOf(100)

HmacKeccak224(key)
HmacKeccak256(key)
HmacKeccak384(key)
HmacKeccak512(key)
HmacSHA3_224(key)
HmacSHA3_256(key)
HmacSHA3_384(key)
HmacSHA3_512(key)
}
```

### Get Started

The best way to keep `KotlinCrypto` dependencies up to date is by using the
[version-catalog][url-version-catalog]. Alternatively, you can use the BOM as
Expand All @@ -80,7 +105,7 @@ shown below.
// build.gradle.kts
dependencies {
// define the BOM and its version
implementation(platform("org.kotlincrypto.macs:bom:0.2.1"))
implementation(platform("org.kotlincrypto.macs:bom:0.2.3"))

// define artifacts without version

Expand All @@ -92,17 +117,21 @@ dependencies {

// HmacSHA224, HmacSHA256, HmacSHA384, HmacSHA512, HmacSHA512/224, HmacSHA512/256
implementation("org.kotlincrypto.macs:hmac-sha2")

// HmacKeccak224, HmacKeccak256, HmacKeccak384, HmacKeccak512
// HmacSHA3-224, HmacSHA3-256, HmacSHA3-384, HmacSHA3-512
implementation("org.kotlincrypto.macs:hmac-sha3")
}
```

<!-- TAG_VERSION -->
[badge-latest-release]: https://img.shields.io/badge/latest--release-0.2.1-blue.svg?style=flat
[badge-latest-release]: https://img.shields.io/badge/latest--release-0.2.3-blue.svg?style=flat
[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat

<!-- TAG_DEPENDENCIES -->
[badge-kotlin]: https://img.shields.io/badge/kotlin-1.8.10-blue.svg?logo=kotlin
[badge-core]: https://img.shields.io/badge/kotlincrypto.core-0.2.0-blue.svg
[badge-hash]: https://img.shields.io/badge/kotlincrypto.hash-0.2.1-blue.svg
[badge-core]: https://img.shields.io/badge/kotlincrypto.core-0.2.3-blue.svg
[badge-hash]: https://img.shields.io/badge/kotlincrypto.hash-0.2.3-blue.svg

<!-- TAG_PLATFORMS -->
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ POM_DEVELOPER_ID=KotlinCrypto
POM_DEVELOPER_NAME=Kotlin Crypto
POM_DEVELOPER_URL=https://github.com/KotlinCrypto/

VERSION_NAME=0.2.2-SNAPSHOT
VERSION_NAME=0.2.3
# 0.1.0-alpha01 = 00 01 00 11
# 0.1.0-beta01 = 00 01 00 21
# 0.1.0-rc01 = 00 01 00 31
# 0.1.0 = 00 01 00 99
# 1.1.0 = 01 01 00 99
VERSION_CODE=20299
VERSION_CODE=20399

0 comments on commit 6384020

Please sign in to comment.