kotlincrypto / macs Goto Github PK
View Code? Open in Web Editor NEWMessage Authentication Code algorithms for Kotlin Multiplatform
License: Apache License 2.0
Message Authentication Code algorithms for Kotlin Multiplatform
License: Apache License 2.0
Add implementations for:
HmacMD5
HmacSHA1
HmacSHA256
HmacSHA512
Once hash
version 0.2.1
is released, just need to do a version bump and release.
Add new module :library:kmac
which has implementations for KMAC128
, and KMAC256
Will also need to update testing
module to properly exercise the update(input, offset, len)
method.
update(input: ByteArray, offset: Int, len: Int)
override is not implemented correctly as it passes the entire byte array to digest instead of the offset
and len
parameters.
core
version 0.3.0-SNAPSHOT
is available containing API breaking changes.
See:
This issue will require a few things:
Digest
, Mac
and Xof
Current implementation of Hmac.Engine
is that the provided key ByteArray
is sized to the digest.blockSize()
by either hashing it once (if larger than), padding it with 0's (if smaller), or using the provided key. It then uses the prepared key to derive iKey
and oKey
.
After those are derived, the preparedKey
should be blanked. As such, the provided key
should always be copied so we are not modifying the provided ByteArray
, so that the copy can be blanked before dereferencing.
val preparedKey = if (key.size > digest.blockSize()) {
digest.digest(key).copyOf(digest.blockSize())
} else {
key.copyOf(digest.blockSize())
}
// ... derive iKey and oKey
preparedKey.fill(0)
Same issue.
0.1.0-beta02
adds support for composite builds.
Fix for Android API 21-23 requiring a Provider
when instantiating a new Mac
For release 0.3.0
, modules hmac-sha2-256
and hmac-sha2-512
will no longer be published. They were there for supporting backward compatibility with consumers of 0.1.X
versions and will be going away as there has been ample time to heed the deprecation notice.
Currently, dependencies are expressed as api
for core digest, and digest algos. The high level implementations of Hmac
algos should not provide this dependency. If the consumer wishes to import the hashing algo, they can do so themselves. The only core libs that should be provided is mac
and common
(b/c needed).
SHA2
algorithms into single sha2
moduleAdd new module :library:hmac:sha3
which has implementations for HmacSHA3-224
, HmacSHA3-256
, HmacSHA3-384
, HmacSHA3-512
, etc.
Update core
and hash
dependencies to 0.2.3
The hmac
dependency is provided via high level implementations and should not be included in the BOM
. It is more of a "internal" module.
As with other SHA3
derived functions, an alternate constructor is needed in order to express a non-default output macLength
Kmac.Engine
currently only uses Xof
for CSHAKE
as its hashing source. There is a lot of unnecessary overhead with this when used as a Mac
. As such, Kmac.Engine
should be split into 2, DigestEngine
, and XofEngine
.
Will also require updating core and hash to 0.2.7
, as there was a fix for android from core
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.