mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 04:25:10 -07:00
Indent
This commit is contained in:
parent
8f353b5553
commit
70170c28c8
@ -14,8 +14,8 @@
|
||||
#include "utils.h"
|
||||
|
||||
int
|
||||
crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char * pk,
|
||||
unsigned char * sk,
|
||||
crypto_box_curve25519xchacha20poly1305_seed_keypair(unsigned char *pk,
|
||||
unsigned char *sk,
|
||||
const unsigned char *seed)
|
||||
{
|
||||
unsigned char hash[64];
|
||||
@ -37,7 +37,7 @@ crypto_box_curve25519xchacha20poly1305_keypair(unsigned char *pk,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char * k,
|
||||
crypto_box_curve25519xchacha20poly1305_beforenm(unsigned char *k,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
{
|
||||
@ -80,9 +80,9 @@ crypto_box_curve25519xchacha20poly1305_detached(
|
||||
}
|
||||
|
||||
int
|
||||
crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char * c,
|
||||
crypto_box_curve25519xchacha20poly1305_easy_afternm(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
{
|
||||
|
@ -9,8 +9,8 @@
|
||||
#include "utils.h"
|
||||
|
||||
int
|
||||
crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char * pk,
|
||||
unsigned char * sk,
|
||||
crypto_box_curve25519xsalsa20poly1305_seed_keypair(unsigned char *pk,
|
||||
unsigned char *sk,
|
||||
const unsigned char *seed)
|
||||
{
|
||||
unsigned char hash[64];
|
||||
@ -32,7 +32,7 @@ crypto_box_curve25519xsalsa20poly1305_keypair(unsigned char *pk,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char * k,
|
||||
crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char *k,
|
||||
const unsigned char *pk,
|
||||
const unsigned char *sk)
|
||||
{
|
||||
@ -46,9 +46,9 @@ crypto_box_curve25519xsalsa20poly1305_beforenm(unsigned char * k,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char * c,
|
||||
crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char *c,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
{
|
||||
@ -56,9 +56,9 @@ crypto_box_curve25519xsalsa20poly1305_afternm(unsigned char * c,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char * m,
|
||||
crypto_box_curve25519xsalsa20poly1305_open_afternm(unsigned char *m,
|
||||
const unsigned char *c,
|
||||
unsigned long long clen,
|
||||
unsigned long long clen,
|
||||
const unsigned char *n,
|
||||
const unsigned char *k)
|
||||
{
|
||||
|
@ -89,8 +89,8 @@ crypto_generichash_blake2b_init_salt_personal(
|
||||
|
||||
int
|
||||
crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state,
|
||||
const unsigned char * in,
|
||||
unsigned long long inlen)
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
{
|
||||
return blake2b_update(state, (const uint8_t *) in, (uint64_t) inlen);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ crypto_onetimeauth_poly1305_donna(unsigned char *out, const unsigned char *m,
|
||||
|
||||
static int
|
||||
crypto_onetimeauth_poly1305_donna_init(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char * key)
|
||||
const unsigned char *key)
|
||||
{
|
||||
COMPILER_ASSERT(sizeof(crypto_onetimeauth_poly1305_state) >=
|
||||
sizeof(poly1305_state_internal_t));
|
||||
|
@ -31,22 +31,22 @@ crypto_onetimeauth_poly1305_verify(const unsigned char *h,
|
||||
|
||||
int
|
||||
crypto_onetimeauth_poly1305_init(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char * key)
|
||||
const unsigned char *key)
|
||||
{
|
||||
return implementation->onetimeauth_init(state, key);
|
||||
}
|
||||
|
||||
int
|
||||
crypto_onetimeauth_poly1305_update(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char * in,
|
||||
unsigned long long inlen)
|
||||
const unsigned char *in,
|
||||
unsigned long long inlen)
|
||||
{
|
||||
return implementation->onetimeauth_update(state, in, inlen);
|
||||
}
|
||||
|
||||
int
|
||||
crypto_onetimeauth_poly1305_final(crypto_onetimeauth_poly1305_state *state,
|
||||
unsigned char * out)
|
||||
unsigned char *out)
|
||||
{
|
||||
return implementation->onetimeauth_final(state, out);
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ static POLY1305_NOINLINE void
|
||||
poly1305_init_ext(poly1305_state_internal_t *st, const unsigned char key[32],
|
||||
unsigned long long bytes)
|
||||
{
|
||||
uint32_t * R;
|
||||
uint32_t *R;
|
||||
uint128_t d[3];
|
||||
uint64_t r0, r1, r2;
|
||||
uint64_t rt0, rt1, rt2, st2, c;
|
||||
@ -880,7 +880,7 @@ poly1305_finish(poly1305_state_internal_t *st, unsigned char mac[16])
|
||||
|
||||
static int
|
||||
crypto_onetimeauth_poly1305_sse2_init(crypto_onetimeauth_poly1305_state *state,
|
||||
const unsigned char * key)
|
||||
const unsigned char *key)
|
||||
{
|
||||
COMPILER_ASSERT(sizeof(crypto_onetimeauth_poly1305_state) >=
|
||||
sizeof(poly1305_state_internal_t));
|
||||
@ -901,7 +901,7 @@ crypto_onetimeauth_poly1305_sse2_update(
|
||||
|
||||
static int
|
||||
crypto_onetimeauth_poly1305_sse2_final(crypto_onetimeauth_poly1305_state *state,
|
||||
unsigned char * out)
|
||||
unsigned char *out)
|
||||
{
|
||||
poly1305_finish((poly1305_state_internal_t *) (void *) state, out);
|
||||
|
||||
|
@ -200,8 +200,8 @@ from_base64(void *dst, size_t *dst_len, const char *src)
|
||||
static const char *
|
||||
decode_decimal(const char *str, unsigned long *v)
|
||||
{
|
||||
const char * orig;
|
||||
unsigned long acc;
|
||||
const char *orig;
|
||||
unsigned long acc;
|
||||
|
||||
acc = 0;
|
||||
for (orig = str;; str++) {
|
||||
|
@ -143,7 +143,7 @@ generate_addresses(const argon2_instance_t *instance,
|
||||
int
|
||||
fill_segment_ref(const argon2_instance_t *instance, argon2_position_t position)
|
||||
{
|
||||
block * ref_block = NULL, *curr_block = NULL;
|
||||
block *ref_block = NULL, *curr_block = NULL;
|
||||
uint64_t pseudo_rand, ref_index, ref_lane;
|
||||
uint32_t prev_offset, curr_offset;
|
||||
uint32_t starting_index;
|
||||
|
@ -142,7 +142,7 @@ int
|
||||
fill_segment_ssse3(const argon2_instance_t *instance,
|
||||
argon2_position_t position)
|
||||
{
|
||||
block * ref_block = NULL, *curr_block = NULL;
|
||||
block *ref_block = NULL, *curr_block = NULL;
|
||||
uint64_t pseudo_rand, ref_index, ref_lane;
|
||||
uint32_t prev_offset, curr_offset;
|
||||
uint32_t starting_index, i;
|
||||
|
@ -91,7 +91,7 @@ argon2_hash(const uint32_t t_cost, const uint32_t m_cost,
|
||||
{
|
||||
argon2_context context;
|
||||
int result;
|
||||
uint8_t * out;
|
||||
uint8_t *out;
|
||||
|
||||
if (pwdlen > ARGON2_MAX_PWD_LENGTH) {
|
||||
return ARGON2_PWD_TOO_LONG;
|
||||
@ -181,7 +181,7 @@ argon2_verify(const char *encoded, const void *pwd, const size_t pwdlen,
|
||||
argon2_type type)
|
||||
{
|
||||
argon2_context ctx;
|
||||
uint8_t * out;
|
||||
uint8_t *out;
|
||||
int decode_result;
|
||||
int ret;
|
||||
size_t encoded_len;
|
||||
|
@ -12,10 +12,10 @@
|
||||
int
|
||||
blake2b_long(void *pout, size_t outlen, const void *in, size_t inlen)
|
||||
{
|
||||
uint8_t * out = (uint8_t *) pout;
|
||||
uint8_t *out = (uint8_t *) pout;
|
||||
crypto_generichash_blake2b_state blake_state;
|
||||
uint8_t outlen_bytes[4 /* sizeof(uint32_t) */] = { 0 };
|
||||
int ret = -1;
|
||||
int ret = -1;
|
||||
|
||||
if (outlen > UINT32_MAX) {
|
||||
goto fail; /* LCOV_EXCL_LINE */
|
||||
|
@ -113,7 +113,7 @@ escrypt_r(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen,
|
||||
escrypt_kdf_t escrypt_kdf;
|
||||
const uint8_t *src;
|
||||
const uint8_t *salt;
|
||||
uint8_t * dst;
|
||||
uint8_t *dst;
|
||||
size_t prefixlen;
|
||||
size_t saltlen;
|
||||
size_t need;
|
||||
|
@ -113,9 +113,9 @@ blkxor(escrypt_block_t *dest, const escrypt_block_t *src, size_t len)
|
||||
static void
|
||||
salsa20_8(uint32_t B[16])
|
||||
{
|
||||
escrypt_block_t X;
|
||||
uint32_t * x = X.w;
|
||||
size_t i;
|
||||
escrypt_block_t X;
|
||||
uint32_t *x = X.w;
|
||||
size_t i;
|
||||
|
||||
blkcpy_64(&X, (escrypt_block_t *) B);
|
||||
for (i = 0; i < 8; i += 2) {
|
||||
|
@ -42,7 +42,7 @@ crypto_sign_ed25519_keypair(unsigned char *pk, unsigned char *sk)
|
||||
}
|
||||
|
||||
int
|
||||
crypto_sign_ed25519_pk_to_curve25519(unsigned char * curve25519_pk,
|
||||
crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk,
|
||||
const unsigned char *ed25519_pk)
|
||||
{
|
||||
ge_p3 A;
|
||||
@ -64,7 +64,7 @@ crypto_sign_ed25519_pk_to_curve25519(unsigned char * curve25519_pk,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_sign_ed25519_sk_to_curve25519(unsigned char * curve25519_sk,
|
||||
crypto_sign_ed25519_sk_to_curve25519(unsigned char *curve25519_sk,
|
||||
const unsigned char *ed25519_sk)
|
||||
{
|
||||
unsigned char h[crypto_hash_sha512_BYTES];
|
||||
|
@ -28,8 +28,8 @@ crypto_sign_edwards25519sha512batch_keypair(unsigned char *pk,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_sign_edwards25519sha512batch(unsigned char * sm,
|
||||
unsigned long long * smlen_p,
|
||||
crypto_sign_edwards25519sha512batch(unsigned char *sm,
|
||||
unsigned long long *smlen_p,
|
||||
const unsigned char *m,
|
||||
unsigned long long mlen,
|
||||
const unsigned char *sk)
|
||||
@ -66,8 +66,8 @@ crypto_sign_edwards25519sha512batch(unsigned char * sm,
|
||||
}
|
||||
|
||||
int
|
||||
crypto_sign_edwards25519sha512batch_open(unsigned char * m,
|
||||
unsigned long long * mlen_p,
|
||||
crypto_sign_edwards25519sha512batch_open(unsigned char *m,
|
||||
unsigned long long *mlen_p,
|
||||
const unsigned char *sm,
|
||||
unsigned long long smlen,
|
||||
const unsigned char *pk)
|
||||
|
@ -32,8 +32,8 @@ crypto_stream_aes128ctr_afternm(unsigned char *out, unsigned long long len,
|
||||
aes_uint128_t nonce_stack;
|
||||
unsigned long long lensav;
|
||||
unsigned char bl[128];
|
||||
unsigned char * blp;
|
||||
unsigned char * np;
|
||||
unsigned char *blp;
|
||||
unsigned char *np;
|
||||
unsigned char b;
|
||||
uint32_t tmp;
|
||||
|
||||
|
@ -34,9 +34,9 @@ copy2(aes_uint128_t *r, const aes_uint128_t *x)
|
||||
void
|
||||
shufb(aes_uint128_t *r, const unsigned char *l)
|
||||
{
|
||||
aes_uint128_t t;
|
||||
uint8_t * ct;
|
||||
uint8_t * cr;
|
||||
aes_uint128_t t;
|
||||
uint8_t *ct;
|
||||
uint8_t *cr;
|
||||
|
||||
copy2(&t, r);
|
||||
cr = r->u8;
|
||||
|
@ -33,8 +33,8 @@ crypto_stream_aes128ctr_xor_afternm(unsigned char *out, const unsigned char *in,
|
||||
aes_uint128_t nonce_stack;
|
||||
unsigned long long lensav;
|
||||
unsigned char bl[128];
|
||||
unsigned char * blp;
|
||||
unsigned char * np;
|
||||
unsigned char *blp;
|
||||
unsigned char *np;
|
||||
unsigned char b;
|
||||
uint32_t tmp;
|
||||
|
||||
|
@ -84,7 +84,7 @@ chacha20_encrypt_bytes(chacha_ctx *ctx, const uint8_t *m, uint8_t *c,
|
||||
x15;
|
||||
uint32_t j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14,
|
||||
j15;
|
||||
uint8_t * ctarget = NULL;
|
||||
uint8_t *ctarget = NULL;
|
||||
uint8_t tmp[64];
|
||||
unsigned int i;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user