/*
- * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
#include <assert.h>
#include <string.h>
#include <openssl/crypto.h>
-
-#include "blake2_locl.h"
#include "blake2_impl.h"
+#include "internal/blake2.h"
static const uint32_t blake2s_IV[8] =
{
* Initialize the hashing context with the given parameter block.
* Always returns 1.
*/
-int BLAKE2s_Init(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P)
+int blake2s_init(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P)
{
blake2s_init_param(c, P);
return 1;
* Initialize the hashing context with the given parameter block and key.
* Always returns 1.
*/
-int BLAKE2s_Init_key(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P, const void *key)
+int blake2s_init_key(BLAKE2S_CTX *c, const BLAKE2S_PARAM *P, const void *key)
{
blake2s_init_param(c, P);
uint8_t block[BLAKE2S_BLOCKBYTES] = {0};
memcpy(block, key, P->key_length);
- BLAKE2s_Update(c, block, BLAKE2S_BLOCKBYTES);
+ blake2s_update(c, block, BLAKE2S_BLOCKBYTES);
OPENSSL_cleanse(block, BLAKE2S_BLOCKBYTES);
}
}
/* Absorb the input data into the hash state. Always returns 1. */
-int BLAKE2s_Update(BLAKE2S_CTX *c, const void *data, size_t datalen)
+int blake2s_update(BLAKE2S_CTX *c, const void *data, size_t datalen)
{
const uint8_t *in = data;
size_t fill;
* Calculate the final hash and save it in md.
* Always returns 1.
*/
-int BLAKE2s_Final(unsigned char *md, BLAKE2S_CTX *c)
+int blake2s_final(unsigned char *md, BLAKE2S_CTX *c)
{
uint8_t outbuffer[BLAKE2S_OUTBYTES] = {0};
uint8_t *target = outbuffer;