Skip to content

Commit

Permalink
Created BlockCipherMode
Browse files Browse the repository at this point in the history
  • Loading branch information
chRyNaN committed Aug 27, 2024
1 parent bf99bbd commit df50f74
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.mooncloak.kodetools.aes

import kotlinx.serialization.Serializable
import kotlin.jvm.JvmInline

/**
* Defines how large sets of data are combined during AES encryption. AES encrypts 16 byte blocks of data, but for data
* larger than 16 bytes, they have to be combined. The approach to how large data is combined (for example,
* concatenated, or XORed with the previous cipher text, etc.) is defined by separate specifications and identified by
* instances of this class. Note that only some common modes are supported by this AES implementation.
*/
@JvmInline
@Serializable
public value class BlockCipherMode public constructor(
public val value: String
) {

public companion object {

public val ECB: BlockCipherMode = BlockCipherMode(value = "ECB")

public val CBC: BlockCipherMode = BlockCipherMode(value = "CBC")

public val GCM: BlockCipherMode = BlockCipherMode(value = "GCM")
}
}

0 comments on commit df50f74

Please sign in to comment.