wish_app/wish_app.c
int wish_app_get_wsid(const char* app_name, uint8_t wsid[WISH_ID_LEN]) {
#if 0
    /* Just generate a wsid by first hashing the app name (to form 32
     * bytes), which is used as seed to ed25519 create keypair - note
     * that under this scheme the wsid will always be the same for any 
     * given app_name string. */
    mbedtls_sha256_context sha256_ctx;
    mbedtls_sha256_init(&sha256_ctx);
    mbedtls_sha256_starts(&sha256_ctx, 0); 
    mbedtls_sha256_update(&sha256_ctx, (const unsigned char *)app_name, 
        strnlen(app_name, WISH_APP_NAME_MAX_LEN)); 
    uint8_t seed[WISH_ED25519_SEED_LEN];
    mbedtls_sha256_finish(&sha256_ctx, seed);
    mbedtls_sha256_free(&sha256_ctx);

    uint8_t service_pubkey[WISH_PUBKEY_LEN];
    uint8_t service_privkey[WISH_PRIVKEY_LEN];
    ed25519_create_keypair(service_pubkey, service_privkey, seed);
#endif

    memset(wsid, 0, WISH_ID_LEN);
    strncpy(wsid, app_name, WISH_ID_LEN);
    return 0;
}
/**
 * Get WSID correspoinding to app_name, storing it to array wsid
 *
 * Returns 0 on success
 */
Get WSID correspoinding to app_name, storing it to array wsid
Returns 0 on success
Get WSID correspoinding to app_name storing it to array wsid Returns 0 on success
int wish_app_get_wsid(const char* app_name, uint8_t wsid[WISH_ID_LEN]) {
#if 0
    mbedtls_sha256_context sha256_ctx;
    mbedtls_sha256_init(&sha256_ctx);
    mbedtls_sha256_starts(&sha256_ctx, 0); 
    mbedtls_sha256_update(&sha256_ctx, (const unsigned char *)app_name, 
        strnlen(app_name, WISH_APP_NAME_MAX_LEN)); 
    uint8_t seed[WISH_ED25519_SEED_LEN];
    mbedtls_sha256_finish(&sha256_ctx, seed);
    mbedtls_sha256_free(&sha256_ctx);
    uint8_t service_pubkey[WISH_PUBKEY_LEN];
    uint8_t service_privkey[WISH_PRIVKEY_LEN];
    ed25519_create_keypair(service_pubkey, service_privkey, seed);
#endif
    memset(wsid, 0, WISH_ID_LEN);
    strncpy(wsid, app_name, WISH_ID_LEN);
    return 0;
}
int wish_app_get_wsid ( const char * app_name , uint8_t wsid [ WISH_ID_LEN ] ) { #if 0 mbedtls_sha256_context sha256_ctx ; mbedtls_sha256_init ( & sha256_ctx ) ; mbedtls_sha256_starts ( & sha256_ctx , 0 ) ; mbedtls_sha256_update ( & sha256_ctx , ( const unsigned char * ) app_name , strnlen ( app_name , WISH_APP_NAME_MAX_LEN ) ) ; uint8_t seed [ WISH_ED25519_SEED_LEN ] ; mbedtls_sha256_finish ( & sha256_ctx , seed ) ; mbedtls_sha256_free ( & sha256_ctx ) ; uint8_t service_pubkey [ WISH_PUBKEY_LEN ] ; uint8_t service_privkey [ WISH_PRIVKEY_LEN ] ; ed25519_create_keypair ( service_pubkey , service_privkey , seed ) ; #endif memset ( wsid , 0 , WISH_ID_LEN ) ; strncpy ( wsid , app_name , WISH_ID_LEN ) ; return 0 ; }
Get WSID correspoinding to app_name, storing it to array wsid
 Returns 0 on success
Get WSID correspoinding to app_name storing it to array wsid Returns 0 on success
/* Just generate a wsid by first hashing the app name (to form 32
     * bytes), which is used as seed to ed25519 create keypair - note
     * that under this scheme the wsid will always be the same for any 
     * given app_name string. */