-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
aes/src/commonMain/kotlin/com/mooncloak/kodetools/aes/BlockCipherMode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |