cardano-crypto-praos/cbits/vrf10_batchcompat/convert.c
int
_vrf_ietfdraft10_decode_proof_batchcompat(ge25519_p3 *Gamma, unsigned char U[crypto_core_ed25519_BYTES], unsigned char V[crypto_core_ed25519_BYTES],
                              unsigned char s[crypto_core_ed25519_SCALARBYTES], const unsigned char pi[crypto_vrf_ietfdraft10_PROOFBYTES_BATCHCOMPAT])
{
    /* gamma = decode_point(pi[0:32]) */
    if (_vrf_ietfdraft10_string_to_point(Gamma, pi) != 0) {
        return -1;
    }

    memmove(U, pi+crypto_core_ed25519_BYTES, crypto_core_ed25519_BYTES);
    memmove(V, pi+crypto_core_ed25519_BYTES * 2, crypto_core_ed25519_BYTES);
    memmove(s, pi+crypto_core_ed25519_BYTES * 3, crypto_core_ed25519_SCALARBYTES);

    if (s[63] & 240 &&
        sc25519_is_canonical(s) == 0) {
        return -1;
    }

    return 0;
}
/* Decode an 128-byte batch-compatible proof pi into a point gamma, a point U, a point V, and a
 * 32-byte scalar s, as specified in IETF draft section 5.4.4.
 * Verifier checks whether `s` is canonical.
 * Returns 0 on success, nonzero on failure.
 */
Decode an 128-byte batch-compatible proof pi into a point gamma, a point U, a point V, and a
32-byte scalar s, as specified in IETF draft section 5.4.4.
Verifier checks whether `s` is canonical.
Returns 0 on success, nonzero on failure.
Decode an 128 - byte batch - compatible proof pi into a point gamma a point U a point V and a 32 - byte scalar s as specified in IETF draft section 5 . 4 . 4 . Verifier checks whether ` s ` is canonical . Returns 0 on success nonzero on failure .
int
_vrf_ietfdraft10_decode_proof_batchcompat(ge25519_p3 *Gamma, unsigned char U[crypto_core_ed25519_BYTES], unsigned char V[crypto_core_ed25519_BYTES],
                              unsigned char s[crypto_core_ed25519_SCALARBYTES], const unsigned char pi[crypto_vrf_ietfdraft10_PROOFBYTES_BATCHCOMPAT])
{
    if (_vrf_ietfdraft10_string_to_point(Gamma, pi) != 0) {
        return -1;
    }
    memmove(U, pi+crypto_core_ed25519_BYTES, crypto_core_ed25519_BYTES);
    memmove(V, pi+crypto_core_ed25519_BYTES * 2, crypto_core_ed25519_BYTES);
    memmove(s, pi+crypto_core_ed25519_BYTES * 3, crypto_core_ed25519_SCALARBYTES);
    if (s[63] & 240 &&
        sc25519_is_canonical(s) == 0) {
        return -1;
    }
    return 0;
}
int _vrf_ietfdraft10_decode_proof_batchcompat ( ge25519_p3 * Gamma , unsigned char U [ crypto_core_ed25519_BYTES ] , unsigned char V [ crypto_core_ed25519_BYTES ] , unsigned char s [ crypto_core_ed25519_SCALARBYTES ] , const unsigned char pi [ crypto_vrf_ietfdraft10_PROOFBYTES_BATCHCOMPAT ] ) { if ( _vrf_ietfdraft10_string_to_point ( Gamma , pi ) != 0 ) { return -1 ; } memmove ( U , pi + crypto_core_ed25519_BYTES , crypto_core_ed25519_BYTES ) ; memmove ( V , pi + crypto_core_ed25519_BYTES * 2 , crypto_core_ed25519_BYTES ) ; memmove ( s , pi + crypto_core_ed25519_BYTES * 3 , crypto_core_ed25519_SCALARBYTES ) ; if ( s [ 63 ] & 240 && sc25519_is_canonical ( s ) == 0 ) { return -1 ; } return 0 ; }
Decode an 128-byte batch-compatible proof pi into a point gamma, a point U, a point V, and a
 32-byte scalar s, as specified in IETF draft section 5.4.4.
Decode an 128 - byte batch - compatible proof pi into a point gamma a point U a point V and a 32 - byte scalar s as specified in IETF draft section 5 . 4 . 4 .
/* gamma = decode_point(pi[0:32]) */