cardano-crypto-praos/cbits/vrf10_batchcompat/convert.c
void
_vrf_ietfdraft10_hash_points(unsigned char c[16], const ge25519_p3 *P1,
                             const ge25519_p3 *P2, const unsigned char *P3,
                             const unsigned char *P4)
{
    unsigned char str[3+32*4], c1[crypto_hash_sha512_BYTES];

    str[0] = SUITE;
    str[1] = TWO;
    _vrf_ietfdraft10_point_to_string(str+2+crypto_core_ed25519_BYTES*0, P1);
    _vrf_ietfdraft10_point_to_string(str+2+crypto_core_ed25519_BYTES*1, P2);
    memmove(str+2+crypto_core_ed25519_BYTES*2, P3, crypto_core_ed25519_BYTES);
    memmove(str+2+crypto_core_ed25519_BYTES*3, P4, crypto_core_ed25519_BYTES);
    str[2 + crypto_core_ed25519_BYTES*4] = ZERO;
    crypto_hash_sha512(c1, str, sizeof str);
    memmove(c, c1, 16);
    sodium_memzero(c1, crypto_hash_sha512_BYTES);
}
/* Subroutine specified in draft spec section 5.4.3.
 * Hashes four points to a 16-byte string.
 * Constant time. For optimised calls*/
Subroutine specified in draft spec section 5.4.3.
Hashes four points to a 16-byte string.
Constant time. For optimised calls
Subroutine specified in draft spec section 5 . 4 . 3 . Hashes four points to a 16 - byte string . Constant time . For optimised calls
void
_vrf_ietfdraft10_hash_points(unsigned char c[16], const ge25519_p3 *P1,
                             const ge25519_p3 *P2, const unsigned char *P3,
                             const unsigned char *P4)
{
    unsigned char str[3+32*4], c1[crypto_hash_sha512_BYTES];
    str[0] = SUITE;
    str[1] = TWO;
    _vrf_ietfdraft10_point_to_string(str+2+crypto_core_ed25519_BYTES*0, P1);
    _vrf_ietfdraft10_point_to_string(str+2+crypto_core_ed25519_BYTES*1, P2);
    memmove(str+2+crypto_core_ed25519_BYTES*2, P3, crypto_core_ed25519_BYTES);
    memmove(str+2+crypto_core_ed25519_BYTES*3, P4, crypto_core_ed25519_BYTES);
    str[2 + crypto_core_ed25519_BYTES*4] = ZERO;
    crypto_hash_sha512(c1, str, sizeof str);
    memmove(c, c1, 16);
    sodium_memzero(c1, crypto_hash_sha512_BYTES);
}
void _vrf_ietfdraft10_hash_points ( unsigned char c [ 16 ] , const ge25519_p3 * P1 , const ge25519_p3 * P2 , const unsigned char * P3 , const unsigned char * P4 ) { unsigned char str [ 3 + 32 * 4 ] , c1 [ crypto_hash_sha512_BYTES ] ; str [ 0 ] = SUITE ; str [ 1 ] = TWO ; _vrf_ietfdraft10_point_to_string ( str + 2 + crypto_core_ed25519_BYTES * 0 , P1 ) ; _vrf_ietfdraft10_point_to_string ( str + 2 + crypto_core_ed25519_BYTES * 1 , P2 ) ; memmove ( str + 2 + crypto_core_ed25519_BYTES * 2 , P3 , crypto_core_ed25519_BYTES ) ; memmove ( str + 2 + crypto_core_ed25519_BYTES * 3 , P4 , crypto_core_ed25519_BYTES ) ; str [ 2 + crypto_core_ed25519_BYTES * 4 ] = ZERO ; crypto_hash_sha512 ( c1 , str , sizeof str ) ; memmove ( c , c1 , 16 ) ; sodium_memzero ( c1 , crypto_hash_sha512_BYTES ) ; }
Subroutine specified in draft spec section 5.4.3.
Subroutine specified in draft spec section 5 . 4 . 3 .