From a0dd7f90ba821e9984acb8625ac0b132c94ff898 Mon Sep 17 00:00:00 2001 From: David Michael Date: Sun, 18 Jun 2017 19:12:42 +0100 Subject: [PATCH] Simplified CryptKdfKeygen --- cryptokdf/crypto_kdf.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cryptokdf/crypto_kdf.go b/cryptokdf/crypto_kdf.go index bf9ac31..660150c 100644 --- a/cryptokdf/crypto_kdf.go +++ b/cryptokdf/crypto_kdf.go @@ -22,9 +22,10 @@ func CryptoKdfBytesMax() int { return int(C.crypto_kdf_bytes_max()) } -func CryptoKdfKeygen(k []byte) { - support.CheckSize(k, CryptoKdfKeybytes(), "keybytes") +func CryptoKdfKeygen() []byte { + k := make([]byte, CryptoKdfKeybytes()) C.crypto_kdf_keygen((*C.uchar)(&k[0])) + return k } func CryptoKdfDeriveFromKey(l int, i uint64, c string, k []byte) ([]byte, int) {