Skip to content

Commit 6384020

Browse files
committed
Prepare 0.2.3 release
1 parent 2c1a3e7 commit 6384020

File tree

3 files changed

+58
-12
lines changed

3 files changed

+58
-12
lines changed

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# CHANGELOG
22

3+
## Version 0.2.3 (2023-07-08)
4+
- Adds a new module, `hmac-sha3` [[#21]][21]
5+
- `HmacKeccak224`
6+
- `HmacKeccak256`
7+
- `HmacKeccak384`
8+
- `HmacKeccak512`
9+
- `HmacSHA3_224`
10+
- `HmacSHA3_256`
11+
- `HmacSHA3_384`
12+
- `HmacSHA3_512`
13+
- Cleans up `Hmac` implementation [[#21]]
14+
- Updates `kotlincrypto.core` to `0.2.3` [[#23]][23]
15+
- Updates `kotlincrypto.hash` to `0.2.3` [[#23]][23]
16+
317
## Version 0.2.1 (2023-03-28)
418
- Updates `kotlincrypto.core` to `0.2.0`
519
- Updates `kotlincrypto.hash` to `0.2.1`
@@ -8,7 +22,7 @@
822
- Adds `HmacSHA224` algorithm
923
- Adds `HmacSHA384` algorithm
1024
- Adds `HmacSHA512t` algorithm
11-
- Combines all `hmac-sha2-*` algorithms into single `sha2` module
25+
- Combines all `hmac-sha2-*` algorithms into single `hmac-sha2` module
1226

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

2034
## Version 0.1.0 (2023-03-05)
2135
- Initial Release
36+
37+
[21]: https://github.com/KotlinCrypto/MACs/pull/21
38+
[23]: https://github.com/KotlinCrypto/MACs/pull/23

README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,29 @@ If you are looking for `SecureRandom`, see the [secure-random repo][url-secure-r
3434
### Usage
3535

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

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

4346
HmacSHA1(key).doFinal(random)
47+
}
48+
```
49+
50+
`SHA-2`
51+
```kotlin
52+
fun main() {
53+
val key = SecureRandom().nextBytesOf(100)
54+
val random = Random.Default.nextBytes(615)
4455

45-
// SHA2
4656
HmacSHA224(key).doFinal(random)
4757

4858
HmacSHA256(key).apply { update(random) }.doFinal(random)
49-
59+
5060
HmacSha384(key).doFinal(random)
5161

5262
val hMacSha512 = HmacSHA512(key)
@@ -67,8 +77,23 @@ fun main() {
6777
}
6878
```
6979

70-
### Get Started
80+
`SHA-3`
81+
```kotlin
82+
fun main() {
83+
val key = SecureRandom().nextBytesOf(100)
84+
85+
HmacKeccak224(key)
86+
HmacKeccak256(key)
87+
HmacKeccak384(key)
88+
HmacKeccak512(key)
89+
HmacSHA3_224(key)
90+
HmacSHA3_256(key)
91+
HmacSHA3_384(key)
92+
HmacSHA3_512(key)
93+
}
94+
```
7195

96+
### Get Started
7297

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

85110
// define artifacts without version
86111

@@ -92,17 +117,21 @@ dependencies {
92117

93118
// HmacSHA224, HmacSHA256, HmacSHA384, HmacSHA512, HmacSHA512/224, HmacSHA512/256
94119
implementation("org.kotlincrypto.macs:hmac-sha2")
120+
121+
// HmacKeccak224, HmacKeccak256, HmacKeccak384, HmacKeccak512
122+
// HmacSHA3-224, HmacSHA3-256, HmacSHA3-384, HmacSHA3-512
123+
implementation("org.kotlincrypto.macs:hmac-sha3")
95124
}
96125
```
97126

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

102131
<!-- TAG_DEPENDENCIES -->
103132
[badge-kotlin]: https://img.shields.io/badge/kotlin-1.8.10-blue.svg?logo=kotlin
104-
[badge-core]: https://img.shields.io/badge/kotlincrypto.core-0.2.0-blue.svg
105-
[badge-hash]: https://img.shields.io/badge/kotlincrypto.hash-0.2.1-blue.svg
133+
[badge-core]: https://img.shields.io/badge/kotlincrypto.core-0.2.3-blue.svg
134+
[badge-hash]: https://img.shields.io/badge/kotlincrypto.hash-0.2.3-blue.svg
106135

107136
<!-- TAG_PLATFORMS -->
108137
[badge-platform-android]: http://img.shields.io/badge/-android-6EDB8D.svg?style=flat

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ POM_DEVELOPER_ID=KotlinCrypto
2929
POM_DEVELOPER_NAME=Kotlin Crypto
3030
POM_DEVELOPER_URL=https://github.com/KotlinCrypto/
3131

32-
VERSION_NAME=0.2.2-SNAPSHOT
32+
VERSION_NAME=0.2.3
3333
# 0.1.0-alpha01 = 00 01 00 11
3434
# 0.1.0-beta01 = 00 01 00 21
3535
# 0.1.0-rc01 = 00 01 00 31
3636
# 0.1.0 = 00 01 00 99
3737
# 1.1.0 = 01 01 00 99
38-
VERSION_CODE=20299
38+
VERSION_CODE=20399

0 commit comments

Comments
 (0)