Two million Yahoo users could have received malware from virus-infected ads on the search engine giant’s homepage that turn the computer into Bitcoin mining tools, according to security researchers.

Security research firm Light Cyber said the malware has been designed to create a big network of Bitcoin mining machines, draining the resources of PC users without their knowledge.

The infected PCs work towards solving the complex equations that award miners with Bitcoins – the method requires vast computational power and infecting then controlling other PCs is a cheaper way for miners to do it than by buying more hardware.

The equation-based rewarding of Bitcoins underpins the currency by ensuring the maths is complex enough that only a steady flow of coins enter the market, rather than a sudden influx.

Yahoo said that adverts on its European websites had been infected with malware between New Year’s Eve and January 3.

Yahoo said in a statement: "Users in North America, Asia Pacific and Latin America weren’t affected. Nor were users of Apple Macs or mobile devices.

"We will continue to monitor and block any advertisements being used for this activity."

"We will post more information for our users shortly."

In addition to the bitcoin mining malware, other installed malware includes ZeuS, Andromeda, Dorkbot, Tinba and Necurs.