The 32-year-old actor, who plays estate manager Tom Branson in the ITV period drama, will play a Scottish spy for the Soviets who plots against Turing in The Imitation Game, reported Variety.

Sherlock star Benedict is already attached to play the British mathematician, who helped crack the German Enigma code during the final years of World War II, in the film based on the book Alan Turing: The Enigma.

Turing was prosecuted and convicted by the UK government in 1952 for having a sexual relationship with a man and had to undergo hormone treatment, which left him impotent. The genius mathematician and computer scientist committed suicide by eating an apple laced with cyanide in June 1954.

Keira has been in talks to play a woman from a very conservative background who formed a complicated relationship with Turing and was a close friend to him up until his death.

The movie, which has been written by Graham Moore, was top of the film’s industry Black List of hotly tipped unproduced scripts in 2011.

Matthew Goode is also attached to the project, which will be directed by Headhunters filmmaker Morten Tyldum.

Leonardo DiCaprio was previously linked to the role of Turing, while Ron Howard was said to be interested in directing the film.