<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<p>I have the outlined definitions of 2 Plugins, 1 for
RSErasurePlugin and 1 for RSFECPlugin. They are published to
Cryptography. I am trying to understand how to write primitives to
get the work done. Any and All assistance MOST WELCOME! Let's get
her done!<br/>
</p>
<p>I believe I have properly implemented the #declareCVarsIn: and
initialized for both plugins.</p>
<p>I am looking at a primitive implementation in
RSFECPlugin>>#primitiveInverseWithSize. A few questions: am
I grabbing the stack arguments correctly? Testing their values
correctly? Correctly calling a method to do the work. Manipulating
the stack to setup a return value???</p>
<p>I am doing this...correct?</p>
<blockquote>
<p>self pop: 2 thenPushInteger: multiplied.<br/>
^interpreterProxy methodReturnInteger: multiplied.</p>
</blockquote>
<p>---</p>
<blockquote>
<p>primitiveInverseWithSize<br/>
<export: true><br/>
<var: 'a' declareC: 'unsigned short' ><br/>
<var: 'size' declareC: 'unsigned short' ><br/>
<br/>
| a size multiplied |<br/>
interpreterProxy methodArgumentCount = 2<br/>
ifFalse: [ ^interpreterProxy primitiveFailFor:
PrimErrBadNumArgs ].<br/>
a := interpreterProxy stackIntegerValue: 0.<br/>
size := interpreterProxy stackIntegerValue: 1.<br/>
<br/>
((interpreterProxy isBytes: a)<br/>
and: [ (interpreterProxy stSizeOf: a) = 2 ])<br/>
ifFalse: [ ^interpreterProxy primitiveFailFor:
PrimErrBadArgument ].<br/>
((interpreterProxy isBytes: size)<br/>
and: [ (interpreterProxy stSizeOf: a) = 2 ])<br/>
ifFalse: [ ^interpreterProxy primitiveFailFor:
PrimErrBadArgument ].<br/>
multiplied := self inverse: a withSize: size.<br/>
self pop: 2 thenPushInteger: multiplied.<br/>
^interpreterProxy methodReturnInteger: multiplied.</p>
</blockquote>
<p><br/>
</p>
<p>And:</p>
<blockquote>
<p>inverse: a withSize: size<br/>
<br/>
(a = 0)<br/>
ifTrue: [RSErasureIllegalArgumentError signal: 'the
argument is zero'].<br/>
^ expTable at: (size - ((logTable at: (a + 1)) - 1)).</p>
</blockquote>
<p><br/>
<br/>
</p>
<div class="moz-signature">-- <br/>
---<br/>
Kindly,<br/>
Robert<br/>
<br/>
<br/>
</div>
</body></html>