Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Add close delegate setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Cach30verfl0w committed Jun 12, 2024
1 parent 198cfbf commit 272aaae
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,15 @@ class CipherDelegate<C: Any> {
}
}

/**
* This method sets a delegate to the close function of the cipher.
*
* @author Cedric Hammes
* @since 11/06/2024
*/
@Suppress("MemberVisibilityCanBePrivate")
fun close(closure: (context: CipherContext<C>) -> Unit) {
this.close = closure
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,15 @@ class HasherDelegate<C> {
fun hash(closure: (C, ByteArray) -> String) {
this.hash = closure
}

/**
* This method sets a delegate to the close function of the hasher.
*
* @author Cedric Hammes
* @since 11/06/2024
*/
@Suppress("MemberVisibilityCanBePrivate")
fun close(closure: (context: CipherContext<C>) -> Unit) {
this.close = closure
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,15 @@ class SignatureDelegate<C: Any> {
* @since 11/06/2024
*/
fun verify(closure: (C, ByteArray, ByteArray) -> Boolean) = this.apply { verify = closure }

/**
* This method sets a delegate to the close function of the signature.
*
* @author Cedric Hammes
* @since 11/06/2024
*/
@Suppress("MemberVisibilityCanBePrivate")
fun close(closure: (context: CipherContext<C>) -> Unit) {
this.close = closure
}
}

0 comments on commit 272aaae

Please sign in to comment.