Module pkcs1v15

Module pkcs1v15 

Source
Expand description

PKCS#1 v1.5 support as described in RFC8017 ยง 8.2.

ยงUsage

See code example in the toplevel rustdoc.

Functionsยง

decrypt_inner ๐Ÿ”’
Removes the PKCS1v15 padding It returns one or zero in valid that indicates whether the plaintext was correctly structured. In either case, the plaintext is returned in em so that it may be read independently of whether it was valid in order to maintain constant memory access patterns. If the plaintext was valid then index contains the index of the original message in em.
non_zero_random_bytes ๐Ÿ”’
Fills the provided slice with random values, which are guaranteed to not be zero.
pkcs1v15_encrypt_pad ๐Ÿ”’
Applied the padding scheme from PKCS#1 v1.5 for encryption. The message must be no longer than the length of the public modulus minus 11 bytes.
pkcs1v15_encrypt_unpad ๐Ÿ”’
Removes the encryption padding scheme from PKCS#1 v1.5.
pkcs1v15_generate_prefix ๐Ÿ”’
prefix = 0x30 <oid_len + 8 + digest_len> 0x30 <oid_len + 4> 0x06 <oid_len> oid 0x05 0x00 0x04 <digest_len>
pkcs1v15_sign_pad ๐Ÿ”’
pkcs1v15_sign_unpad ๐Ÿ”’