pike.git / src / post_modules / Nettle / nettle.cmod

version» Context lines:

pike.git/src/post_modules/Nettle/nettle.cmod:351:    {    free(THIS->ctr);    free(THIS->key);    free(THIS->data);    }   }      /*! @endclass    */    - /*! @decl int(0..) rsa_unpad(string(0..255) data, int type) + /*! @decl int(0..) rsa_unpad(string(0..255) data, int(1..2) type)    *!    *! Unpads a message that has been padded according to -  *! RSAES-PKCS1-V1_5-ENCODE(message) in PKCS#1 v2.2. The padding -  *! method used on the original message must be provided in the -  *! @[type] parameter. All content dependent processing is done in -  *! constant time for the same padding type and @[data] length. +  *! RSAES-PKCS1-V1_5-ENCODE(message) in PKCS#1 v2.2, but without the +  *! null byte prefix. The padding method used on the original message +  *! must be provided in the @[type] parameter. All content dependent +  *! processing is done in constant time for the same padding type and +  *! @[data] length.    */   PIKEFUN int rsa_unpad(string(0..255) data, int type)   {    int i, pad=0, nonpad=0, pos=0;    unsigned char *str;       NO_WIDE_STRING(data);       /* Indata is smaller than minimum size, so we can exit immediately    without timing issue. 1 type + 8 padding + 1 delimiter + 1 value