Compute semiprivate scalar modulo the group order

Tests still aren't passing :(