Ruby: ext/openssl/ossl_digest.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions | Variables
ossl_digest.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Macros
#define | GetDigest(obj, ctx)

## Functions
const EVP_MD * | ossl_evp_get_digestbyname (VALUE obj)
VALUE | ossl_digest_new (const EVP_MD *md)
VALUE | ossl_digest_update (VALUE, VALUE)
void | Init_ossl_digest (void)

## Variables
VALUE | cDigest
VALUE | eDigestError

## Macro Definition Documentation

## ◆ GetDigest

#define GetDigest | ( |  | obj,
|  |  | ctx
| ) |  |

Value:
do { \
TypedData_Get_Struct((obj), EVP_MD_CTX, &ossl_digest_type, (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 12 of file ossl_digest.c.

## Function Documentation

## ◆ Init_ossl_digest()

void Init_ossl_digest | ( | void |  | ) |

Definition at line 314 of file ossl_digest.c.

References cDigest, eDigestError, eOSSLError, mOSSL, ossl_digest_update(), Qnil, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_method, rb_define_module(), rb_define_private_method, rb_eStandardError, rb_funcall(), rb_path2class(), and rb_str_new_cstr.

Referenced by Init_openssl().

## ◆ ossl_digest_new()

VALUE ossl_digest_new | ( | const EVP_MD * | md | ) |

Definition at line 73 of file ossl_digest.c.

References cDigest, eDigestError, EVP_MD_CTX_new, NULL, ossl_raise(), and RTYPEDDATA_DATA.

## ◆ ossl_digest_update()

VALUE ossl_digest_update | ( | VALUE | self,
|  | VALUE | data
| ) |  |

Definition at line 202 of file ossl_digest.c.

References eDigestError, GetDigest, ossl_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_digest().

## ◆ ossl_evp_get_digestbyname()

const EVP_MD * ossl_evp_get_digestbyname | ( | VALUE | obj | ) |

Definition at line 45 of file ossl_digest.c.

References GetDigest, name, NULL, ossl_raise(), PRIsVALUE, rb_eRuntimeError, StringValueCStr, and T_STRING.

## Variable Documentation

## ◆ cDigest

VALUE cDigest

Definition at line 22 of file ossl_digest.c.

Referenced by Init_ossl_digest(), and ossl_digest_new().

## ◆ eDigestError

VALUE eDigestError

Definition at line 23 of file ossl_digest.c.

Referenced by Init_ossl_digest(), ossl_digest_new(), and ossl_digest_update().