aboutsummaryrefslogtreecommitdiff
path: root/crypto-vala/src/openssl.vala
blob: 4a2884672e0b951a16189524ecd0d1566dc6e974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
namespace Crypto {

public static void randomize(uint8[] buffer) {
    OpenSSL.RAND.bytes(buffer);
}

internal void openssl_error() throws Error {
    throw new Crypto.Error.OPENSSL(OpenSSL.ERR.reason_error_string(OpenSSL.ERR.get_error()));
}

public SymmetricCipherEncryption create_symmetric_cipher_encryption(string algo_name) throws Error {
    return new SymmetricCipherEncryptionOpenssl(algo_name);
}

public SymmetricCipherDecryption create_symmetric_cipher_decryption(string algo_name) throws Error {
    return new SymmetricCipherDecryptionOpenssl(algo_name);
}

}