Skip to content

Commit

Permalink
KyberKotlin v0.4.6
Browse files Browse the repository at this point in the history
* Fixed duplicate dependencies for dependents.
* jvmFullJar
  • Loading branch information
ronhombre committed Feb 10, 2024
1 parent 5356baf commit 2c6263f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
17 changes: 11 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "asia.hombre.kyber" //The value after the last '.' is considered the maven name i.e. asia.hombre:kyber:+
version = "0.4.5"
version = "0.4.6"

val projectName = project.group.toString().split(".").last() //Grab maven name
val baseProjectName = projectName.plus("-").plus(project.version)
Expand All @@ -22,6 +22,7 @@ val mavenBundlingDir = "$mavenDir/bundling"
val mavenDeep = "$mavenBundlingDir/" + (project.group.toString().replace(".", "/")) + "/" + version

val jarFileName = baseProjectName.plus(".jar")
val jarFullFileName = baseProjectName.plus("-full.jar")
val pomFileName = baseProjectName.plus(".pom")
val javadocsFileName = baseProjectName.plus("-javadoc.jar")
val sourcesFileName = baseProjectName.plus("-sources.jar")
Expand Down Expand Up @@ -102,15 +103,19 @@ kotlin {
archiveFileName.set(mavenBundleFileName)
}

val jvmJar by tasks.getting(org.gradle.jvm.tasks.Jar::class) {
tasks.register<Jar>("jvmFullJar") {
archiveFileName.set(jarFileName)

doFirst {
from(sourceSets["jvmMain"].kotlin)
}
}

val jvmFullJar by tasks.getting(org.gradle.jvm.tasks.Jar::class) {
archiveFileName.set(jarFullFileName)

doFirst {
from(configurations.getByName("jvmRuntimeClasspath").map { if (it.isDirectory) it else zipTree(it) })
//Uncomment to list jvm configurations
/*println(configurations.names.toList().filter {
it.contains("jvm") &&!(it.contains("test") || it.contains("Test"))
}.joinToString("\n"))*/
}
}

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@

<groupId>asia.hombre</groupId>
<artifactId>kyber</artifactId>
<version>0.4.5</version>
<version>0.4.6</version>
<packaging>jar</packaging>

<scm>
<tag>v0.4.5</tag>
<tag>v0.4.6</tag>
<connection>scm:git:https://github.com/ronhombre/KyberKotlin.git</connection>
<url>https://github.com/ronhombre/KyberKotlin.git</url>
</scm>
Expand Down
12 changes: 6 additions & 6 deletions src/commonTest/kotlin/asia/hombre/kyber/Tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ class Tests {
val randomSeed = SecureRandom().nextBytesOf(32)
val pkeSeed = SecureRandom().nextBytesOf(32)

val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_512, randomSeed, pkeSeed)
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_512, randomSeed, pkeSeed)
val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_512, randomSeed, pkeSeed.copyOf())
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_512, randomSeed, pkeSeed.copyOf())

assertContentEquals(firstGeneration.encapsulationKey.key.fullBytes, secondGeneration.encapsulationKey.key.fullBytes, "Regeneration failed for 512!")
}
Expand All @@ -350,8 +350,8 @@ class Tests {
val randomSeed = SecureRandom().nextBytesOf(32)
val pkeSeed = SecureRandom().nextBytesOf(32)

val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_768, randomSeed, pkeSeed)
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_768, randomSeed, pkeSeed)
val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_768, randomSeed, pkeSeed.copyOf())
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_768, randomSeed, pkeSeed.copyOf())

assertContentEquals(firstGeneration.encapsulationKey.key.fullBytes, secondGeneration.encapsulationKey.key.fullBytes, "Regeneration failed for 768!")
}
Expand All @@ -361,8 +361,8 @@ class Tests {
val randomSeed = SecureRandom().nextBytesOf(32)
val pkeSeed = SecureRandom().nextBytesOf(32)

val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_1024, randomSeed, pkeSeed)
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_1024, randomSeed, pkeSeed)
val firstGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_1024, randomSeed, pkeSeed.copyOf())
val secondGeneration = KyberKeyGenerator.generate(KyberParameter.ML_KEM_1024, randomSeed, pkeSeed.copyOf())

assertContentEquals(firstGeneration.encapsulationKey.key.fullBytes, secondGeneration.encapsulationKey.key.fullBytes, "Regeneration failed for 1024!")
}
Expand Down

0 comments on commit 2c6263f

Please sign in to comment.