File indexing completed on 2025-01-18 10:02:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef NETTLE_PKCS1_H_INCLUDED
0035 #define NETTLE_PKCS1_H_INCLUDED
0036
0037 #include "nettle-types.h"
0038 #include "bignum.h"
0039
0040 #ifdef __cplusplus
0041 extern "C" {
0042 #endif
0043
0044
0045 #define pkcs1_rsa_digest_encode nettle_pkcs1_rsa_digest_encode
0046 #define pkcs1_rsa_md5_encode nettle_pkcs1_rsa_md5_encode
0047 #define pkcs1_rsa_md5_encode_digest nettle_pkcs1_rsa_md5_encode_digest
0048 #define pkcs1_rsa_sha1_encode nettle_pkcs1_rsa_sha1_encode
0049 #define pkcs1_rsa_sha1_encode_digest nettle_pkcs1_rsa_sha1_encode_digest
0050 #define pkcs1_rsa_sha256_encode nettle_pkcs1_rsa_sha256_encode
0051 #define pkcs1_rsa_sha256_encode_digest nettle_pkcs1_rsa_sha256_encode_digest
0052 #define pkcs1_rsa_sha512_encode nettle_pkcs1_rsa_sha512_encode
0053 #define pkcs1_rsa_sha512_encode_digest nettle_pkcs1_rsa_sha512_encode_digest
0054 #define pkcs1_encrypt nettle_pkcs1_encrypt
0055 #define pkcs1_decrypt nettle_pkcs1_decrypt
0056
0057 struct md5_ctx;
0058 struct sha1_ctx;
0059 struct sha256_ctx;
0060 struct sha512_ctx;
0061
0062 int
0063 pkcs1_encrypt (size_t key_size,
0064
0065 void *random_ctx, nettle_random_func *random,
0066 size_t length, const uint8_t *message,
0067 mpz_t m);
0068
0069 int
0070 pkcs1_decrypt (size_t key_size,
0071 const mpz_t m,
0072 size_t *length, uint8_t *message);
0073
0074 int
0075 pkcs1_rsa_digest_encode(mpz_t m, size_t key_size,
0076 size_t di_length, const uint8_t *digest_info);
0077
0078 int
0079 pkcs1_rsa_md5_encode(mpz_t m, size_t length, struct md5_ctx *hash);
0080
0081 int
0082 pkcs1_rsa_md5_encode_digest(mpz_t m, size_t length, const uint8_t *digest);
0083
0084 int
0085 pkcs1_rsa_sha1_encode(mpz_t m, size_t length, struct sha1_ctx *hash);
0086
0087 int
0088 pkcs1_rsa_sha1_encode_digest(mpz_t m, size_t length, const uint8_t *digest);
0089
0090 int
0091 pkcs1_rsa_sha256_encode(mpz_t m, size_t length, struct sha256_ctx *hash);
0092
0093 int
0094 pkcs1_rsa_sha256_encode_digest(mpz_t m, size_t length, const uint8_t *digest);
0095
0096 int
0097 pkcs1_rsa_sha512_encode(mpz_t m, size_t length, struct sha512_ctx *hash);
0098
0099 int
0100 pkcs1_rsa_sha512_encode_digest(mpz_t m, size_t length, const uint8_t *digest);
0101
0102 #ifdef __cplusplus
0103 }
0104 #endif
0105
0106 #endif