third_party/wolfssl/wolfcrypt/src/curve25519.c
/* export curve25519 private key only raw (Big or Little endian)
 * outLen is in/out size
 * return 0 on success */
export curve25519 private key only raw (Big or Little endian)
outLen is in/out size
return 0 on success
export curve25519 private key only raw ( Big or Little endian ) outLen is in / out size return 0 on success
int wc_curve25519_export_private_raw_ex(curve25519_key* key, byte* out,
                                        word32* outLen, int endian)
{
    if (key == NULL || out == NULL || outLen == NULL)
        return BAD_FUNC_ARG;
    if (*outLen < CURVE25519_KEYSIZE) {
        *outLen = CURVE25519_KEYSIZE;
        return ECC_BAD_ARG_E;
    }
    *outLen = CURVE25519_KEYSIZE;
    if (endian == EC25519_BIG_ENDIAN) {
        int i;
        for (i = 0; i < CURVE25519_KEYSIZE; i++)
            out[i] = key->k.point[CURVE25519_KEYSIZE - i - 1];
    }
    else
        XMEMCPY(out, key->k.point, CURVE25519_KEYSIZE);
    return 0;
}
int wc_curve25519_export_private_raw_ex ( curve25519_key * key , byte * out , word32 * outLen , int endian ) { if ( key == NULL || out == NULL || outLen == NULL ) return BAD_FUNC_ARG ; if ( * outLen < CURVE25519_KEYSIZE ) { * outLen = CURVE25519_KEYSIZE ; return ECC_BAD_ARG_E ; } * outLen = CURVE25519_KEYSIZE ; if ( endian == EC25519_BIG_ENDIAN ) { int i ; for ( i = 0 ; i < CURVE25519_KEYSIZE ; i ++ ) out [ i ] = key -> k . point [ CURVE25519_KEYSIZE - i - 1 ] ; } else XMEMCPY ( out , key -> k . point , CURVE25519_KEYSIZE ) ; return 0 ; }
export curve25519 private key only raw (Big or Little endian)
 outLen is in/out size
 return 0 on success
export curve25519 private key only raw ( Big or Little endian ) outLen is in / out size return 0 on success
/* sanity check */ /* check size of outgoing buffer */ /* put the key in Big Endian format */