#!/usr/bin/env python
#
# $Id: bn.py,v 1.1 2001/07/12 05:47:15 tlau Exp $
#

import opensslc
import bnc
import wrap



class BIGNUM(wrap.Wrapper):
	def __init__(self, ptr = None):
#		attr_dict = \
#		{
#			'd': (bnc.BIGNUM_d_get, bnc.BIGNUM_d_set, None),
#		}
		wrap.Wrapper.__init__(self, ptr, bnc.BN_new, bnc.BN_free)



def bin2bn(data):
	result = bnc.BN_bin2bn(data, len(data), None)
	result = BIGNUM(result)
	return result


def stdout_print(bn):
	bnc.python_BN_print(bn.ptr)


