@Throws
annotation removed fromUpdatable.update
(it is documented).- Finalizes
Digest
internal API and removesInternalKotlinCryptoApi
opt-in requirement from constructors.- Drops usage of
DigestState
in favor of secondary constructor which takesDigest
as an argument (forcopy
function implementations). Copyable.copy
override is now passed through to implementations so that the proper return type can be defined (instead of requiring API consumers to cast fromDigest
).protected
functions renamed:compress
>>compressProtected
digest
>>digestProtected
updateDigest
>>updateProtected
resetDigest
>>resetProtected
digestProtected
(previouslydigest
) now only provides the buffered input and position as arguments;bitLength
is no longer tracked byDigest
.
- Drops usage of
Digest.digest
now zero's out stale buffered input frombufPos
tobuf.size
before passing it todigestProtected
(previouslydigest
) as an argument.- Finalizes
Mac
internal API and removesInternalKotlinCryptoApi
opt-in requirement from constructors.- Provides secondary constructor which takes
Mac
as an argument (forcopy
function implementations). Copyable.copy
override is now passed through toMac
implementations so that the proper return type can be defined (instead of requiring API consumers to cast fromMac
).- Adds ability to reinitialize
Mac
with a newkey
parameter viareset(newKey)
(or clear it after use). - Adds
Mac.clearKey
helper function for zeroing out key material before dereferencing theMac
(if desired). - Removes
Mac.Engine.State
in favor of secondary constructor which takesMac.Engine
as an argument (forcopy
function implementation). - Adds abstract function
Mac.Engine.reset(newKey)
for reinitialization functionality.
- Provides secondary constructor which takes
- Finalizes
Xof
andXofFactory
internal API and removesInternalKotlinCryptoApi
opt-in requirement from constructors.Xof.Reader.readProtected
no longer passesbytesRead
as an argument.
- Adds
ReKeyableXofAlgorithm
interface forXof
implementations who's backing delegate is aMac
. - Adds
Xof.Companion.reset(newKey)
extension function which allows API consumers the ability to reinitialize theXof
with a newkey
parameter when thatXof
is backed by an instance ofReKeyableXofAlgorithm
(i.e. aMac
implementation). Xof.use
andXof.Reader.use
functions are now inlined.- Removes usage of
KotlinCrypto.endians
library (deprecated) fromXof.Utils
.
- Fixes optimization issues with
Digest.update
internals [#70]
- Adds benchmarking to repository [#64]
- Refactors
Digest
internals (performance improvements) [#66] - Changes module
:common
name to:core
to be more in line with its package name oforg.kotlincrypto.core
- Publication coordinates have changed from
org.kotlincrypto.core:common
toorg.kotlincrypto.core:core
- Publication coordinates have changed from
- Updates
kotlin
to1.9.24
[#61] - Updates
endians
to0.3.1
[#61] - Fixes multiplatform metadata manifest
unique_name
parameter for all source sets to be truly unique. [#61] - Updates jvm
.kotlin_module
with truly unique file name. [#61]
- Use
transitive
keyword forJPMS
module-info.java
files [#58]
- Updates
kotlin
to1.9.23
[#55] - Updates
endians
to0.3.0
[#55] - Add experimental support for
wasmJs
&wasmWasi
[#55] - Add support for Java9
JPMS
via Multi-Release jar [#56]
- Adds check for Android Runtime to
KC_ANDROID_SDK_INT
[#51]- Android Unit Tests:
KC_ANDROID_SDK_INT
will now benull
- Android Runtime:
KC_ANDROID_SDK_INT
will NOT benull
- Android Unit Tests:
- Updates
kotlin
to1.9.21
[#52] - Updates
endians
to0.2.0
[#52] - Drops support for the following deprecated targets:
iosArm32
watchosX86
linuxArm32Hfp
linuxMips32
linuxMipsel32
mingwX86
wasm32
- Fixes JPMS split packages [#48]
- API BREAKING CHANGES
- Package names were changed for
digest
,mac
, andxof
dependencies - Example:
org.kotlincrypto.core.Digest
was moved toorg.kotlincrypto.core.digest.Digest
org.kotlincrypto.core.Mac
was moved toorg.kotlincrypto.core.mac.Mac
org.kotlincrypto.core.Xof
was moved toorg.kotlincrypto.core.xof.Xof
- See the ANNOUNCEMENT for more information on
0.3.0
release
- Fixes Android API 23 and below not calling
javax.crypto.MacSpi.engineReset
wheneverjavax.crypto.Mac.doFinal
is invoked [#46]
- Fixes Android API 21-23 requiring a
Provider
in order to setjavax.crypto.Mac.spiImpl
whenjavax.crypto.Mac.init
is invoked [#44] - Throw
InvalidKeyException
ifjavax.crypto.Mac.init
is invoked [#43]- All
org.kotlincrypto.core.Mac
APIs are structured such that implementations always require a key as a constructor argument and are initialized immediately. As such, if a java caller attempts to re-initialize thejavax.crypto.Mac
with a different key they may assume future output produced is using the new key. This is not the case asKotlin Crypto
does not use a provider based architecture. A new, uninitializedMac
cannot be created. - Note that
Mac.init
is not available fromcommonMain
. It is a remnant of bad API design requiring ability to lazily initialize things whichKotlin Crypto
will never support as it leads to monolithic structures, instead of building on good abstractions. IfMac.init
is required to be called, a wholly new instance of theorg.kotlincrypto.core.Mac
implementation needs to be instantiated with the new key.
- All
- Fixes Android API 23 and below not accepting
null
forMac.init
key parameter [#38] - Updates
kotlin
to1.8.21
[#40]
- Adds
Digest.updateDigest
protected open functions for implementors to override when needing access to input before it is buffered [#34] - Adds input argument check for nonJvm
Mac.update
whenoffset
andlen
parameters are specified [#35] - Updates
Digest.digestLength
constructor argument check to now accept 0 as a valid length [#36]- Previously, passing 0 would throw an
IllegalArgumentException
.
- Previously, passing 0 would throw an
- Fix
nonJvm
Mac.doFinal
not callingengine.reset()
[#27]- Only implementation of
Mac
isHmac
viaMACs
repo, which is unaffected by this issue.
- Only implementation of
- Adds
XofAlgorithm
interface [#29]
- Adds abstraction for
XOF
s (Extendable-Output Functions
) [#25]
- BREAKING CHANGE:
Digest.compress
function was changed to also include an offset. This drastically improves performance by mitigating excessive/unnecessary array copying. [#21]
- Fix
Digest.update
miscalculation whenoffset
parameter is provided [#16] - Fix
jvm
Digest.algorithm()
StackOverflow error [#12]
- Initial Release