def prf(self): ''' effettua la prf ''' (minAddress,maxAddress,minNonce,maxNonce) = self.orderPadding() variablePart = minAddress + maxAddress + minNonce + maxNonce return base_crypto_utility.prf_512(self.pmk,self.mex,variablePart)
def testPrf_512(self): ''' testo della funzione prf_512 con il vettore 2 della rfc (pag 1128) ''' key = "Jefe" prefix = "prefix" data = "what do ya want for nothing?" prf = base_crypto_utility.prf_512(key,prefix,data) result = struct.pack('64B',0x51,0xf4,0xde,0x5b,0x33,0xf2,0x49,0xad,0xf8,0x1a,0xeb,0x71,0x3a,0x3c,0x20,0xf4,0xfe,0x63,0x14,0x46,0xfa,0xbd,0xfa,0x58,0x24,0x47,0x59,0xae,0x58,0xef,0x90,0x09,0xa9,0x9a,0xbf,0x4e,0xac,0x2c,0xa5,0xfa,0x87,0xe6,0x92,0xc4,0x40,0xeb,0x40,0x02,0x3e,0x7b,0xab,0xb2,0x06,0xd6,0x1d,0xe7,0xb9,0x2f,0x41,0x52,0x90,0x92,0xb8,0xfc)