Interfaces
interface BlockCipher
public interface BlockCipher {
prop blockSize: Int64
prop algorithm: String
func encrypt(input: Array<Byte>): Array<Byte>
func decrypt(input: Array<Byte>): Array<Byte>
func encrypt(input: Array<Byte>, to!: Array<Byte>): Int64
func decrypt(input: Array<Byte>, to!: Array<Byte>): Int64
}
Description: Specifies a block encryption and decryption algorithm interface. Any class, interface, and struct inherited from this interface must comply with the definitions of the input parameters and return values of the functions in this interface.
prop algorithm
prop algorithm: String
Description: Obtains the name of a block encryption and decryption algorithm.
Type: String
prop blockSize
prop blockSize: Int64
Description: Obtains the size of a block, in bytes.
Type: Int64
func encrypt(Array<Byte>)
func encrypt(input: Array<Byte>): Array<Byte>
Description: Provides an encryption function.
Parameters:
Returns:
func decrypt(Array<Byte>)
func decrypt(input: Array<Byte>): Array<Byte>
Description: Provides a decryption function.
Parameters:
Returns:
func encrypt(Array<Byte>, Array<Byte>)
func encrypt(input: Array<Byte>, to!: Array<Byte>): Int64
Description: Provides an encryption function.
Parameters:
Returns:
- Int64: output length
func decrypt(Array<Byte>, Array<Byte>)
func decrypt(input: Array<Byte>, to!: Array<Byte>): Int64
Description: Provides a decryption function.
Parameters:
Returns:
- Int64: output length