aboutsummaryrefslogtreecommitdiff
path: root/crypto-vala/src/gcrypt.vala
diff options
context:
space:
mode:
Diffstat (limited to 'crypto-vala/src/gcrypt.vala')
-rw-r--r--crypto-vala/src/gcrypt.vala21
1 files changed, 21 insertions, 0 deletions
diff --git a/crypto-vala/src/gcrypt.vala b/crypto-vala/src/gcrypt.vala
new file mode 100644
index 00000000..1997a5e1
--- /dev/null
+++ b/crypto-vala/src/gcrypt.vala
@@ -0,0 +1,21 @@
+namespace Crypto {
+
+public static void randomize(uint8[] buffer) {
+ GCrypt.Random.randomize(buffer);
+}
+
+internal void may_throw_gcrypt_error(GCrypt.Error e) throws Error {
+ if (((int)e) != 0) {
+ throw new Crypto.Error.GCRYPT(e.to_string());
+ }
+}
+
+public SymmetricCipherEncryption create_symmetric_cipher_encryption(string algo_name) throws Error {
+ return new SymmetricCipherGcrypt(algo_name);
+}
+
+public SymmetricCipherDecryption create_symmetric_cipher_decryption(string algo_name) throws Error {
+ return new SymmetricCipherGcrypt(algo_name);
+}
+
+}