1 /* Copyright 2013-2017 Donald Stufft and individual contributors 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 // blake2b 17 size_t crypto_generichash_blake2b_bytes_min(); 18 size_t crypto_generichash_blake2b_bytes_max(); 19 size_t crypto_generichash_blake2b_bytes(); 20 21 size_t crypto_generichash_blake2b_keybytes_min(); 22 size_t crypto_generichash_blake2b_keybytes_max(); 23 size_t crypto_generichash_blake2b_keybytes(); 24 size_t crypto_generichash_blake2b_saltbytes(); 25 size_t crypto_generichash_blake2b_personalbytes(); 26 27 size_t crypto_generichash_statebytes(); 28 29 /* 30 * We use crypto_generichash_blake2b_state * as 31 * a pointer to a opaque buffer, 32 * therefore the following typedef makes sense: 33 */ 34 35 typedef void crypto_generichash_blake2b_state; 36 37 38 int crypto_generichash_blake2b_salt_personal( 39 unsigned char *out, size_t outlen, 40 const unsigned char *in, 41 unsigned long long inlen, 42 const unsigned char *key, size_t keylen, 43 const unsigned char *salt, 44 const unsigned char *personal); 45 46 int crypto_generichash_blake2b_init_salt_personal( 47 crypto_generichash_blake2b_state *state, 48 const unsigned char *key, 49 const size_t keylen, const size_t outlen, 50 const unsigned char *salt, 51 const unsigned char *personal); 52 53 int crypto_generichash_blake2b_update( 54 crypto_generichash_blake2b_state *state, 55 const unsigned char *in, 56 unsigned long long inlen); 57 58 int crypto_generichash_blake2b_final( 59 crypto_generichash_blake2b_state *state, 60 unsigned char *out, 61 const size_t outlen); 62