Oct 11, 2004

ishinao さんのアドバイスに基づいて Auth_TypeKey.php を bcmath でも使えるようにしてみました。powmod が php 5 からしかサポートされていないとか、invert がないとか、少々面倒ではありましたが、久々にちょっとした数学(算数?) のお勉強になったような気がするので、まあいいことに。

Auth_TypeKey.phps

TypeKey.php に rename して、/usr/local/lib/php/Auth/ 以下 (もしくは PEAR install dir の Auth 以下) にコピーして使ってください。

ちなみに、bcmath と gmp との比較は以下のとおり。速度差は、主にわたしが実装した上記の関数によると思われます。

bigint: bcmath
processing time: 1.043 sec.
VALID accout.
Thank you for sign-in.

bigint: gmp
processing time: 0.358 sec.
VALID accout.
Thank you for sign-in.
posted by hirata Oct 11, 2004, 12:00AM | Permalink | Comment | Trackbacks
Comments

めちゃめちゃ反応が遅れて申し訳ありません。BCMath対応版ありがとうございます。

まだちゃんとテストしていないんですけど、一点だけ。

多分、281行目は
$this->AUTH_TYPEKEY_BIGINT = $func;
 ↓
$this->AUTH_TYPEKEY_BIGINT = $ext;
だと思います。

posted by: ishinao on Oct 26, 2004, 8:14PM | link to this commmet

あ、もう一点見つけました。
var $AUTH_TYPEKEY_SIG_URL = 'http://www.typepad.com/extras/regkeys.txt';
 ↓
var $AUTH_TYPEKEY_SIG_URL = 'http://www.typekey.com/extras/regkeys.txt';
ですね。

今修正前のURLにアクセスしたらNot Foundになってたんですけど、それまでは上のURLのままでも問題なく動いていたということは、それまでは上記URLも有効だったってことなんでしょうか?

posted by: ishinao on Dec 20, 2004, 1:01AM | link to this commmet

Hi DH:

I plan to use your auth-type library to write a typekey plugin for pLog.

It works well (sample.php). But I still confused about how to use it. If I want to use it to authenticate a user has typekey or not? Becasue I just want my user comment my post who own typekey. Would you please kindly give me a example how to use this library.

Mark

posted by: Mark on Mar 11, 2005, 7:35PM | link to this commmet

ah ... I think I got the idea. Thanks.

Regards, Mark

posted by: Mark on Mar 11, 2005, 11:03PM | link to this commmet
TrackBacks
Trackback URL: http://daijihirata.com/mt/mt-tb.cgi/3536
Type Key Authentication on PHP
Weblog: Jacques Marneweck's Blog
Excerpt: Finally! There is a decent implementation for authentication using Type Key whic...
Trackbacked on: Nov 21, 2004, 1:11AM
[RandomNote][TypeKey] RandomeNote/PHP with TypeKey Authenticationテスト中 (15:15)
Weblog: tdiary.ishinao.net
Excerpt: RandomNoteをPHPにポーティングしたバージョンに、PHP版TypeKeyライブラリを使ってTypeKeyによる読み書き認証とmixiライクな足跡機能を...
Trackbacked on: Nov 22, 2004, 7:00PM
TypeKeyを試してみる。
Weblog: 帝都高速度文通営団
Excerpt: フォーラムにアカウント管理というか、へなちょこ固定ハンマシーンっていうかそんな感じの機能を付けるかどうか迷っていて、使えそうなツールをごそごそ。
Trackbacked on: Feb 16, 2005, 7:46PM