we are trying to implement a function P_SHA1 means PHP. The pattern of the function written in Python. But, unfortunately, something is not working properly. Here is the imp
You should have mentioned, that it is an implementation of "WS-SecureConversation 1.3" and that it is not SHA1, obviously, but rather a variation of HMAC-SHA1 with protocol specifics.
It turns out to be something from TLS (RFC 2246):
We use a subset of the mechanism defined for TLS in RFC 2246. Specifically, we use the P_SHA-1 function to generate a sequence of bytes that can be used to generate security keys.
You are not first one to ask, for example this question is without answer RFC 2246 PRF function in PHP