In a related ruling, the court also supported the right of judges to depart from sentencing guidelines in a case involving distribution of the drug ecstasy.
The decisions come a day before the agency that sets guidelines for federal sentences is to vote on whether to make retroactive a reduction in recommended crack-cocaine penalties.
There is also pressure in the US congress to revise a 1986 law mandating longer sentences for crack, which is considered more addictive than powder cocaine and a source of street violence.