Functions | |
GWENHYWFAR_API int | GWEN_Padd_ApplyPaddAlgo (const GWEN_CRYPT_PADDALGO *a, GWEN_BUFFER *src) |
GWENHYWFAR_API int | GWEN_Padd_PaddWithAnsiX9_23 (GWEN_BUFFER *src) |
GWENHYWFAR_API int | GWEN_Padd_PaddWithISO9796 (GWEN_BUFFER *src) |
GWENHYWFAR_API int | GWEN_Padd_PaddWithIso9796_2 (GWEN_BUFFER *buf, int dstSize) |
GWENHYWFAR_API int | GWEN_Padd_PaddWithPkcs1Bt1 (GWEN_BUFFER *src, int dstSize) |
GWENHYWFAR_API int | GWEN_Padd_PaddWithPkcs1Bt2 (GWEN_BUFFER *src, int dstSize) |
GWENHYWFAR_API int | GWEN_Padd_UnapplyPaddAlgo (const GWEN_CRYPT_PADDALGO *a, GWEN_BUFFER *buf) |
GWENHYWFAR_API int | GWEN_Padd_UnpaddWithAnsiX9_23 (GWEN_BUFFER *src) |
GWENHYWFAR_API int | GWEN_Padd_UnpaddWithIso9796_2 (GWEN_BUFFER *buf) |
GWENHYWFAR_API int | GWEN_Padd_UnpaddWithPkcs1Bt1 (GWEN_BUFFER *src) |
GWENHYWFAR_API int | GWEN_Padd_UnpaddWithPkcs1Bt2 (GWEN_BUFFER *src) |
GWENHYWFAR_API int GWEN_Padd_ApplyPaddAlgo | ( | const GWEN_CRYPT_PADDALGO * | a, | |
GWEN_BUFFER * | src | |||
) |
Definition at line 404 of file padd.c.
References DBG_ERROR, DBG_INFO, GWEN_Buffer_FillLeftWithBytes(), GWEN_Buffer_FillWithBytes(), GWEN_Buffer_GetUsedBytes(), GWEN_Crypt_PaddAlgo_GetId(), GWEN_Crypt_PaddAlgo_GetPaddSize(), GWEN_CRYPT_PADDALGOID, GWEN_Crypt_PaddAlgoId_toString(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, GWEN_ERROR_NOT_AVAILABLE, GWEN_LOGDOMAIN, GWEN_Padd_PaddWithAnsiX9_23(), GWEN_Padd_PaddWithISO9796(), GWEN_Padd_PaddWithIso9796_2(), GWEN_Padd_PaddWithPkcs1Bt1(), and GWEN_Padd_PaddWithPkcs1Bt2().
Referenced by GWEN_Crypt_TokenFile__Encipher(), GWEN_Crypt_TokenFile__Sign(), and GWEN_Crypt_TokenFile__Verify().
GWENHYWFAR_API int GWEN_Padd_PaddWithAnsiX9_23 | ( | GWEN_BUFFER * | src | ) |
This function is used to pad the plain text data to a multiple of 8 bytes size before encrypting it. This is done by adding bytes to the buffer until its length is multiple of 8 bytes. The byte added is the number of padding bytes appended. Example: Buffer initially contains 5 bytes, so 3 bytes are needed to make the buffer length a multiple of 8. So the number "3" is added three times. Please note that if the buffer initially has a multiple of 8 bytes then 8 bytes are added (this is needed to make sure the unpadd function can always recover data padded in this manner).
Definition at line 224 of file padd.c.
References GWEN_Buffer_AppendByte(), and GWEN_Buffer_GetUsedBytes().
Referenced by GWEN_Padd_ApplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_PaddWithISO9796 | ( | GWEN_BUFFER * | src | ) |
This function padds the given buffer according to ISO9796. The given buffer is expected to contain a 20 byte hash created using RIPEMD 160. This is padded to 96 bytes according to ISO 9796 (including appendix A4).
Definition at line 71 of file padd.c.
References DBG_INFO, GWEN_Buffer_AppendBytes(), GWEN_Buffer_Crop(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_Reset(), GWEN_LOGDOMAIN, and GWEN_Padd_permutate().
Referenced by GWEN_Padd_ApplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_PaddWithIso9796_2 | ( | GWEN_BUFFER * | buf, | |
int | dstSize | |||
) |
This function padds according to ISO 8786-2.
Definition at line 142 of file padd.c.
References DBG_ERROR, GWEN_Buffer_AppendByte(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_InsertRoom(), GWEN_Buffer_Rewind(), GWEN_Crypt_Random(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
Referenced by check2(), and GWEN_Padd_ApplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_PaddWithPkcs1Bt1 | ( | GWEN_BUFFER * | src, | |
int | dstSize | |||
) |
Definition at line 261 of file padd.c.
References DBG_ERROR, GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_InsertRoom(), GWEN_Buffer_Rewind(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
Referenced by GWEN_Padd_ApplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_PaddWithPkcs1Bt2 | ( | GWEN_BUFFER * | src, | |
int | dstSize | |||
) |
Definition at line 299 of file padd.c.
References DBG_ERROR, GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_InsertRoom(), GWEN_Buffer_Rewind(), GWEN_Crypt_Random(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
Referenced by GWEN_Padd_ApplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_UnapplyPaddAlgo | ( | const GWEN_CRYPT_PADDALGO * | a, | |
GWEN_BUFFER * | buf | |||
) |
Definition at line 489 of file padd.c.
References DBG_ERROR, DBG_INFO, GWEN_Crypt_PaddAlgo_GetId(), GWEN_CRYPT_PADDALGOID, GWEN_Crypt_PaddAlgoId_toString(), GWEN_ERROR_GENERIC, GWEN_ERROR_NOT_AVAILABLE, GWEN_LOGDOMAIN, GWEN_Padd_UnpaddWithAnsiX9_23(), GWEN_Padd_UnpaddWithIso9796_2(), GWEN_Padd_UnpaddWithPkcs1Bt1(), and GWEN_Padd_UnpaddWithPkcs1Bt2().
Referenced by GWEN_Crypt_TokenFile__Decipher(), and GWEN_Crypt_TokenFile__Verify().
GWENHYWFAR_API int GWEN_Padd_UnpaddWithAnsiX9_23 | ( | GWEN_BUFFER * | src | ) |
This function is used to remove padding from plain text data after decrypting it.
Definition at line 236 of file padd.c.
References DBG_ERROR, GWEN_Buffer_Crop(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_SetPos(), and GWEN_LOGDOMAIN.
Referenced by GWEN_Padd_UnapplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_UnpaddWithIso9796_2 | ( | GWEN_BUFFER * | buf | ) |
Definition at line 189 of file padd.c.
References DBG_ERROR, GWEN_Buffer_Crop(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_ERROR_BAD_DATA, GWEN_ERROR_INVALID, and GWEN_LOGDOMAIN.
Referenced by check2(), and GWEN_Padd_UnapplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_UnpaddWithPkcs1Bt1 | ( | GWEN_BUFFER * | src | ) |
Definition at line 392 of file padd.c.
References GWEN_Padd__UnpaddWithPkcs1Bt1Or2().
Referenced by GWEN_Padd_UnapplyPaddAlgo().
GWENHYWFAR_API int GWEN_Padd_UnpaddWithPkcs1Bt2 | ( | GWEN_BUFFER * | src | ) |
Definition at line 398 of file padd.c.
References GWEN_Padd__UnpaddWithPkcs1Bt1Or2().
Referenced by GWEN_Padd_UnapplyPaddAlgo().