hkdf_sha256: okm is a void *.
[ccan] / ccan / crypto / hkdf_sha256 / hkdf_sha256.c
index 0f26485703270c87d51f60f0542e5472f405ac52..f36bf67ade03c4a24219bc9ef55fdb49696318fe 100644 (file)
@@ -4,7 +4,7 @@
 #include <assert.h>
 #include <string.h>
 
-void hkdf_sha256(unsigned char *okm, size_t okm_size,
+void hkdf_sha256(void *okm, size_t okm_size,
                 const void *s, size_t ssize,
                 const void *k, size_t ksize,
                 const void *info, size_t isize)
@@ -83,7 +83,7 @@ void hkdf_sha256(unsigned char *okm, size_t okm_size,
 
        while (okm_size > sizeof(t)) {
                memcpy(okm, &t, sizeof(t));
-               okm += sizeof(t);
+               okm = (char *)okm + sizeof(t);
                okm_size -= sizeof(t);
 
                c++;